Lune

ICML2026Top-tier venue

Length Generalization Bounds for Transformers

Andy Yang, Pascal Bergsträßer, Georg Zetzsche, David Chiang, Anthony Lin

Abstract

Length generalization is a key property of a learning algorithm that enables it to make correct predictions on inputs of any length, given finite training data. To provide such a guarantee, one needs to be able to compute a length generalization bound, beyond which the model is guaranteed to generalize. This paper concerns the open problem of the computability of such generalization bounds for C\mathsf{C}-RASP\mathsf{RASP}, a class of languages which is closely linked to transformers. A positive partial result was recently shown by Chen et al. for C\mathsf{C}-RASP\mathsf{RASP} with only one layer and, under some restrictions, also with two layers. We provide complete answers to the above open problem. Our main result is the non-existence of computable length generalization bounds for C\mathsf{C}-RASP\mathsf{RASP} (already with two layers) and hence for transformers. To complement this, we provide a computable bound for the positive fragment of C\mathsf{C}-RASP\mathsf{RASP}, which we show equivalent to fixed-precision transformers. For both positive C\mathsf{C}-RASP\mathsf{RASP} and fixed-precision transformers, we show that the length complexity is exponential, and prove optimality of the bounds.

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.

2 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

  • What Algorithms can Transformers Learn? A Study in Length Generalization cites Thinking Like Transformers
  • What Algorithms can Transformers Learn? A Study in Length Generalization cites Exploring Length Generalization in Large Language Models
  • The Counting Power of Transformers cites What Algorithms can Transformers Learn? A Study in Length Generalization
  • The Counting Power of Transformers cites A Logic for Expressing Log-Precision Transformers
  • The Counting Power of Transformers cites Transformers are Inherently Succinct
  • Transformers are Inherently Succinct cites The Counting Power of Transformers
  • The Counting Power of Transformers cites Exploring Length Generalization in Large Language Models
  • Transformers are Inherently Succinct cites What Algorithms can Transformers Learn? A Study in Length Generalization
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers2

  1. The Counting Power of TransformersMarco Sälzer, Chris Köcher, Alexander Kozachinskiy, Georg Zetzsche et al.ICLR 2026 · 7 citations
  2. Transformers are Inherently SuccinctPascal Bergsträßer, Ryan Cotterell, Anthony W. LinICLR 2026 · 5 citations

Builds on18

  1. An empirical analysis of compute-optimal large language model trainingJordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, Elena Buchatskaya et al.NeurIPS 2022 · 566 citations
  2. Exploring Length Generalization in Large Language ModelsCem Anil, Yuhuai Wu, Anders Andreassen, Aitor Lewkowycz et al.NeurIPS 2022 · 267 citations
  3. What Algorithms can Transformers Learn? A Study in Length GeneralizationHattie Zhou, Arwen Bradley, Etai Littwin, Noam Razin et al.ICLR 2024 · 189 citations
  4. Thinking Like TransformersGail Weiss, Yoav Goldberg, Eran YahavICML 2021 · 183 citations
  5. A Logic for Expressing Log-Precision TransformersWilliam Merrill, Ashish SabharwalNeurIPS 2023 · 87 citations

Related papers

  1. Non-Asymptotic Length GeneralizationThomas Chen, Tengyu Ma, Zhiyuan LiICML 2025
  2. On the Ability of Transformers to Verify PlansYash Sarrof, Yupei Du, Katharina Stein, Alexander Koller et al.ICML 2026 · 1 citation
  3. Knee-Deep in C-RASP: A Transformer Depth HierarchyAndy Yang, Michaël Cadilhac, David ChiangNeurIPS 2025 · 15 citations
  4. Looped Transformers for Length GeneralizationYing Fan, Yilun Du, Kannan Ramchandran, Kangwook LeeICLR 2025
  5. Softmax Transformers are Turing-CompleteHongjian Jiang, Michael Hahn, Georg Zetzsche, Anthony W. LinICLR 2026 · 12 citations
Dusk over the sea between two cliffs drawn in fine vertical lines