Universal Length Generalization with Turing Programs
Not on the map. Why?
Abstract (arXiv)
Length generalization refers to the ability to extrapolate from short training sequences to long test sequences and is a challenge for current large language models. While prior work has proposed some architecture or data format changes to achieve length generalization, these proposals typically apply to a limited set of tasks. Building on prior scratchpad and Chain-of-Thought (CoT) techniques, we propose Turing Programs, a novel CoT strategy that decomposes an algorithmic task into steps mimicking the computation of a Turing Machine. This framework is both universal, as it can accommodate any algorithmic task, and simple, requiring only copying text from the context with small modifications. We show that by using Turing Programs, we obtain robust length generalization on a range of algorithmic tasks: addition, multiplication and in-context SGD. We then demonstrate that transformers achieve length generalization on random Turing Programs, suggesting that length generalization is possible for any algorithmic task. Finally, we theoretically prove that transformers can implement Turing Programs, constructing a simple RASP (Weiss et al.) program that simulates an arbitrary Turing machine.
Key facts. Cited by 25 papers in the map (data through 14 Oct 2026). Builds on 48 of its 59 references that are in the map. First posted on arXiv 3 Jul 2024.
Builds on
48 of 59 references.
References · 48
- 2017Attention Is All You Needcited by 60,361
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
- 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,850
- 2022Solving Quantitative Reasoning Problems with Language Modelscited by 1,392
- 2018Self-Attention with Relative Position Representationscited by 1,120
36 more
- 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,103
- 2022In-context Learning and Induction Headscited by 964
- 2021Show Your Work: Scratchpads for Intermediate Computation with Language Modelscited by 886
- 2022GPT-NeoX-20B: An Open-Source Autoregressive Language Modelcited by 713
- 2014Neural Turing Machinescited by 644
- 2023Textbooks Are All You Needcited by 569
- 2023Faith and Fate: Limits of Transformers on Compositionalitycited by 503
- 2023The Impact of Positional Encoding on Length Generalization in Transformerscited by 327
- 2022Transformers Learn Shortcuts to Automatacited by 268
- 2019Compositionality decomposed: how do neural networks generalise?cited by 265
- 2023Looped Transformers as Programmable Computerscited by 237
- 2022Neural Networks and the Chomsky Hierarchycited by 217
- 2024Repeat After Me: Transformers are Better than State Space Models at Copyingcited by 216
- 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
- 2022Transformer Language Models without Positional Encodings Still Learn Positional Informationcited by 150
- 2019On the Turing Completeness of Modern Neural Network Architecturescited by 129
- 2023Teaching Arithmetic to Small Transformerscited by 123
- 2015Neural GPUs Learn Algorithmscited by 121
- 2021Can You Learn an Algorithm? Generalizing from Easy to Hard Problems with Recurrent Networkscited by 117
- 2023Randomized Positional Encodings Boost Length Generalization of Transformerscited by 117
- 2022Unveiling Transformers with LEGO: a synthetic reasoning taskcited by 106
- 2023Tracr: Compiled Transformers as a Laboratory for Interpretabilitycited by 104
- 2021Statistically Meaningful Approximation: a Case Study on Approximating Turing Machines with Transformerscited by 102
- 2022KERPLE: Kernelized Relative Positional Embedding for Length Extrapolationcited by 86
- 2024Transformers Can Achieve Length Generalization But Not Robustlycited by 86
- 2020On the Computational Power of Transformers and its Implications in Sequence Modelingcited by 85
- 2023Generalization on the Unseen, Logic Reasoning and Degree Curriculumcited by 73
- 2023Auto-Regressive Next-Token Predictors are Universal Learnerscited by 67
- 2023Length Generalization in Arithmetic Transformerscited by 66
- 2023Positional Description Matters for Transformers Arithmeticcited by 56
- 2017Recurrent Neural Networks as Weighted Language Recognizerscited by 30
- 2023Learning to Reason and Memorize with Self-Notescited by 30
- 2024Case-Based or Rule-Based: How Do Transformers Do the Math?cited by 26
- 2023GPT is becoming a Turing machine: Here are some ways to program itcited by 16
Built on by
Citing papers per year: 2024: 4; 2025: 14; 2026: 7.
25 papers.
Sort:
By area:
- 2025Lower Bounds for Chain-of-Thought Reasoning in Hard-Attention Transformerscited by 28
- 2024Mixture of Parrots: Experts improve memorization more than reasoningcited by 21
- 2025Transformers Provably Learn Chain-of-Thought Reasoning with Length Generalizationcited by 14
- 2024Ask, and it shall be given: On the Turing completeness of promptingcited by 10
- 2025Softmax Transformers are Turing-Completecited by 9
- 2025The Role of Sparsity for Length Generalization in Transformerscited by 8
- 2025Beyond Single-Task: Robust Multi-Task Length Generalization for LLMscited by 7
- 2025Born a Transformer -- Always a Transformer? On the Effect of Pretraining on Architectural Abilitiescited by 6
- 2025Beyond Statistical Learning: Exact Learning Is Essential for General Intelligencecited by 6
- 2025Self-Verifying Reflection Helps Transformers with CoT Reasoningcited by 4
- 2025To Infinity and Beyond: Tool-Use Unlocks Length Generalization in State Space Modelscited by 4
- 2024Provable Length Generalization in Sequence Prediction via Spectral Filteringcited by 3
13 more
- 2025The Imitation Game: Turing Machine Imitator is Length Generalizable Reasonercited by 3
- 2025Probability Distributions Computed by Autoregressive Transformerscited by 2
- 2026On the Ability of Transformers to Verify Planscited by 2
- 2024Representing Rule-based Chatbots with Transformerscited by 1
- 2025Exact Learning of Arithmetic with Differentiable Agentscited by 1
- 2026Universal computation is intrinsic to language model decodingcited by 1
- 2026Barriers to Universal Reasoning With Transformers (And How to Overcome Them)cited by 1
- 2025Learning Model Successorscited by 0
- 2025Position as Probability: Self-Supervised Transformers that Think Past Their Training for Length Extrapolationcited by 0
- 2026Loom: A Scalable Analytical Neural Computer Architecturecited by 0
- 2026Position: The Turing-Completeness of Autoregressive Transformers Relies Heavily on Context Managementcited by 0
- 2026Planning with Transformers: Chain of Computation and Structured Context Windowscited by 0
- 2026Universal Transformers for Circuit Computations: Perfect Length Generalization in Tiny Transformerscited by 0
- 2026Universal Transformers for Circuit Computations: Perfect Length Generalization in Tiny Transformers31 Aug 2026
- 2026Planning with Transformers: Chain of Computation and Structured Context Windows20 Jul 2026
- 2026Position: The Turing-Completeness of Autoregressive Transformers Relies Heavily on Context Management19 May 2026
- 2026Barriers to Universal Reasoning With Transformers (And How to Overcome Them)28 Apr 2026
- 2026Loom: A Scalable Analytical Neural Computer Architecture9 Apr 2026
- 2026On the Ability of Transformers to Verify Plans20 Mar 2026
- 2026Universal computation is intrinsic to language model decoding12 Jan 2026
- 2025Exact Learning of Arithmetic with Differentiable Agents27 Nov 2025
- 2025Softmax Transformers are Turing-Complete25 Nov 2025
- 2025Transformers Provably Learn Chain-of-Thought Reasoning with Length Generalization10 Nov 2025
- 2025Probability Distributions Computed by Autoregressive Transformers31 Oct 2025
- 2025To Infinity and Beyond: Tool-Use Unlocks Length Generalization in State Space Models16 Oct 2025
13 more
- 2025Self-Verifying Reflection Helps Transformers with CoT Reasoning14 Oct 2025
- 2025The Imitation Game: Turing Machine Imitator is Length Generalizable Reasoner17 Jul 2025
- 2025Beyond Statistical Learning: Exact Learning Is Essential for General Intelligence30 Jun 2025
- 2025Position as Probability: Self-Supervised Transformers that Think Past Their Training for Length Extrapolation1 Jun 2025
- 2025Born a Transformer -- Always a Transformer? On the Effect of Pretraining on Architectural Abilities27 May 2025
- 2025The Role of Sparsity for Length Generalization in Transformers24 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
- 2025Learning Model Successors31 Jan 2025
- 2024Ask, and it shall be given: On the Turing completeness of prompting4 Nov 2024
- 2024Provable Length Generalization in Sequence Prediction via Spectral Filtering1 Nov 2024
- 2024Mixture of Parrots: Experts improve memorization more than reasoning24 Oct 2024
- 2024Representing Rule-based Chatbots with Transformers15 Jul 2024
- 2025Lower Bounds for Chain-of-Thought Reasoning in Hard-Attention Transformerscited by 28
- 2025Transformers Provably Learn Chain-of-Thought Reasoning with Length Generalizationcited by 14
- 2025Softmax Transformers are Turing-Completecited by 9
- 2025Beyond Statistical Learning: Exact Learning Is Essential for General Intelligencecited by 6
- 2025Self-Verifying Reflection Helps Transformers with CoT Reasoningcited by 4
- 2025The Imitation Game: Turing Machine Imitator is Length Generalizable Reasonercited by 3
- 2026Barriers to Universal Reasoning With Transformers (And How to Overcome Them)cited by 1
- 2026Barriers to Universal Reasoning With Transformers (And How to Overcome Them)28 Apr 2026
- 2025Softmax Transformers are Turing-Complete25 Nov 2025
- 2025Transformers Provably Learn Chain-of-Thought Reasoning with Length Generalization10 Nov 2025
- 2025Self-Verifying Reflection Helps Transformers with CoT Reasoning14 Oct 2025
- 2025The Imitation Game: Turing Machine Imitator is Length Generalizable Reasoner17 Jul 2025
- 2025Beyond Statistical Learning: Exact Learning Is Essential for General Intelligence30 Jun 2025
- 2025Lower Bounds for Chain-of-Thought Reasoning in Hard-Attention Transformers4 Feb 2025
- 2024Ask, and it shall be given: On the Turing completeness of promptingcited by 10
- 2025The Role of Sparsity for Length Generalization in Transformerscited by 8
- 2025Beyond Single-Task: Robust Multi-Task Length Generalization for LLMscited by 7
- 2025Born a Transformer -- Always a Transformer? On the Effect of Pretraining on Architectural Abilitiescited by 6
- 2025To Infinity and Beyond: Tool-Use Unlocks Length Generalization in State Space Modelscited by 4
- 2024Provable Length Generalization in Sequence Prediction via Spectral Filteringcited by 3
- 2025Probability Distributions Computed by Autoregressive Transformerscited by 2
- 2026On the Ability of Transformers to Verify Planscited by 2
- 2024Representing Rule-based Chatbots with Transformerscited by 1
- 2025Exact Learning of Arithmetic with Differentiable Agentscited by 1
- 2026Universal computation is intrinsic to language model decodingcited by 1
- 2025Learning Model Successorscited by 0
12 most cited of 17 All 17 (JSON)
- 2026Universal Transformers for Circuit Computations: Perfect Length Generalization in Tiny Transformers31 Aug 2026
- 2026Planning with Transformers: Chain of Computation and Structured Context Windows20 Jul 2026
- 2026Position: The Turing-Completeness of Autoregressive Transformers Relies Heavily on Context Management19 May 2026
- 2026Loom: A Scalable Analytical Neural Computer Architecture9 Apr 2026
- 2026On the Ability of Transformers to Verify Plans20 Mar 2026
- 2026Universal computation is intrinsic to language model decoding12 Jan 2026
- 2025Exact Learning of Arithmetic with Differentiable Agents27 Nov 2025
- 2025Probability Distributions Computed by Autoregressive Transformers31 Oct 2025
- 2025To Infinity and Beyond: Tool-Use Unlocks Length Generalization in State Space Models16 Oct 2025
- 2025Position as Probability: Self-Supervised Transformers that Think Past Their Training for Length Extrapolation1 Jun 2025
- 2025Born a Transformer -- Always a Transformer? On the Effect of Pretraining on Architectural Abilities27 May 2025
- 2025The Role of Sparsity for Length Generalization in Transformers24 Feb 2025
12 newest of 17 All 17 (JSON)
Similar, not cited
Close in wording, no citation either way
- 2024On Provable Length and Compositional Generalization
- 2026Position Encoding with Random Float Sampling Enhances Length Generalization of Transformers
- 2024Explicitly Encoding Structural Symmetry is Key to Length Generalization in Arithmetic Tasks
- 2024Language Models Need Inductive Biases to Count Inductively
- 2026Where Induction Runs Out: Description-Length Difficulty and the Memorisation Gap in Integer-Sequence Benchmarks
- 2024Principled Understanding of Generalization for Generative Transformer Models in Arithmetic Reasoning Tasks
- 2026The Expressive Power of Low Precision Softmax Transformers with (Summarized) Chain-of-Thought
- 2026Algorithmic Scratchpads and Curriculum Staging for Arithmetic Reasoning in Tiny Transformers