[论文解读] Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspective
论文分析 Chain-of-Thought 提示为何对 LLM 有帮助,通过复杂性理论结果显示 CoT 能使解决数学和 DP 任务,而直接生成无法解决,并提供支持性实验。
Recent studies have discovered that Chain-of-Thought prompting (CoT) can dramatically improve the performance of Large Language Models (LLMs), particularly when dealing with complex tasks involving mathematics or reasoning. Despite the enormous empirical success, the underlying mechanisms behind CoT and how it unlocks the potential of LLMs remain elusive. In this paper, we take a first step towards theoretically answering these questions. Specifically, we examine the expressivity of LLMs with CoT in solving fundamental mathematical and decision-making problems. By using circuit complexity theory, we first give impossibility results showing that bounded-depth Transformers are unable to directly produce correct answers for basic arithmetic/equation tasks unless the model size grows super-polynomially with respect to the input length. In contrast, we then prove by construction that autoregressive Transformers of constant size suffice to solve both tasks by generating CoT derivations using a commonly used math language format. Moreover, we show LLMs with CoT can handle a general class of decision-making problems known as Dynamic Programming, thus justifying its power in tackling complex real-world tasks. Finally, an extensive set of experiments show that, while Transformers always fail to directly predict the answers, they can consistently learn to generate correct solutions step-by-step given sufficient CoT demonstrations.
研究动机与目标
- 评估在不使用 CoT 的情况下,有界深度 Transformer 对基础数学任务的表达能力极限。
- 显示常规模型自回归 Transformer 能生成 Arithmetic(n,p) 与 Equation(m,p) 的 CoT 解决方案。
- Demonstrate that LLMs with CoT can solve Dynamic Programming problems under a formal framework.
- 在一个formal 框架下证明具备 CoT 的 LLM 可以解决动态规划问题。
- 提供实证证据,表明 CoT 能实现正确的逐步解答并对更长输入具有泛化能力。
提出的方法
- 将 Transformer 建模为对数精度自回归电路,以研究深度/大小的权衡。
- 证明不可行性结论:在 TC0 与 NC1 假设下,带有界深度的 Transformer 在没有 CoT 的情况下无法求解 Arithmetic(n,p) 和 Equation(m,p)。
- 构造性证明:常规模自回归 Transformer 可以为 Arithmetic(n,p) 和 Equation(m,p) 生成 CoT 解决方案。
- 将 DP 问题框定为状态空间、转移和聚合,并证明具 CoT 的 Transformer 能产出正确的 DP 输出(定理 4.7)。
- 通过 CFG 成员测试为 DP 无 CoT 提供不可行性结果(定理 4.8)。
- 通过对算术、方程、LIS 与编辑距离任务的实验来补充理论,显示 CoT 的优势。
实验结果
研究问题
- RQ1带界深度的 Transformer 是否能在没有 CoT 的情况下直接给出算术表达式和线性方程的正确答案?
- RQ2生成 CoT 是否足以增加 Transformer 电路的有效深度来解决这些任务?
- RQ3具 CoT 的 LLMs 是否能解决 DP 问题,在什么假设下?
- RQ4在不增加网络深度的前提下,CoT 对 CFG 成员测试等问题的局限性是什么?
主要发现
- 不可行性结果表明,在 TC0≠NC1 条件下,带对数精度的有界深度 Transformer 在没有 CoT 的情况下无法求解 Arithmetic(n,p) 或 Equation(m,p)。
- 常规模自回归 Transformer 能生成 Arithmetic(n,p) 与 Equation(m,p) 的 CoT 解决方案,深度为 5 或 4,参数多项式界定。
- 具 CoT 的 LLMs 能解决一般 DP 问题,定理 4.7 在温和假设下证明对不超过大小为 n 的输入的正确性。
- 在没有 CoT 的情况下,像 CFG 成员测试这样的 DP 问题对有界深度 Transformer 来说很困难(定理 4.8)。
- 对算术、方程、LIS 和编辑距离的实验表明,经过 CoT 训练的模型具有高准确性并能泛化到更长的输入,而非直接输出模型。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。