mlsanityData to 7 Oct 2026

Length Extrapolation of Transformers: A Survey from the Perspective of Positional Encoding

arXiv 2312.17044 ↗First posted 28 Dec 2023cs.CLcited by 32

Not on the map. Why?

Abstract (arXiv)

Built upon the Transformer, large language models (LLMs) have captured worldwide attention due to their remarkable abilities. Nevertheless, all Transformer-based models including LLMs suffer from a preset length limit and can hardly generalize from short training sequences to longer inference ones, namely, they cannot perform length extrapolation to handle long sequences, which severely hinders their application in scenarios demanding long input sequences such as legal or scientific documents. Thus, numerous methods have emerged to enhance the length extrapolation of Transformers. Despite the great research efforts, a systematic survey is still lacking. To fill this gap, we delve into these advances in a unified notation from the perspective of positional encoding (PE), as it has been considered the primary factor on length extrapolation. Specifically, we begin with extrapolatable PEs that have dominated this research field. Then, we dive into extrapolation methods based on them, covering position interpolation and randomized position methods. Finally, several challenges and future directions in this area are highlighted. Through this survey, we aim to enable the reader to gain a deep understanding of existing methods and provide stimuli for future research.

Key facts. Cited by 32 papers in the map (data through 7 Oct 2026). Builds on 52 of its 94 references that are in the map. First posted on arXiv 28 Dec 2023.

Builds on

52 of 94 references.

References · 52

  1. 2017Attention Is All You Needcited by 59,932
  2. 2020Language Models are Few-Shot Learnerscited by 32,199
  3. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  4. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
  5. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  6. 2023Judging LLM-as-a-Judge with MT-Bench and Chatbot Arenacited by 8,393
  7. 2020Measuring Massive Multitask Language Understandingcited by 7,768
  8. 2016Layer Normalizationcited by 5,579
  9. 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,616
  10. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
  11. 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,611
  12. 2023Generative Agents: Interactive Simulacra of Human Behaviorcited by 3,500
38 more
  1. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
  2. 2018Neural Tangent Kernel: Convergence and Generalization in Neural Networkscited by 2,597
  3. 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,551
  4. 2023Code Llama: Open Foundation Models for Codecited by 2,105
  5. 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,830
  6. 2023Video-LLaVA: Learning United Visual Representation by Alignment Before Projectioncited by 1,385
  7. 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,378
  8. 2018Self-Attention with Relative Position Representationscited by 1,112
  9. 2019PEGASUS: Pre-training with Extracted Gap-sentences for Abstractive Summarizationcited by 1,100
  10. 2021Show Your Work: Scratchpads for Intermediate Computation with Language Modelscited by 871
  11. 2023RWKV: Reinventing RNNs for the Transformer Eracited by 814
  12. 2023Extending Context Window of Large Language Models via Positional Interpolationcited by 721
  13. 2019Are Transformers universal approximators of sequence-to-sequence functions?cited by 404
  14. 2023The Impact of Positional Encoding on Length Generalization in Transformerscited by 319
  15. 2023Effective Long-Context Scaling of Foundation Modelscited by 301
  16. 2023Reasoning or Reciting? Exploring the Capabilities and Limitations of Language Models Through Counterfactual Taskscited by 243
  17. 2023L-Eval: Instituting Standardized Evaluation for Long Context Language Modelscited by 232
  18. 2019Transformer Dissection: A Unified Understanding of Transformer's Attention via the Lens of Kernelcited by 211
  19. 2023What Algorithms can Transformers Learn? A Study in Length Generalizationcited by 198
  20. 2020Rethinking Positional Encoding in Language Pre-trainingcited by 197
  21. 2023ZeroSCROLLS: A Zero-Shot Benchmark for Long Text Understandingcited by 175
  22. 2022Transformer Language Models without Positional Encodings Still Learn Positional Informationcited by 148
  23. 2023Scaling Laws of RoPE-based Extrapolationcited by 124
  24. 2023PoSE: Efficient Context Window Extension of LLMs via Positional Skip-wise Trainingcited by 109
  25. 2021Position Information in Transformers: An Overviewcited by 103
  26. 2023Testing the General Deductive Reasoning Capacity of Large Language Models Using OOD Examplescited by 84
  27. 2020Improve Transformer Models with Better Relative Position Embeddingscited by 73
  28. 2021A Practical Survey on Faster and Lighter Transformerscited by 73
  29. 2023Generalization on the Unseen, Logic Reasoning and Degree Curriculumcited by 73
  30. 2020Learning to Encode Position for Transformer with Continuous Dynamical Modelcited by 61
  31. 2019Encoding word order in complex embeddingscited by 53
  32. 2021CAPE: Encoding Relative Positions with Continuous Augmented Positional Embeddingscited by 47
  33. 2022Dissecting Transformer Length Extrapolation via the Lens of Receptive Field Analysiscited by 39
  34. 2021SHAPE: Shifted Absolute Position Embedding for Transformerscited by 37
  35. 2019Location Attention for Extrapolation to Longer Sequencescited by 33
  36. 2023Giraffe: Adventures in Expanding Context Lengths in LLMscited by 32
  37. 2021The Case for Translation-Invariant Self-Attention in Transformer-Based Language Modelscited by 23
  38. 2023Latent Positional Information is in the Self-Attention Variance of Transformer Language Models Without Positional Embeddingscited by 23

50 most cited of 52 All 52 (JSON)

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 8; 2025: 12; 2026: 12.

32 papers.

Sort:

By area:

  1. 2025In Prospect and Retrospect: Reflective Memory Management for Long-term Personalized Dialogue Agentscited by 102
  2. 2024TokenSelect: Efficient Long-Context Inference and Length Extrapolation for LLMs via Dynamic Token-Level KV Cache Selectioncited by 38
  3. 2025Understanding and Improving Length Generalization in Recurrent Modelscited by 19
  4. 2025Positional Encoding in Transformer-Based Time Series Models: A Surveycited by 13
  5. 2025Enhancing Latent Computation in Transformers with Latent Tokenscited by 13
  6. 2024Investigating Length Issues in Document-level Machine Translationcited by 10
  7. 2024Stuffed Mamba: Oversized States Lead to the Inability to Forgetcited by 7
  8. 2025Multiscale Byte Language Models -- A Hierarchical Architecture for Causal Million-Length Sequence Modelingcited by 7
  9. 2025Stronger Enforcement of Instruction Hierarchy via Augmented Intermediate Representationscited by 7
  10. 2024Positional encoding is not the same as context: A study on positional encoding for sequential recommendationcited by 4
  11. 2025ReGLA: Refining Gated Linear Attentioncited by 4
  12. 2024MESA: Effective Matching Redundancy Reduction by Semantic Area Segmentationcited by 3
20 more
  1. 2025Weak-to-Strong GraphRAG: Aligning Weak Retrievers with Large Language Models for Graph-based Retrieval Augmented Generationcited by 3
  2. 2025ILRe: Intermediate Layer Retrieval for Context Compression in Causal Language Modelscited by 3
  3. 2026On the Spatiotemporal Dynamics of Generalization in Neural Networkscited by 3
  4. 2025Collaborative Representation Learning for Alignment of Tactile, Language, and Vision Modalitiescited by 2
  5. 2026REAL: A Reasoning-Enhanced Graph Framework for Long-Term Memory Management of LLMscited by 2
  6. 2026nD-RoPE: A Generalized RoPE for n-Dimensional Position Embeddingcited by 2
  7. 2024MLissard: Multilingual Long and Simple Sequential Reasoning Benchmarkscited by 1
  8. 2025LayerNorm Induces Recency Bias in Transformer Decoderscited by 1
  9. 2026Mixture-of-Top-k Attention: Efficient Attention via Scalable Fast Weightscited by 1
  10. 2026Attention's Gravitational Field:A Power-Law Interpretation of Positional Correlationcited by 1
  11. 2026Compressing History into Memory: Distilling Transformers into Recurrent Transformerscited by 1
  12. 2024GridPE: A Grid Cell-Inspired Unified Position Embedding for Arbitrary-Dimensional Spacescited by 0
  13. 2024Rethinking Associative Memory Mechanism in Induction Headcited by 0
  14. 2025Position as Probability: Self-Supervised Transformers that Think Past Their Training for Length Extrapolationcited by 0
  15. 2026Towards Infinite Length Extrapolation: A Unified Approachcited by 0
  16. 2026Circuit-Inspired High-Order Neural Networks with Unified Neural Dynamics Modeling for PDE Solving and Visual Perceptioncited by 0
  17. 2026On the Mirage of Long-Range Dependency, with an Application to Integer Multiplicationcited by 0
  18. 2026A Measure-Theoretic Analysis of Reasoning: Structural Generalization and Approximation Limitscited by 0
  19. 2026Out-of-Length Scene Text Recognition: A Two-Axis Diagnosis and a Training-Free Fixcited by 0
  20. 2026When Attention Goes Blind: Numerical Failure in ALiBi Positional Encodingscited by 0