The EOS Decision and Length Extrapolation
Not on the map. Why?
Abstract (arXiv)
Extrapolation to unseen sequence lengths is a challenge for neural generative models of language. In this work, we characterize the effect on length extrapolation of a modeling decision often overlooked: predicting the end of the generative process through the use of a special end-of-sequence (EOS) vocabulary item. We study an oracle setting - forcing models to generate to the correct sequence length at test time - to compare the length-extrapolative behavior of networks trained to predict EOS (+EOS) with networks not trained to (-EOS). We find that -EOS substantially outperforms +EOS, for example extrapolating well to lengths 10 times longer than those seen at training time in a bracket closing task, as well as achieving a 40% improvement over +EOS in the difficult SCAN dataset length generalization task. By comparing the hidden states and dynamics of -EOS and +EOS models, we observe that +EOS models fail to generalize because they (1) unnecessarily stratify their hidden states by their linear position is a sequence (structures we call length manifolds) or (2) get stuck in clusters (which we refer to as length attractors) once the EOS token is the highest-probability prediction.
Key facts. Cited by 46 papers in the map (data through 14 Oct 2026). First posted on arXiv 14 Oct 2020.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 12; 2022: 9; 2023: 7; 2024: 7; 2025: 7; 2026: 4.
46 papers.
Sort:
By area:
- 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,103
- 2023Faith and Fate: Limits of Transformers on Compositionalitycited by 503
- 2022Transformers Learn Shortcuts to Automatacited by 268
- 2022Exploring Length Generalization in Large Language Modelscited by 206
- 2021Investigating the Limitations of Transformers with Simple Arithmetic Taskscited by 139
- 2021The Devil is in the Detail: Simple Tricks Improve Systematic Generalization of Transformerscited by 117
- 2022State-of-the-art generalisation research in NLP: A taxonomy and reviewcited by 98
- 2023Length Generalization in Arithmetic Transformerscited by 66
- 2021Unlocking Compositional Generalization in Pre-trained Models Using Intermediate Representationscited by 55
- 2022Evaluating the Impact of Model Scale for Compositional Generalization in Semantic Parsingcited by 50
- 2021Improving Compositional Generalization with Latent Structure and Data Augmentationcited by 46
- 2023ShapeGPT: 3D Shape Generation with A Unified Multi-modal Language Modelcited by 39
34 more
- 2021SHAPE: Shifted Absolute Position Embedding for Transformerscited by 37
- 2025Self-Improving Transformers Overcome Easy-to-Hard and Length Generalization Challengescited by 31
- 2022On Neural Architecture Inductive Biases for Relational Taskscited by 26
- 2023Interpretability Illusions in the Generalization of Simplified Modelscited by 25
- 2022Language model acceptability judgements are not always robust to contextcited by 22
- 2024Transformers Provably Learn Sparse Token Selection While Fully-Connected Nets Cannotcited by 22
- 2021ReaSCAN: Compositional Reasoning in Language Groundingcited by 19
- 2023Improving Length-Generalization in Transformers via Task Hintingcited by 13
- 2025Extrapolation by Association: Length Generalization Transfer in Transformerscited by 13
- 2021Compositional Attention: Disentangling Search and Retrievalcited by 12
- 2024Your Context Is Not an Array: Unveiling Random Access Limitations in Transformerscited by 11
- 2021Characterizing and addressing the issue of oversmoothing in neural autoregressive sequence modelingcited by 10
- 2022Benchmarking Long-tail Generalization with Likelihood Splitscited by 9
- 2023Monotonic Location Attention for Length Generalizationcited by 9
- 2024Large Language Models Synergize with Automated Machine Learningcited by 9
- 2025h1: Bootstrapping LLMs to Reason over Longer Horizons via Reinforcement Learningcited by 9
- 2021Compositional Generalization for Natural Language Interfaces to Web APIscited by 7
- 2021A Minimalist Dataset for Systematic Generalization of Perception, Syntax, and Semanticscited by 6
- 2021Iterative Decoding for Compositional Generalization in Transformerscited by 6
- 2022Compositional Generalisation with Structured Reordering and Fertility Layerscited by 6
- 2024Towards Understanding the Relationship between In-context Learning and Compositional Generalizationcited by 5
- 2025Overcoming Vocabulary Mismatch: Vocabulary-agnostic Teacher Guided Language Modelingcited by 4
- 2026Length Generalization Bounds for Transformerscited by 4
- 2022Recursive Decoding: A Situated Cognition Approach to Compositional Generation in Grounded Language Understandingcited by 3
- 2024Provable Length Generalization in Sequence Prediction via Spectral Filteringcited by 3
- 2025The Imitation Game: Turing Machine Imitator is Length Generalizable Reasonercited by 3
- 2023Evaluating Transformer's Ability to Learn Mildly Context-Sensitive Languagescited by 2
- 2024Symbolic Autoencoding for Self-Supervised Sequence Learningcited by 2
- 2025The Devil is in the EOS: Sequence Training for Detailed Image Captioningcited by 1
- 2026Retrievit: In-context Retrieval Capabilities of Transformers, State Space Models, and Hybrid Architecturescited by 1
- 2024Enhancing Length Extrapolation in Sequential Models with Pointer-Augmented Neural Memorycited by 0
- 2025Learning Model Successorscited by 0
- 2026Generalization in LLM Problem Solving: The Case of the Shortest Pathcited by 0
- 2026Beam Search, Self-Consistency, and the Limits of Inference-Time Scaling for Grammar-Constrained Text-to-SQL in Small Language Modelscited by 0
- 2026Beam Search, Self-Consistency, and the Limits of Inference-Time Scaling for Grammar-Constrained Text-to-SQL in Small Language Models26 Aug 2026
- 2026Generalization in LLM Problem Solving: The Case of the Shortest Path16 Apr 2026
- 2026Retrievit: In-context Retrieval Capabilities of Transformers, State Space Models, and Hybrid Architectures3 Mar 2026
- 2026Length Generalization Bounds for Transformers13 Feb 2026
- 2025h1: Bootstrapping LLMs to Reason over Longer Horizons via Reinforcement Learning8 Oct 2025
- 2025The Devil is in the EOS: Sequence Training for Detailed Image Captioning26 Jul 2025
- 2025The Imitation Game: Turing Machine Imitator is Length Generalizable Reasoner17 Jul 2025
- 2025Extrapolation by Association: Length Generalization Transfer in Transformers10 Jun 2025
- 2025Overcoming Vocabulary Mismatch: Vocabulary-agnostic Teacher Guided Language Modeling24 Mar 2025
- 2025Self-Improving Transformers Overcome Easy-to-Hard and Length Generalization Challenges3 Feb 2025
- 2025Learning Model Successors31 Jan 2025
- 2024Provable Length Generalization in Sequence Prediction via Spectral Filtering1 Nov 2024
34 more
- 2024Your Context Is Not an Array: Unveiling Random Access Limitations in Transformers10 Aug 2024
- 2024Transformers Provably Learn Sparse Token Selection While Fully-Connected Nets Cannot11 Jun 2024
- 2024Large Language Models Synergize with Automated Machine Learning6 May 2024
- 2024Enhancing Length Extrapolation in Sequential Models with Pointer-Augmented Neural Memory18 Apr 2024
- 2024Towards Understanding the Relationship between In-context Learning and Compositional Generalization18 Mar 2024
- 2024Symbolic Autoencoding for Self-Supervised Sequence Learning16 Feb 2024
- 2023Interpretability Illusions in the Generalization of Simplified Models6 Dec 2023
- 2023ShapeGPT: 3D Shape Generation with A Unified Multi-modal Language Model29 Nov 2023
- 2023Improving Length-Generalization in Transformers via Task Hinting1 Oct 2023
- 2023Evaluating Transformer's Ability to Learn Mildly Context-Sensitive Languages2 Sep 2023
- 2023Length Generalization in Arithmetic Transformers27 Jun 2023
- 2023Monotonic Location Attention for Length Generalization31 May 2023
- 2023Faith and Fate: Limits of Transformers on Compositionality29 May 2023
- 2022Language model acceptability judgements are not always robust to context18 Dec 2022
- 2022Transformers Learn Shortcuts to Automata19 Oct 2022
- 2022Benchmarking Long-tail Generalization with Likelihood Splits13 Oct 2022
- 2022Compositional Generalisation with Structured Reordering and Fertility Layers6 Oct 2022
- 2022State-of-the-art generalisation research in NLP: A taxonomy and review6 Oct 2022
- 2022Exploring Length Generalization in Large Language Models11 Jul 2022
- 2022On Neural Architecture Inductive Biases for Relational Tasks9 Jun 2022
- 2022Evaluating the Impact of Model Scale for Compositional Generalization in Semantic Parsing24 May 2022
- 2022Recursive Decoding: A Situated Cognition Approach to Compositional Generation in Grounded Language Understanding27 Jan 2022
- 2021Characterizing and addressing the issue of oversmoothing in neural autoregressive sequence modeling16 Dec 2021
- 2021Improving Compositional Generalization with Latent Structure and Data Augmentation14 Dec 2021
- 2021Compositional Generalization for Natural Language Interfaces to Web APIs9 Dec 2021
- 2021Compositional Attention: Disentangling Search and Retrieval18 Oct 2021
- 2021Iterative Decoding for Compositional Generalization in Transformers8 Oct 2021
- 2021ReaSCAN: Compositional Reasoning in Language Grounding18 Sep 2021
- 2021SHAPE: Shifted Absolute Position Embedding for Transformers13 Sep 2021
- 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation27 Aug 2021
- 2021The Devil is in the Detail: Simple Tricks Improve Systematic Generalization of Transformers26 Aug 2021
- 2021Unlocking Compositional Generalization in Pre-trained Models Using Intermediate Representations15 Apr 2021
- 2021A Minimalist Dataset for Systematic Generalization of Perception, Syntax, and Semantics2 Mar 2021
- 2021Investigating the Limitations of Transformers with Simple Arithmetic Tasks25 Feb 2021
- 2025h1: Bootstrapping LLMs to Reason over Longer Horizons via Reinforcement Learningcited by 9
- 2025The Imitation Game: Turing Machine Imitator is Length Generalizable Reasonercited by 3
- 2026Beam Search, Self-Consistency, and the Limits of Inference-Time Scaling for Grammar-Constrained Text-to-SQL in Small Language Modelscited by 0
- 2026Beam Search, Self-Consistency, and the Limits of Inference-Time Scaling for Grammar-Constrained Text-to-SQL in Small Language Models26 Aug 2026
- 2025h1: Bootstrapping LLMs to Reason over Longer Horizons via Reinforcement Learning8 Oct 2025
- 2025The Imitation Game: Turing Machine Imitator is Length Generalizable Reasoner17 Jul 2025
- 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,103
- 2023Faith and Fate: Limits of Transformers on Compositionalitycited by 503
- 2022Transformers Learn Shortcuts to Automatacited by 268
- 2022Exploring Length Generalization in Large Language Modelscited by 206
- 2021Investigating the Limitations of Transformers with Simple Arithmetic Taskscited by 139
- 2021The Devil is in the Detail: Simple Tricks Improve Systematic Generalization of Transformerscited by 117
- 2022State-of-the-art generalisation research in NLP: A taxonomy and reviewcited by 98
- 2023Length Generalization in Arithmetic Transformerscited by 66
- 2021Unlocking Compositional Generalization in Pre-trained Models Using Intermediate Representationscited by 55
- 2022Evaluating the Impact of Model Scale for Compositional Generalization in Semantic Parsingcited by 50
- 2021Improving Compositional Generalization with Latent Structure and Data Augmentationcited by 46
- 2021SHAPE: Shifted Absolute Position Embedding for Transformerscited by 37
12 most cited of 40 All 40 (JSON)
- 2026Generalization in LLM Problem Solving: The Case of the Shortest Path16 Apr 2026
- 2026Retrievit: In-context Retrieval Capabilities of Transformers, State Space Models, and Hybrid Architectures3 Mar 2026
- 2026Length Generalization Bounds for Transformers13 Feb 2026
- 2025Extrapolation by Association: Length Generalization Transfer in Transformers10 Jun 2025
- 2025Overcoming Vocabulary Mismatch: Vocabulary-agnostic Teacher Guided Language Modeling24 Mar 2025
- 2025Learning Model Successors31 Jan 2025
- 2024Provable Length Generalization in Sequence Prediction via Spectral Filtering1 Nov 2024
- 2024Your Context Is Not an Array: Unveiling Random Access Limitations in Transformers10 Aug 2024
- 2024Transformers Provably Learn Sparse Token Selection While Fully-Connected Nets Cannot11 Jun 2024
- 2024Large Language Models Synergize with Automated Machine Learning6 May 2024
- 2024Enhancing Length Extrapolation in Sequential Models with Pointer-Augmented Neural Memory18 Apr 2024
- 2024Towards Understanding the Relationship between In-context Learning and Compositional Generalization18 Mar 2024
12 newest of 40 All 40 (JSON)