mlsanityData to 7 Oct 2026

Distance generalization in transformers: why bother with positional encoding?

arXiv 2609.11913 ↗First posted 10 Sep 2026cs.CLcited by 0

Not on the map. Why?

Abstract (arXiv)

Out-of-distribution length generalization, namely to extrapolate a task from short to longer context, has been studied intensively for transformers. Here we focus on distance generalization, which probes performance when inter-token distances are changed between training and inference, while keeping a fixed context length. We construct two synthetic delay copy tasks, both involving finite distances between source and recall, where tokens are copied either fully or selectively, and test models on delays unseen during training. We address three questions: (A) Do positional encoding schemes such as RoPE and ALiBi improve distance resolution relative to no positional encoding (NoPE)? (B) How does data diversity, the number of inter-token distances seen in training, affect performance? (C) When is distance transfer learning positive or negative? We present a thorough investigation, finding that it is paramount to improve our understanding of the underlying mechanisms.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 23 of its 26 references that are in the map. First posted on arXiv 10 Sep 2026.

Builds on

23 of 26 references.

References · 23

  1. 2017Attention Is All You Needcited by 59,932
  2. 2014Adam: A Method for Stochastic Optimizationcited by 36,960
  3. 2024The Llama 3 Herd of Modelscited by 14,192
  4. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
  5. 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,085
  6. 2022In-context Learning and Induction Headscited by 930
  7. 2023Extending Context Window of Large Language Models via Positional Interpolationcited by 721
  8. 2022Grokking: Generalization Beyond Overfitting on Small Algorithmic Datasetscited by 599
  9. 2023YaRN: Efficient Context Window Extension of Large Language Modelscited by 584
  10. 2022Emergent World Representations: Exploring a Sequence Model Trained on a Synthetic Taskcited by 417
  11. 2023The Impact of Positional Encoding on Length Generalization in Transformerscited by 319
  12. 2022Exploring Length Generalization in Large Language Modelscited by 204
11 more
  1. 2023What Algorithms can Transformers Learn? A Study in Length Generalizationcited by 198
  2. 2024Looped Transformers for Length Generalizationcited by 91
  3. 2024Transformers Can Achieve Length Generalization But Not Robustlycited by 82
  4. 2024Out-of-distribution generalization via composition: a lens through induction heads in Transformerscited by 28
  5. 2024Arithmetic Transformers Can Length-Generalize in Both Operand Length and Countcited by 18
  6. 2025Extrapolation by Association: Length Generalization Transfer in Transformerscited by 13
  7. 2025Quantitative Bounds for Length Generalization in Transformerscited by 8
  8. 2024Understanding Addition and Subtraction in Transformerscited by 6
  9. 2025From Shortcut to Induction Head: How Data Diversity Shapes Algorithm Selection in Transformerscited by 6
  10. 2024Principled Understanding of Generalization for Generative Transformer Models in Arithmetic Reasoning Taskscited by 5
  11. 2025Small transformer architectures for task switchingcited by 1

Built on by

Not cited yet.