Towards Revealing the Mystery behind Chain of Thought: a Theoretical Perspective

Guhao Feng, Yuntian Gu, Bohang Zhang, Haotian Ye, Di He +1 more
2/12/2026

No official code found. Best implementation: guyuntian/CoT_benchmark (21 stars, MIT, last commit 2023-07-16).

Abstract

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. We start by giving an impossibility result 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 are capable of solving a general class of decision-making problems known as Dynamic Programming, thus justifying its power in tackling complex real-world tasks. Finally, extensive experiments on four tasks show that, while Transformers always fail to predict the answers directly, they can consistently learn to generate correct solutions step-by-step given sufficient CoT demonstrations.

View on arXivView PDF

Code Implementations(1)

MIT

Code for "Towards Revealing the Mystery behind Chain of Thought: a Theoretical Perspective"

213PythonMay 28, 20233 years agoMIT

Similar Papers

Cite this paper

@article{feng2026towards,
  title  = {Towards Revealing the Mystery behind Chain of Thought: a Theoretical Perspective},
  author = {Guhao Feng and Yuntian Gu and Bohang Zhang and Haotian Ye and Di He and Liwei Wang},
  year   = {2026},
  eprint = {2305.15408},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/pdf/2305.15408},
  journal = {NEURIPS 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2305.15408.svg)](https://codeofpaper.com/paper/2305.15408)

Discussion