Understanding Transformer Reasoning Capabilities via Graph Algorithms
Clayton Sanford, Bahare Fatemi, Ethan Hall, Anton Tsitsulin, Mehran Kazemi, Jonathan Halcrow, Bryan Perozzi, Vahab Mirrokni
摘要
Which transformer scaling regimes are able to perfectly solve different classes of algorithmic problems? While tremendous empirical advances have been attained by transformer-based neural networks, a theoretical understanding of their algorithmic reasoning capabilities in realistic parameter regimes is lacking. We investigate this question in terms of the network's depth, width, and number of extra tokens for algorithm execution. Our novel representational hierarchy separates 9 algorithmic reasoning problems into classes solvable by transformers in different realistic parameter scaling regimes. We prove that logarithmic depth is necessary and sufficient for tasks like graph connectivity, while single-layer transformers with small embedding dimensions can solve contextual retrieval tasks. We also support our theoretical analysis with ample empirical evidence using the GraphQA benchmark. These results show that transformers excel at many graph reasoning tasks, even outperforming specialized graph neural networks.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 44 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Transformers Provably Learn Chain-of-Thought Reasoning with Length Generalization 引用了 A Little Depth Goes a Long Way: The Expressive Power of Log-Depth Transformers
- Transformers Provably Learn Chain-of-Thought Reasoning with Length Generalization 引用了 Large Language Models are Zero-Shot Reasoners
- Transformers Provably Learn Chain-of-Thought Reasoning with Length Generalization 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Transformers Provably Learn Chain-of-Thought Reasoning with Length Generalization 引用了 How Far Can Transformers Reason? The Globality Barrier and Inductive Scratchpad
- A Little Depth Goes a Long Way: The Expressive Power of Log-Depth Transformers 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale 引用了 Language Models are Few-Shot Learners
- Large Language Models are Zero-Shot Reasoners 引用了 Language Models are Few-Shot Learners
- Large Language Models are Zero-Shot Reasoners 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Swin Transformer: Hierarchical Vision Transformer using Shifted Windows 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- How Far Can Transformers Reason? The Globality Barrier and Inductive Scratchpad 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- How Far Can Transformers Reason? The Globality Barrier and Inductive Scratchpad 引用了 Large Language Models are Zero-Shot Reasoners
- How Far Can Transformers Reason? The Globality Barrier and Inductive Scratchpad 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Reasoning by Superposition: A Theoretical Perspective on Chain of Continuous Thought 引用了 A Little Depth Goes a Long Way: The Expressive Power of Log-Depth Transformers
- Reasoning by Superposition: A Theoretical Perspective on Chain of Continuous Thought 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
引用它的顶会 Paper44
- Reasoning by Superposition: A Theoretical Perspective on Chain of Continuous ThoughtHanlin Zhu, Shibo Hao, Zhiting Hu, Jiantao Jiao 等NeurIPS 2025 · 86 次引用
- A Little Depth Goes a Long Way: The Expressive Power of Log-Depth TransformersWilliam Merrill, Ashish SabharwalNeurIPS 2025 · 62 次引用
- How Far Can Transformers Reason? The Globality Barrier and Inductive ScratchpadEmmanuel Abbe, Samy Bengio, Aryo Lotfi, Colin Sandon 等NeurIPS 2024 · 52 次引用
- The Coverage Principle: How Pre-Training Enables Post-TrainingFan Chen, Audrey Huang, Noah Golowich, Sadhika Malladi 等ICLR 2026 · 28 次引用
- Transformers Provably Learn Chain-of-Thought Reasoning with Length GeneralizationYu Huang, Zixin Wen, Aarti Singh, Yuejie Chi 等NeurIPS 2025 · 22 次引用
它引用的 Paper31
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
- Swin Transformer: Hierarchical Vision Transformer using Shifted WindowsZe Liu, Yutong Lin, Yue Cao, Han Hu 等ICCV 2021 · 31,683 次引用
- Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma 等NeurIPS 2022 · 22,562 次引用
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn 等ICLR 2021 · 21,477 次引用
- Large Language Models are Zero-Shot ReasonersTakeshi Kojima, Shixiang Shane Gu, Machel Reid, Yutaka Matsuo 等NeurIPS 2022 · 8,168 次引用
相关 Paper
- Depth-Width Tradeoffs for Transformers on Graph TasksGilad Yehudai, Clayton Sanford, Maya Bechler-Speicher, Orr Fischer 等NeurIPS 2025 · 10 次引用
- Transformers Learn Shortcuts to AutomataBingbin Liu, Jordan T. Ash, Surbhi Goel, Akshay Krishnamurthy 等ICLR 2023 · 11 次引用
- Compositional Reasoning with Transformers, RNNs, and Chain of ThoughtGilad Yehudai, Noah Amsel, Joan BrunaNeurIPS 2025 · 7 次引用
- What Can Transformer Learn with Varying Depth? Case Studies on Sequence Learning TasksXingwu Chen, Difan ZouICML 2024 · 22 次引用
- Simulation of Graph Algorithms with Looped TransformersArtur Back de Luca, Kimon FountoulakisICML 2024 · 31 次引用
