Non-Asymptotic Length Generalization
摘要
Length generalization is the ability of a learning algorithm to learn a hypothesis which generalizes to longer inputs than the inputs in the training set. In this paper, we provide provable guarantees of length generalization for various classes of functions in an idealized setting. First, we formalize the framework of non-asymptotic length generalization, which requires a computable upper bound for the minimum input length that guarantees length generalization, as a function of the complexity of ground-truth function under some given complexity measure. We refer to this minimum input length to length generalize as length complexity. We show the Minimum-Complexity Interpolator learning algorithm achieves optimal length complexity. We further show that whether a function class admits non-asymptotic length generalization is equivalent to the decidability of its language equivalence problem, which implies that there is no computable upper bound for the length complexity of Context-Free Grammars. On the positive side, we show that the length complexity of Deterministic Finite Automata is 2n -2 where n is the number of states of the ground-truth automaton. Our main results are upper bounds of length complexity for a subset of a transformer-related function class called C-RASP (Yang & Chiang, 2024) . We show that the length complexity of 1-layer C-RASP functions is O(T 2 ) when the ground-truth function has precision T , and that the length complexity of 2-layer C-RASP functions is O(T O(K) ) when the ground-truth function has precision T and K heads. recently shown to have a good prediction power on the length generalization performance of transformers (Zhou et al., 2023; Huang et al., 2024) . We study two subclasses of C-RASP, C-RASP 1 (Theorem 5.5) and C-RASP 2 (Theorem 5.6), which are of depth 1 and 2 respectively. Function Class Complexity of Ground-Truth Function Length of Training Data Sufficient to Generalize DFAs number of states, c 2c -2 (Proposition 3.10) CFGs description length, c no computable bound in c exists (Proposition 4.6) C-RASP 1 precision, T O(T 2 ) (Theorem 5.5) C-RASP 2 precision, T , and number of heads, K O(T O(K) ) (Theorem 5.6) Table 1: Summary of results: upper bounds on minimum length of binary strings in training data which suffices for length generalization. C-RASP is a class of functions which is a superset of functions expressible by finite-precision transformers. For L ∈ 1, 2, C-RASP L is a subclass of depth-L C-RASP functions. 2 Related Work Solomonoff (1964) proposed Bayesian-inference-based algorithms which when given a sequence of symbols, predict the next symbol according to the posterior distribution computed from the Solomonoff-Levin prior distribution. Gold (1967) introduced Identification-in-the-Limit as an asymptotic notion of learnability and proved that many classes of functions can be learned in this sense. Zhou et al. (2023) propose the RASP-L Conjecture, which says that whether a transformer length generalizes on a particular ground-truth function f * is well predicted by whether f * has a short RASP-L description. Huang et al. (2024) formulate the problem of length generalization-and the RASP-L Conjectureformally as a version of Identification-in-the-Limit and prove asymptotic results for identifying languages expressible by Limit Transformers. None of the works above provide non-asymptotic guarantees. We distinguish this work from previous work by providing non-asymptotic bounds on the length of the training data required in order to guarantee that the learner outputs a single hypothesis which exhibits perfect length generalization. Weiss et al. (2021) Zhou et al. (2023), Yang & Chiang (2024), and Shaw et al. (2024) study programming languages which capture the set of functions which transformers can express (like RASP). Regarding theoretical works for length generalization not related to transformers, Marsden et al. (2024) prove length generalization for learning linear dynamical systems with SGD. Abbe et al. (2024) prove out-of-domain generalization for boolean functions of a fixed input size. Non-Asymptotic Length Generalization Notation. For simplicity, we will fix the alphabet Σ = 0, 1 throughout the paper. We define computable (recursive) functions as functions which can be computed by a Turing Machine, which halts on all inputs. We say a function f : N → N is computably bounded (recursively bounded) if there exists a computable (recursive) function g : the binary string encoding of M . Let [N ] := 1, 2, 3, . . . , N -1, N . Denote 0, 1 n as the set of binary strings of length n, 0, 1 ≤n := n j=0 0, 1 j , and 0, 1 * := j≥0 0, 1 j . Note that ϵ, the empty string of length 0, is included in 0, 1 * . Denote 1[•] as the indicator function and cl(A) as the closure of set A ⊂ R d . Representation of Functions. We are interested in learning subsets of computable functions mapping 0, 1 * to 0, 1, denoted by F. Because a learning algorithm can
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 5 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- What Algorithms can Transformers Learn? A Study in Length Generalization 引用了 Thinking Like Transformers
- What Algorithms can Transformers Learn? A Study in Length Generalization 引用了 Language Models are Few-Shot Learners
- What Algorithms can Transformers Learn? A Study in Length Generalization 引用了 Exploring Length Generalization in Large Language Models
- What Algorithms can Transformers Learn? A Study in Length Generalization 引用了 Generalization on the Unseen, Logic Reasoning and Degree Curriculum
- Generalization on the Unseen, Logic Reasoning and Degree Curriculum 引用了 What Algorithms can Transformers Learn? A Study in Length Generalization
- Length Generalization Bounds for Transformers 引用了 What Algorithms can Transformers Learn? A Study in Length Generalization
- Length Generalization Bounds for Transformers 引用了 Thinking Like Transformers
- Length Generalization Bounds for Transformers 引用了 Quantitative Bounds for Length Generalization in Transformers
- Length Generalization Bounds for Transformers 引用了 Exploring Length Generalization in Large Language Models
- Softmax Transformers are Turing-Complete 引用了 Thinking Like Transformers
- Softmax Transformers are Turing-Complete 引用了 Quantitative Bounds for Length Generalization in Transformers
- Discovering Interpretable Algorithms by Decompiling Transformers to RASP 引用了 What Algorithms can Transformers Learn? A Study in Length Generalization
- Discovering Interpretable Algorithms by Decompiling Transformers to RASP 引用了 Softmax Transformers are Turing-Complete
- Discovering Interpretable Algorithms by Decompiling Transformers to RASP 引用了 Thinking Like Transformers
- Discovering Interpretable Algorithms by Decompiling Transformers to RASP 引用了 Quantitative Bounds for Length Generalization in Transformers
- Quantitative Bounds for Length Generalization in Transformers 引用了 What Algorithms can Transformers Learn? A Study in Length Generalization
- Quantitative Bounds for Length Generalization in Transformers 引用了 Thinking Like Transformers
- Quantitative Bounds for Length Generalization in Transformers 引用了 Exploring Length Generalization in Large Language Models
- On the Ability of Transformers to Verify Plans 引用了 Softmax Transformers are Turing-Complete
- On the Ability of Transformers to Verify Plans 引用了 Thinking Like Transformers
- On the Ability of Transformers to Verify Plans 引用了 Quantitative Bounds for Length Generalization in Transformers
- On the Ability of Transformers to Verify Plans 引用了 Exploring Length Generalization in Large Language Models
- On the Ability of Transformers to Verify Plans 引用了 Generalization on the Unseen, Logic Reasoning and Degree Curriculum
- Exploring Length Generalization in Large Language Models 引用了 Language Models are Few-Shot Learners
- Generalization on the Unseen, Logic Reasoning and Degree Curriculum 引用了 Thinking Like Transformers
- Generalization on the Unseen, Logic Reasoning and Degree Curriculum 引用了 Exploring Length Generalization in Large Language Models
引用它的顶会 Paper5
- Softmax Transformers are Turing-CompleteHongjian Jiang, Michael Hahn, Georg Zetzsche, Anthony W. LinICLR 2026 · 12 次引用
- Quantitative Bounds for Length Generalization in TransformersZachary Izzo, Eshaan Nichani, Jason D. LeeICLR 2026 · 8 次引用
- Discovering Interpretable Algorithms by Decompiling Transformers to RASPXinting Huang, Aleksandra Bakalova, Satwik Bhattamishra, William Merrill 等ICML 2026 · 3 次引用
- On the Ability of Transformers to Verify PlansYash Sarrof, Yupei Du, Katharina Stein, Alexander Koller 等ICML 2026 · 1 次引用
- Length Generalization Bounds for TransformersAndy Yang, Pascal Bergsträßer, Georg Zetzsche, David Chiang 等ICML 2026
它引用的 Paper10
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
- Exploring Length Generalization in Large Language ModelsCem Anil, Yuhuai Wu, Anders Andreassen, Aitor Lewkowycz 等NeurIPS 2022 · 267 次引用
- What Algorithms can Transformers Learn? A Study in Length GeneralizationHattie Zhou, Arwen Bradley, Etai Littwin, Noam Razin 等ICLR 2024 · 189 次引用
- Thinking Like TransformersGail Weiss, Yoav Goldberg, Eran YahavICML 2021 · 183 次引用
- Generalization on the Unseen, Logic Reasoning and Degree CurriculumEmmanuel Abbe, Samy Bengio, Aryo Lotfi, Kevin RizkICML 2023 · 68 次引用
相关 Paper
- Generalizing Reasoning Problems to Longer LengthsChangnan Xiao, Bing LiuICLR 2025
- Knee-Deep in C-RASP: A Transformer Depth HierarchyAndy Yang, Michaël Cadilhac, David ChiangNeurIPS 2025 · 15 次引用
- Looped Transformers for Length GeneralizationYing Fan, Yilun Du, Kannan Ramchandran, Kangwook LeeICLR 2025
- A Formal Framework for Understanding Length Generalization in TransformersXinting Huang, Andy Yang, Satwik Bhattamishra, Yash Raj Sarrof 等ICLR 2025
- Universal Length Generalization with Turing ProgramsKaiying Hou, David Brandfonbrener, Sham M. Kakade, Samy Jelassi 等ICML 2025
