[Paper Review] Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspective
The paper analyzes why Chain-of-Thought prompts help LLMs, showing through complexity-theoretic results that CoT enables solving math and DP tasks that direct generation cannot, and provides supporting experiments.
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.
Motivation & Objective
- Assess the expressivity limits of bounded-depth Transformers for basic math tasks without CoT.
- Show that constant-size autoregressive Transformers can generate CoT solutions for arithmetic and equation tasks.
- Demonstrate that LLMs with CoT can solve Dynamic Programming problems under a formal framework.
- Provide empirical evidence that CoT enables correct step-by-step solutions and generalization to longer inputs.
Proposed method
- Model the Transformer as a log-precision autoregressive circuit to study depth/size trade-offs.
- Prove impossibility results: bounded-depth Transformers cannot solve Arithmetic(n,p) and Equation(m,p) without CoT under TC0 vs NC1 assumptions.
- Constructive proofs: constant-size autoregressive Transformers can generate CoT solutions for Arithmetic(n,p) and Equation(m,p).
- Frame DP problems with state space, transition, and aggregation, and prove CoT-enabled Transformers can produce correct DP outputs (Theorem 4.7).
- Provide impossibility results for DP without CoT via CFG Membership Testing (Theorem 4.8).
- Complement theory with experiments on arithmetic, equation, LIS, and edit distance tasks showing CoT advantages.
Experimental results
Research questions
- RQ1Can bounded-depth Transformers directly output correct answers for arithmetic expressions and linear equations without CoT?
- RQ2Does generating CoT increase the effective depth of the Transformer circuit enough to solve these tasks?
- RQ3Are DP problems solvable by LLMs with CoT, and under what assumptions?
- RQ4What are the limits of CoT for problems like CFG membership testing without increasing network depth?
Key findings
- Impossibility results show bounded-depth log-precision Transformers cannot solve Arithmetic(n,p) or Equation(m,p) without CoT under TC0≠NC1.
- Constant-size autoregressive Transformers can generate CoT solutions for Arithmetic(n,p) and Equation(m,p) with depth 5 or 4 and polynomially bounded parameters.
- LLMs with CoT can solve general DP problems, with Theorem 4.7 proving correctness for inputs up to size n under mild assumptions.
- Without CoT, DP problems like CFG Membership Testing are hard for bounded-depth Transformers (Theorem 4.8).
- Experiments across Arithmetic, Equation, LIS, and Edit Distance show CoT-trained models achieve high accuracy and generalize to longer inputs, unlike direct-output models.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.