Length Generalization for Transformers via Compression
Not on the map. Why?
Abstract (arXiv)
Recent advancements in transformer length generalization theory enable us to reliably predict when a transformer can learn to solve a task. In particular, the C-RASP hypothesis (a formalized version of the so-called RASP-l conjecture) posits that transformers length-generalize on a task if and only if a solution is expressible in the C-RASP language. While this hypothesis has strong empirical validation, theoretical problems arise from the fact that no computable length generalization bounds exist for C-RASP, alongside the discovery of seemingly contradictory experiments. To address these problems, we refine the C-RASP hypothesis utilizing the recently-proposed fragments C-RASP+ and C-RASP1. These fragments have computable length generalization bounds, though in the worst case requiring an extremely large (double exponential) sample size. It is an open question whether these sample size bounds are tight. In this paper, we resolve this open question by providing an exponentially tighter bound. In doing so, we show a polynomial length generalization bound for transformers if we adopt compressed strings, via a novel connection to power words. As an application, we show how this yields a fine-grained analysis of the C-RASP conjecture that resolves contradicting experimental evidence against it.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 21 of its 40 references that are in the map. First posted on arXiv 8 Sep 2026.
Builds on
21 of 40 references.
References · 21
- 2017Attention Is All You Needcited by 60,361
- 2022Exploring Length Generalization in Large Language Modelscited by 206
- 2023What Algorithms can Transformers Learn? A Study in Length Generalizationcited by 199
- 2021Thinking Like Transformerscited by 184
- 2023What Formal Languages Can Transformers Express? A Surveycited by 124
- 2022Overcoming a Theoretical Limitation of Self-Attentioncited by 113
- 2024Transformers Can Achieve Length Generalization But Not Robustlycited by 86
- 2022A Logic for Expressing Log-Precision Transformerscited by 67
- 2024A Formal Framework for Understanding Length Generalization in Transformerscited by 45
- 2024Counting Like Transformers: Compiling Temporal Counting Logic Into Softmax Transformerscited by 39
- 2025Between Circuits and Chomsky: Pre-pretraining on Formal Languages Imparts Linguistic Biasescited by 37
- 2025Learning Compositional Functions with Transformers from Easy-to-Hard Datacited by 36
9 more
- 2024Transformers in Uniform TC0cited by 25
- 2024Training Neural Networks as Recognizers of Formal Languagescited by 24
- 2025Learning In-context n-grams with Transformers: Sub-n-grams Are Near-stationary Pointscited by 16
- 2025Characterizing the Expressivity of Fixed-Precision Transformer Language Modelscited by 14
- 2025Knee-Deep in C-RASP: A Transformer Depth Hierarchycited by 12
- 2025Non-Asymptotic Length Generalizationcited by 7
- 2025Born a Transformer -- Always a Transformer? On the Effect of Pretraining on Architectural Abilitiescited by 6
- 2026Discovering Interpretable Algorithms by Decompiling Transformers to RASPcited by 4
- 2026Length Generalization Bounds for Transformerscited by 4
Built on by
Not cited yet.