Length Generalization Bounds for Transformers
Not on the map. Why?
Abstract (arXiv)
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-RASP, a class of languages which is closely linked to transformers. A positive partial result was recently shown by Chen et al. for C-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-RASP (already with two layers) and hence for transformers. To complement this, we provide a computable bound for the positive fragment of C-RASP, which we show equivalent to fixed-precision transformers. For both positive C-RASP and fixed-precision transformers, we show that the length complexity is exponential, and prove optimality of the bounds.
Key facts. Cited by 4 papers in the map (data through 7 Oct 2026). Builds on 35 of its 46 references that are in the map. First posted on arXiv 13 Feb 2026.
Builds on
35 of 46 references.
References · 35
- 2020Scaling Laws for Neural Language Modelscited by 6,411
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
- 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,085
- 2021Show Your Work: Scratchpads for Intermediate Computation with Language Modelscited by 871
- 2023The Impact of Positional Encoding on Length Generalization in Transformerscited by 319
- 2024Chain of Thought Empowers Transformers to Solve Inherently Serial Problemscited by 256
- 2022Neural Networks and the Chomsky Hierarchycited by 214
- 2022Exploring Length Generalization in Large Language Modelscited by 204
- 2023What Algorithms can Transformers Learn? A Study in Length Generalizationcited by 198
- 2021Thinking Like Transformerscited by 182
- 2021Investigating the Limitations of Transformers with Simple Arithmetic Taskscited by 136
- 2023What Formal Languages Can Transformers Express? A Surveycited by 120
23 more
- 2024Transformers Can Achieve Length Generalization But Not Robustlycited by 82
- 2022A Logic for Expressing Log-Precision Transformerscited by 67
- 2023Tighter Bounds on the Expressivity of Transformer Encoderscited by 65
- 2023Length Generalization in Arithmetic Transformerscited by 64
- 2023Masked Hard-Attention Transformers Recognize Exactly the Star-Free Languagescited by 47
- 2020The EOS Decision and Length Extrapolationcited by 46
- 2024A Formal Framework for Understanding Length Generalization in Transformerscited by 44
- 2024Counting Like Transformers: Compiling Temporal Counting Logic Into Softmax Transformerscited by 39
- 2023Logical Languages Accepted by Transformer Encoders with Hard Attentioncited by 37
- 2025Learning Compositional Functions with Transformers from Easy-to-Hard Datacited by 34
- 2025Scaling Laws for Differentially Private Language Modelscited by 22
- 2025Exact Expressive Power of Transformers with Paddingcited by 19
- 2024Simulating Hard Attention Using Soft Attentioncited by 15
- 2025Learning In-context n-grams with Transformers: Sub-n-grams Are Near-stationary Pointscited by 15
- 2025Characterizing the Expressivity of Fixed-Precision Transformer Language Modelscited by 14
- 2025Knee-Deep in C-RASP: A Transformer Depth Hierarchycited by 12
- 2022Induced Natural Language Rationales and Interleaved Markup Tokens Enable Extrapolation in Large Language Modelscited by 10
- 2025Quantitative Bounds for Length Generalization in Transformerscited by 8
- 2025The Counting Power of Transformerscited by 7
- 2025Non-Asymptotic Length Generalizationcited by 7
- 2024Transformer Encoder Satisfiability: Complexity and Impact on Formal Reasoningcited by 5
- 2025The Transformer Cookbookcited by 5
- 2025Transformers are Inherently Succinctcited by 4
Built on by
Citing papers per year: 2026: 4.
4 papers.
- 2026Any-Dimensional Learning by Samplingcited by 1
- 2026Synthesis and Verification of Transformer Programs (Technical Report)cited by 0
- 2026Hierarchical Domain Generalizationcited by 0
- 2026Length Generalization for Transformers via Compressioncited by 0
- 2026Length Generalization for Transformers via Compression8 Sep 2026
- 2026Hierarchical Domain Generalization17 Jul 2026
- 2026Any-Dimensional Learning by Sampling8 Jul 2026
- 2026Synthesis and Verification of Transformer Programs (Technical Report)18 Feb 2026