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 -, a class of languages which is closely linked to transformers. A positive partial result was recently shown by Chen et al. for - 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 - (already with two layers) and hence for transformers. To complement this, we provide a computable bound for the positive fragment of -, which we show equivalent to fixed-precision transformers. For both positive - and fixed-precision transformers, we show that the length complexity is exponential, and prove optimality of the bounds.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 058864e7-e1a6-409d-b07d-d58a4511f22eCited by top-tier papers2
- The Counting Power of TransformersMarco Sälzer, Chris Köcher, Alexander Kozachinskiy, Georg Zetzsche et al.ICLR 2026 · 7 citations
- Transformers are Inherently SuccinctPascal Bergsträßer, Ryan Cotterell, Anthony W. LinICLR 2026 · 5 citations
Builds on18
- An empirical analysis of compute-optimal large language model trainingJordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, Elena Buchatskaya et al.NeurIPS 2022 · 566 citations
- Exploring Length Generalization in Large Language ModelsCem Anil, Yuhuai Wu, Anders Andreassen, Aitor Lewkowycz et al.NeurIPS 2022 · 267 citations
- What Algorithms can Transformers Learn? A Study in Length GeneralizationHattie Zhou, Arwen Bradley, Etai Littwin, Noam Razin et al.ICLR 2024 · 189 citations
- Thinking Like TransformersGail Weiss, Yoav Goldberg, Eran YahavICML 2021 · 183 citations
- A Logic for Expressing Log-Precision TransformersWilliam Merrill, Ashish SabharwalNeurIPS 2023 · 87 citations
Related papers
- Non-Asymptotic Length GeneralizationThomas Chen, Tengyu Ma, Zhiyuan LiICML 2025
- On the Ability of Transformers to Verify PlansYash Sarrof, Yupei Du, Katharina Stein, Alexander Koller et al.ICML 2026 · 1 citation
- Looped Transformers for Length GeneralizationYing Fan, Yilun Du, Kannan Ramchandran, Kangwook LeeICLR 2025
- Knee-Deep in C-RASP: A Transformer Depth HierarchyAndy Yang, Michaël Cadilhac, David ChiangNeurIPS 2025 · 15 citations
- Quantitative Bounds for Length Generalization in TransformersZachary Izzo, Eshaan Nichani, Jason D. LeeICLR 2026 · 8 citations
