Lune

NeurIPS2025Top-tier venue

A Little Depth Goes a Long Way: The Expressive Power of Log-Depth Transformers

William Merrill, Ashish Sabharwal

Abstract

Recent theoretical results show transformers cannot express sequential reasoning problems over long inputs, intuitively because their computational depth is bounded. However, prior work treats the depth as a constant, leaving it unclear to what degree bounded depth may suffice for solving problems over short inputs, or how increasing the transformer's depth affects its expressive power. We address these questions by analyzing transformers whose depth can grow minimally with context length nn. We show even highly uniform transformers with depth Θ(log⁡n)\Theta(\log n) can express two important problems: recognizing regular languages, which captures state tracking abilities and was known to be expressible only by an unconventional, non-uniform model of transformers, and graph connectivity, which underlies multi-step reasoning. Notably, both of these problems cannot be expressed by fixed-depth transformers under standard complexity conjectures, demonstrating the expressivity benefit of growing depth. Moreover, our theory quantitatively predicts how depth must grow with input length to express these problems, showing that depth scaling is more efficient than scaling width or chain-of-thought steps. Empirically, our detailed experiments designed to bridge the expressivity vs. learnability gap reveal that our theoretical depth requirements for regular language recognition closely match the practical depth requirements for successfully training transformers. Thus, our results clarify how depth affects a transformer's reasoning capabilities, and provide practical guidance for effective depth selection for sequential reasoning.

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.

26 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Constant Bit-size Transformers Are Turing Complete cites Chain of Thought Empowers Transformers to Solve Inherently Serial Problems
  • Transformers Provably Learn Chain-of-Thought Reasoning with Length Generalization cites Exact Expressive Power of Transformers with Padding
  • Transformers Provably Learn Chain-of-Thought Reasoning with Length Generalization cites The Impact of Positional Encoding on Length Generalization in Transformers
  • 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 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • Exact Expressive Power of Transformers with Padding cites Chain of Thought Empowers Transformers to Solve Inherently Serial Problems
  • Exact Expressive Power of Transformers with Padding cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • Exact Expressive Power of Transformers with Padding cites On Layer Normalization in the Transformer Architecture
  • Coevolutionary Continuous Discrete Diffusion: Make Your Diffusion Language Model a Latent Reasoner cites Reasoning by Superposition: A Theoretical Perspective on Chain of Continuous Thought
  • The Impact of Positional Encoding on Length Generalization in Transformers 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 On Layer Normalization in the Transformer Architecture
  • Reasoning by Superposition: A Theoretical Perspective on Chain of Continuous Thought cites Chain of Thought Empowers Transformers to Solve Inherently Serial Problems
  • Reasoning by Superposition: A Theoretical Perspective on Chain of Continuous Thought cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers26

  1. Reasoning by Superposition: A Theoretical Perspective on Chain of Continuous ThoughtHanlin Zhu, Shibo Hao, Zhiting Hu, Jiantao Jiao et al.NeurIPS 2025 · 86 citations
  2. Transformers Provably Learn Chain-of-Thought Reasoning with Length GeneralizationYu Huang, Zixin Wen, Aarti Singh, Yuejie Chi et al.NeurIPS 2025 · 22 citations
  3. Constant Bit-size Transformers Are Turing CompleteQian Li, Yuyi WangNeurIPS 2025 · 21 citations
  4. Exact Expressive Power of Transformers with PaddingWilliam Merrill, Ashish SabharwalNeurIPS 2025 · 21 citations
  5. Coevolutionary Continuous Discrete Diffusion: Make Your Diffusion Language Model a Latent ReasonerCai Zhou, Chenxiao Yang, Yi Hu, Chenyu Wang et al.ICML 2026 · 21 citations

Builds on14

  1. Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma et al.NeurIPS 2022 · 22,562 citations
  2. On Layer Normalization in the Transformer ArchitectureRuibin Xiong, Yunchang Yang, Di He, Kai Zheng et al.ICML 2020 · 1,388 citations
  3. The Impact of Positional Encoding on Length Generalization in TransformersAmirhossein Kazemnejad, Inkit Padhi, Karthikeyan Natesan Ramamurthy, Payel Das et al.NeurIPS 2023 · 444 citations
  4. Scaling up Test-Time Compute with Latent Reasoning: A Recurrent Depth ApproachJonas Geiping, Sean McLeish, Neel Jain, John Kirchenbauer et al.NeurIPS 2025 · 431 citations
  5. Chain of Thought Empowers Transformers to Solve Inherently Serial ProblemsZhiyuan Liu, Hong Liu, Denny Zhou, Tengyu MaICLR 2024 · 259 citations

Related papers

  1. Understanding Transformer Reasoning Capabilities via Graph AlgorithmsClayton Sanford, Bahare Fatemi, Ethan Hall, Anton Tsitsulin et al.NeurIPS 2024 · 84 citations
  2. The Expressive Power of Transformers with Chain of ThoughtWilliam Merrill, Ashish SabharwalICLR 2024 · 243 citations
  3. Reasoning with Latent Thoughts: On the Power of Looped TransformersNikunj Saunshi, Nishanth Dikkala, Zhiyuan Li, Sanjiv Kumar et al.ICLR 2025
  4. Generalizing Reasoning Problems to Longer LengthsChangnan Xiao, Bing LiuICLR 2025
  5. Transformers Learn Shortcuts to AutomataBingbin Liu, Jordan T. Ash, Surbhi Goel, Akshay Krishnamurthy et al.ICLR 2023 · 11 citations
Dusk over the sea between two cliffs drawn in fine vertical lines