Arithmetic Transformers Can Length-Generalize in Both Operand Length and Count
Not on the map. Why?
Abstract (arXiv)
Transformers often struggle with length generalization, meaning they fail to generalize to sequences longer than those encountered during training. While arithmetic tasks are commonly used to study length generalization, certain tasks are considered notoriously difficult, e.g., multi-operand addition (requiring generalization over both the number of operands and their lengths) and multiplication (requiring generalization over both operand lengths). In this work, we achieve approximately 2-3x length generalization on both tasks, which is the first such achievement in arithmetic Transformers. We design task-specific scratchpads enabling the model to focus on a fixed number of tokens per each next-token prediction step, and apply multi-level versions of Position Coupling (Cho et al., 2024; McLeish et al., 2024) to let Transformers know the right position to attend to. On the theory side, we prove that a 1-layer Transformer using our method can solve multi-operand addition, up to operand length and operand count that are exponential in embedding dimension.
Key facts. Cited by 18 papers in the map (data through 7 Oct 2026). First posted on arXiv 21 Oct 2024.
Builds on
0 of 0 references.
No references here yet.
Built on by
Citing papers per year: 2025: 8; 2026: 10.
18 papers.
Sort:
By area:
- 2025Lower Bounds for Chain-of-Thought Reasoning in Hard-Attention Transformerscited by 28
- 2025The Role of Sparsity for Length Generalization in Transformerscited by 8
- 2025Quantitative Bounds for Length Generalization in Transformerscited by 8
- 2025Beyond Single-Task: Robust Multi-Task Length Generalization for LLMscited by 7
- 2025Circuit Stability Characterizes Language Model Generalizationcited by 6
- 2025Learning to Add, Multiply, and Execute Algorithmic Instructions Exactly with Neural Networkscited by 4
- 2025Language Models, Graph Searching, and Supervision Adulteration: When More Supervision is Less and How to Make More Morecited by 3
- 2026On the Spatiotemporal Dynamics of Generalization in Neural Networkscited by 3
- 2025Exact Learning of Arithmetic with Differentiable Agentscited by 1
- 2026Length Generalization with Log-Depth Recurrent Unitscited by 1
- 2026Breaking the Data Barrier in Learning Symbolic Computation: A Case Study on Variable Ordering Suggestion for Cylindrical Algebraic Decompositioncited by 0
- 2026Arithmetic OOD Failure Unfolds in Stages in Minimal GPTscited by 0
6 more
- 2026On the Mirage of Long-Range Dependency, with an Application to Integer Multiplicationcited by 0
- 2026Globally Optimal Training of Spiking Neural Networks via Parameter Reconstructioncited by 0
- 2026How Should Transformers Encode Numeric Values in Electronic Health Records?cited by 0
- 2026Universal Transformers for Circuit Computations: Perfect Length Generalization in Tiny Transformerscited by 0
- 2026Distance generalization in transformers: why bother with positional encoding?cited by 0
- 2026The Geometry of Logic: Stratification Induces Semantic Structure and Robust Reasoningcited by 0
- 2026The Geometry of Logic: Stratification Induces Semantic Structure and Robust Reasoning26 Sep 2026
- 2026Distance generalization in transformers: why bother with positional encoding?10 Sep 2026
- 2026Universal Transformers for Circuit Computations: Perfect Length Generalization in Tiny Transformers31 Aug 2026
- 2026How Should Transformers Encode Numeric Values in Electronic Health Records?1 Jul 2026
- 2026Length Generalization with Log-Depth Recurrent Units25 May 2026
- 2026Globally Optimal Training of Spiking Neural Networks via Parameter Reconstruction8 May 2026
- 2026On the Mirage of Long-Range Dependency, with an Application to Integer Multiplication30 Mar 2026
- 2026Arithmetic OOD Failure Unfolds in Stages in Minimal GPTs27 Mar 2026
- 2026On the Spatiotemporal Dynamics of Generalization in Neural Networks2 Feb 2026
- 2026Breaking the Data Barrier in Learning Symbolic Computation: A Case Study on Variable Ordering Suggestion for Cylindrical Algebraic Decomposition20 Jan 2026
- 2025Exact Learning of Arithmetic with Differentiable Agents27 Nov 2025
- 2025Quantitative Bounds for Length Generalization in Transformers30 Oct 2025
6 more
- 2025Circuit Stability Characterizes Language Model Generalization30 May 2025
- 2025Language Models, Graph Searching, and Supervision Adulteration: When More Supervision is Less and How to Make More More13 Mar 2025
- 2025The Role of Sparsity for Length Generalization in Transformers24 Feb 2025
- 2025Learning to Add, Multiply, and Execute Algorithmic Instructions Exactly with Neural Networks24 Feb 2025
- 2025Beyond Single-Task: Robust Multi-Task Length Generalization for LLMs17 Feb 2025
- 2025Lower Bounds for Chain-of-Thought Reasoning in Hard-Attention Transformers4 Feb 2025
- 2025Lower Bounds for Chain-of-Thought Reasoning in Hard-Attention Transformerscited by 28
- 2026Breaking the Data Barrier in Learning Symbolic Computation: A Case Study on Variable Ordering Suggestion for Cylindrical Algebraic Decompositioncited by 0
- 2026The Geometry of Logic: Stratification Induces Semantic Structure and Robust Reasoningcited by 0
- 2026The Geometry of Logic: Stratification Induces Semantic Structure and Robust Reasoning26 Sep 2026
- 2026Breaking the Data Barrier in Learning Symbolic Computation: A Case Study on Variable Ordering Suggestion for Cylindrical Algebraic Decomposition20 Jan 2026
- 2025Lower Bounds for Chain-of-Thought Reasoning in Hard-Attention Transformers4 Feb 2025
- 2025The Role of Sparsity for Length Generalization in Transformerscited by 8
- 2025Quantitative Bounds for Length Generalization in Transformerscited by 8
- 2025Beyond Single-Task: Robust Multi-Task Length Generalization for LLMscited by 7
- 2025Circuit Stability Characterizes Language Model Generalizationcited by 6
- 2025Learning to Add, Multiply, and Execute Algorithmic Instructions Exactly with Neural Networkscited by 4
- 2025Language Models, Graph Searching, and Supervision Adulteration: When More Supervision is Less and How to Make More Morecited by 3
- 2026On the Spatiotemporal Dynamics of Generalization in Neural Networkscited by 3
- 2025Exact Learning of Arithmetic with Differentiable Agentscited by 1
- 2026Length Generalization with Log-Depth Recurrent Unitscited by 1
- 2026Arithmetic OOD Failure Unfolds in Stages in Minimal GPTscited by 0
- 2026On the Mirage of Long-Range Dependency, with an Application to Integer Multiplicationcited by 0
- 2026Globally Optimal Training of Spiking Neural Networks via Parameter Reconstructioncited by 0
12 most cited of 15 All 15 (JSON)
- 2026Distance generalization in transformers: why bother with positional encoding?10 Sep 2026
- 2026Universal Transformers for Circuit Computations: Perfect Length Generalization in Tiny Transformers31 Aug 2026
- 2026How Should Transformers Encode Numeric Values in Electronic Health Records?1 Jul 2026
- 2026Length Generalization with Log-Depth Recurrent Units25 May 2026
- 2026Globally Optimal Training of Spiking Neural Networks via Parameter Reconstruction8 May 2026
- 2026On the Mirage of Long-Range Dependency, with an Application to Integer Multiplication30 Mar 2026
- 2026Arithmetic OOD Failure Unfolds in Stages in Minimal GPTs27 Mar 2026
- 2026On the Spatiotemporal Dynamics of Generalization in Neural Networks2 Feb 2026
- 2025Exact Learning of Arithmetic with Differentiable Agents27 Nov 2025
- 2025Quantitative Bounds for Length Generalization in Transformers30 Oct 2025
- 2025Circuit Stability Characterizes Language Model Generalization30 May 2025
- 2025Language Models, Graph Searching, and Supervision Adulteration: When More Supervision is Less and How to Make More More13 Mar 2025
12 newest of 15 All 15 (JSON)