mlsanityData to 7 Oct 2026

Attention Alignment and Flexible Positional Embeddings Improve Transformer Length Extrapolation

arXiv 2311.00684 ↗First posted 1 Nov 2023cs.CL cs.LGcited by 9

Not on the map. Why?

Abstract (arXiv)

An ideal length-extrapolatable Transformer language model can handle sequences longer than the training length without any fine-tuning. Such long-context utilization capability relies heavily on a flexible positional embedding design. Upon investigating the flexibility of existing large pre-trained Transformer language models, we find that the T5 family deserves a closer look, as its positional embeddings capture rich and flexible attention patterns. However, T5 suffers from the dispersed attention issue: the longer the input sequence, the flatter the attention distribution. To alleviate the issue, we propose two attention alignment strategies via temperature scaling. Our findings show improvement on the long-context utilization capability of T5 on language modeling, retrieval, multi-document question answering, and code completion tasks without any fine-tuning. This suggests that a flexible positional embedding design and attention alignment can go a long way toward Transformer length extrapolation.

Key facts. Cited by 9 papers in the map (data through 7 Oct 2026). Builds on 27 of its 37 references that are in the map. First posted on arXiv 1 Nov 2023.

Builds on

27 of 37 references.

References · 27

  1. 2017Attention Is All You Needcited by 59,932
  2. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  3. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
  4. 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,160
  5. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
  6. 2021The Power of Scale for Parameter-Efficient Prompt Tuningcited by 3,769
  7. 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,611
  8. 2022OPT: Open Pre-trained Transformer Language Modelscited by 3,464
  9. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
  10. 2020REALM: Retrieval-Augmented Language Model Pre-Trainingcited by 2,126
  11. 2023Code Llama: Open Foundation Models for Codecited by 2,105
  12. 2022BLOOM: A 176B-Parameter Open-Access Multilingual Language Modelcited by 1,968
15 more
  1. 2023Pythia: A Suite for Analyzing Large Language Models Across Training and Scalingcited by 1,734
  2. 2021Improving language models by retrieving from trillions of tokenscited by 1,278
  3. 2020Leveraging Passage Retrieval with Generative Models for Open Domain Question Answeringcited by 1,203
  4. 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,085
  5. 2021GLM: General Language Model Pretraining with Autoregressive Blank Infillingcited by 1,026
  6. 2022GLM-130B: An Open Bilingual Pre-trained Modelcited by 837
  7. 2023The RefinedWeb Dataset for Falcon LLM: Outperforming Curated Corpora with Web Data, and Web Data Onlycited by 755
  8. 2023Extending Context Window of Large Language Models via Positional Interpolationcited by 721
  9. 2020IntelliCode Compose: Code Generation Using Transformercited by 225
  10. 2023Landmark Attention: Random-Access Infinite Context Length for Transformerscited by 206
  11. 2021Self-attention Does Not Need O(n2) Memorycited by 152
  12. 2023LongCoder: A Long-Range Pre-trained Language Model for Code Completioncited by 110
  13. 2021Self-Attention Networks Can Process Bounded Hierarchical Languagescited by 105
  14. 2022KERPLE: Kernelized Relative Positional Embedding for Length Extrapolationcited by 84
  15. 2022Dissecting Transformer Length Extrapolation via the Lens of Receptive Field Analysiscited by 39

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2023: 1; 2024: 3; 2025: 3; 2026: 2.

9 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2025Sliding Window Attention Training for Efficient Large Language Models
  2. 2024A Training-free Sub-quadratic Cost Transformer Model Serving Framework With Hierarchically Pruned Attention
  3. 2025A Survey on Transformer Context Extension: Approaches and Evaluation
  4. 2025Is Random Attention Sufficient for Sequence Modeling? Disentangling Trainable Components in the Transformer
  5. 2022Efficient Long Sequence Modeling via State Space Augmented Transformer
  6. 2025Long-Short Alignment for Effective Long-Context Modeling in LLMs
  7. 2026ZetaGPT: A Reference Implementation of Positional--Encoding--Free State--Space--Attention Language Models
  8. 2024AttnLRP: Attention-Aware Layer-Wise Relevance Propagation for Transformers