Multi-head Transformers Provably Learn Symbolic Multi-step Reasoning via Gradient Descent
Tong Yang, Yu Huang, Yingbin Liang, Yuejie Chi
Abstract
Transformers have demonstrated remarkable capabilities in multi-step reasoning tasks. However, understandings of the underlying mechanisms by which they acquire these abilities through training remain limited, particularly from a theoretical standpoint. This work investigates how transformers learn to solve symbolic multi-step reasoning problems through chain-of-thought processes, focusing on path-finding in trees. We analyze two intertwined tasks: a backward reasoning task, where the model outputs a path from a goal node to the root, and a more complex forward reasoning task, where the model implements two-stage reasoning by first identifying the goal-to-root path and then reversing it to produce the root-to-goal path. Our theoretical analysis, grounded in the dynamics of gradient descent, shows that trained one-layer transformers can provably solve both tasks with generalization guarantees to unseen trees. In particular, our multi-phase training dynamics for forward reasoning elucidate how different attention heads learn to specialize and coordinate autonomously to solve the two subtasks in a single autoregressive path. These results provide a mechanistic explanation of how trained transformers can implement sequential algorithmic procedures. Moreover, they offer insights into the emergence of reasoning abilities, suggesting that when tasks are structured to take intermediate chain-of-thought steps, even shallow multi-head transformers can effectively solve problems that would otherwise require deeper architectures.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
5 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Transformers Provably Learn Chain-of-Thought Reasoning with Length Generalization cites The Expressive Power of Transformers with Chain of Thought
- Transformers Provably Learn Chain-of-Thought Reasoning with Length Generalization cites Chain of Thought Empowers Transformers to Solve Inherently Serial Problems
- Transformers Provably Learn Chain-of-Thought Reasoning with Length Generalization cites Why think step by step? Reasoning emerges from the locality of experience
- Transformers Provably Learn Chain-of-Thought Reasoning with Length Generalization cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Transformers Provably Learn Chain-of-Thought Reasoning with Length Generalization cites Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspective
- The Expressive Power of Transformers with Chain of Thought cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- The Expressive Power of Transformers with Chain of Thought cites Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspective
- Transformers with RL or SFT Provably Learn Sparse Boolean Functions, But Differently cites The Expressive Power of Transformers with Chain of Thought
- Transformers with RL or SFT Provably Learn Sparse Boolean Functions, But Differently cites Chain of Thought Empowers Transformers to Solve Inherently Serial Problems
- Transformers with RL or SFT Provably Learn Sparse Boolean Functions, But Differently cites On the Emergence of Implicit Curriculum in RLVR Learning Dynamics
- On the Emergence of Implicit Curriculum in RLVR Learning Dynamics cites Transformers with RL or SFT Provably Learn Sparse Boolean Functions, But Differently
- Transformers with RL or SFT Provably Learn Sparse Boolean Functions, But Differently cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Chain of Thought Empowers Transformers to Solve Inherently Serial Problems cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Chain of Thought Empowers Transformers to Solve Inherently Serial Problems cites Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspective
- Provable Sample Efficiency of Curriculum Post-Training for Transformer Reasoning cites Transformers Provably Learn Chain-of-Thought Reasoning with Length Generalization
- Provable Sample Efficiency of Curriculum Post-Training for Transformer Reasoning cites The Expressive Power of Transformers with Chain of Thought
- Provable Sample Efficiency of Curriculum Post-Training for Transformer Reasoning cites Chain of Thought Empowers Transformers to Solve Inherently Serial Problems
- Why think step by step? Reasoning emerges from the locality of experience cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- On the Emergence of Implicit Curriculum in RLVR Learning Dynamics cites Transformers Provably Learn Chain-of-Thought Reasoning with Length Generalization
- Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspective cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
Cited by top-tier papers5
- Transformers Provably Learn Chain-of-Thought Reasoning with Length GeneralizationYu Huang, Zixin Wen, Aarti Singh, Yuejie Chi et al.NeurIPS 2025 · 22 citations
- On the Emergence of Implicit Curriculum in RLVR Learning DynamicsYu Huang, Zixin Wen, Yuejie Chi, Yuting Wei et al.ICML 2026 · 6 citations
- Transformers with RL or SFT Provably Learn Sparse Boolean Functions, But DifferentlyBochen Lyu, Yiyang Jia, Xiaohao Cai, Zhanxing ZhuICML 2026
- Provable Sample Efficiency of Curriculum Post-Training for Transformer ReasoningDake Bu, Wei Huang, Andi Han, Atsushi Nitanda et al.ICML 2026
- Focus and Dilution: The Multi-stage Learning Process of AttentionZheng-An Chen, Pengxiao Lin, Zhi-Qin John Xu, Tao LuoICML 2026
Builds on25
- Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma et al.NeurIPS 2022 · 22,562 citations
- Towards Revealing the Mystery behind Chain of Thought: A Theoretical PerspectiveGuhao Feng, Bohang Zhang, Yuntian Gu, Haotian Ye et al.NeurIPS 2023 · 470 citations
- Chain of Thought Empowers Transformers to Solve Inherently Serial ProblemsZhiyuan Liu, Hong Liu, Denny Zhou, Tengyu MaICLR 2024 · 259 citations
- The Expressive Power of Transformers with Chain of ThoughtWilliam Merrill, Ashish SabharwalICLR 2024 · 243 citations
- Why think step by step? Reasoning emerges from the locality of experienceBen Prystawski, Michael Li, Noah D. GoodmanNeurIPS 2023 · 168 citations
Related papers
- Emergence of Superposition: Unveiling the Training Dynamics of Chain of Continuous ThoughtHanlin Zhu, Shibo Hao, Zhiting Hu, Jiantao Jiao et al.ICLR 2026 · 21 citations
- Can Transformers Reason Logically? A Study in SAT SolvingLeyan Pan, Vijay Ganesh, Jacob D. Abernethy, Chris Esposo et al.ICML 2025
- Measuring Systematic Generalization in Neural Proof Generation with TransformersNicolas Gontier, Koustuv Sinha, Siva Reddy, Christopher PalNeurIPS 2020 · 69 citations
- Towards a Theoretical Understanding of the 'Reversal Curse' via Training DynamicsHanlin Zhu, Baihe Huang, Shaolun Zhang, Michael I. Jordan et al.NeurIPS 2024 · 37 citations
- Transformers Provably Solve Parity Efficiently with Chain of ThoughtJuno Kim, Taiji SuzukiICLR 2025
