mlsanityData to 7 Oct 2026

DAPE: Data-Adaptive Positional Encoding for Length Extrapolation

arXiv 2405.14722 ↗First posted 23 May 2024cs.CLcited by 30

Not on the map. Why?

Abstract (arXiv)

Positional encoding plays a crucial role in transformers, significantly impacting model performance and length generalization. Prior research has introduced absolute positional encoding (APE) and relative positional encoding (RPE) to distinguish token positions in given sequences. However, both APE and RPE remain fixed after model training regardless of input data, limiting their adaptability and flexibility. Hence, we expect that the desired positional encoding should be data-adaptive and can be dynamically adjusted with the given attention. In this paper, we propose a Data-Adaptive Positional Encoding (DAPE) method, which dynamically and semantically adjusts based on input context and learned fixed priors. Experimental validation on real-world datasets (Arxiv, Books3, and CHE) demonstrates that DAPE enhances model performances in terms of trained length and length generalization, where the improvements are statistically significant. The model visualization suggests that our model can keep both local and anti-local information. Finally, we successfully train the model on sequence length 128 and achieve better performance at evaluation sequence length 8192, compared with other static positional encoding methods, revealing the benefit of the adaptive positional encoding method.

Key facts. Cited by 30 papers in the map (data through 7 Oct 2026). Builds on 77 of its 89 references that are in the map. First posted on arXiv 23 May 2024.

Builds on

77 of 89 references.

References · 77

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2020Language Models are Few-Shot Learnerscited by 32,199
  4. 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
  5. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  6. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
  7. 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,304
  8. 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,616
  9. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
  10. 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,530
  11. 2020Longformer: The Long-Document Transformercited by 3,362
  12. 2023Efficient Streaming Language Models with Attention Sinkscited by 2,115
38 more
  1. 2022BLOOM: A 176B-Parameter Open-Access Multilingual Language Modelcited by 1,968
  2. 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,830
  3. 2018CommonsenseQA: A Question Answering Challenge Targeting Commonsense Knowledgecited by 1,793
  4. 2020Rethinking Attention with Performerscited by 1,584
  5. 2018Self-Attention with Relative Position Representationscited by 1,112
  6. 2019PEGASUS: Pre-training with Extracted Gap-sentences for Abstractive Summarizationcited by 1,100
  7. 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,085
  8. 2023RWKV: Reinventing RNNs for the Transformer Eracited by 814
  9. 2023Extending Context Window of Large Language Models via Positional Interpolationcited by 721
  10. 2023YaRN: Efficient Context Window Extension of Large Language Modelscited by 584
  11. 2024xLSTM: Extended Long Short-Term Memorycited by 320
  12. 2023The Impact of Positional Encoding on Length Generalization in Transformerscited by 319
  13. 2024LongRoPE: Extending LLM Context Window Beyond 2 Million Tokenscited by 302
  14. 2023Effective Long-Context Scaling of Foundation Modelscited by 301
  15. 2020Sparse Sinkhorn Attentioncited by 250
  16. 2021LongT5: Efficient Text-To-Text Transformer for Long Sequencescited by 232
  17. 2024Griffin: Mixing Gated Linear Recurrences with Local Attention for Efficient Language Modelscited by 232
  18. 2022Neural Networks and the Chomsky Hierarchycited by 214
  19. 2023What Algorithms can Transformers Learn? A Study in Length Generalizationcited by 198
  20. 2020Rethinking Positional Encoding in Language Pre-trainingcited by 197
  21. 2023Zoology: Measuring and Improving Recall in Efficient Language Modelscited by 188
  22. 2024Data Engineering for Scaling Language Models to 128K Contextcited by 183
  23. 2022Transformer Language Models without Positional Encodings Still Learn Positional Informationcited by 148
  24. 2024Infini-gram: Scaling Unbounded n-gram Language Models to a Trillion Tokenscited by 148
  25. 2023Progressive-Hint Prompting Improves Reasoning in Large Language Modelscited by 147
  26. 2023Focused Transformer: Contrastive Training for Context Scalingcited by 133
  27. 2024LLM Maybe LongLM: Self-Extend LLM Context Window Without Tuningcited by 133
  28. 2023Scaling Laws of RoPE-based Extrapolationcited by 124
  29. 2024Keyformer: KV Cache Reduction through Key Tokens Selection for Efficient Generative Inferencecited by 124
  30. 2022A Length-Extrapolatable Transformercited by 123
  31. 2023Randomized Positional Encodings Boost Length Generalization of Transformerscited by 114
  32. 2023PoSE: Efficient Context Window Extension of LLMs via Positional Skip-wise Trainingcited by 109
  33. 2022KERPLE: Kernelized Relative Positional Embedding for Length Extrapolationcited by 84
  34. 2023CoLT5: Faster Long-Range Transformers with Conditional Computationcited by 84
  35. 2024Long-Context Language Modeling with Parallel Context Encodingcited by 84
  36. 2024Transformers Can Achieve Length Generalization But Not Robustlycited by 82
  37. 2023In-context Pretraining: Language Modeling Beyond Document Boundariescited by 76
  38. 2024Found in the Middle: How Language Models Use Long Contexts Better via Plug-and-Play Positional Encodingcited by 72

50 most cited of 77 All 77 (JSON)

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 4; 2025: 18; 2026: 8.

30 papers.

Sort:

By area:

  1. 2024VisionZip: Longer is Better but Not Necessary in Vision Language Modelscited by 298
  2. 2025In Prospect and Retrospect: Reflective Memory Management for Long-term Personalized Dialogue Agentscited by 102
  3. 2024Why Does the Effective Context Length of LLMs Fall Short?cited by 60
  4. 2025PaTH Attention: Position Encoding via Accumulating Householder Transformationscited by 32
  5. 2025Extending the Context of Pretrained LLMs by Dropping Their Positional Embeddingscited by 23
  6. 2024HoPE: A Novel Positional Encoding Without Long-Term Decay for Enhanced Context Awareness and Extrapolationcited by 17
  7. 2025ParallelComp: Parallel Long-Context Compressor for Length Extrapolationcited by 13
  8. 2024DAPE V2: Process Attention Score as Feature Map for Length Extrapolationcited by 10
  9. 2025A Survey of Scaling in Large Language Model Reasoningcited by 10
  10. 2025RiemannFormer: A Framework for Attention in Curved Spacescited by 8
  11. 2025Kairos: Toward Adaptive and Parameter-Efficient Time Series Foundation Modelscited by 8
  12. 2025Hidden in the Haystack: Smaller Needles are More Difficult for LLMs to Findcited by 7
18 more
  1. 2025Group Representational Position Encodingcited by 5
  2. 2025Rethinking Addressing in Language Models via Contexualized Equivariant Positional Encodingcited by 4
  3. 2025Self-Adjust Softmaxcited by 3
  4. 2025LEDiT: Your Length-Extrapolatable Diffusion Transformer without Positional Encodingcited by 3
  5. 2025SAS: Simulated Attention Scorecited by 3
  6. 2025Context-aware Biases for Length Extrapolationcited by 2
  7. 2025RDDM: Practicing RAW Domain Diffusion Model for Real-world Image Restorationcited by 2
  8. 2025Beyond Real: Imaginary Extension of Rotary Position Embeddings for Long-Context LLMscited by 2
  9. 2026REAL: A Reasoning-Enhanced Graph Framework for Long-Term Memory Management of LLMscited by 2
  10. 2026Training Trajectories Determine Circuit Removability in Annealable Soft-Prior Transformerscited by 1
  11. 2025Position as Probability: Self-Supervised Transformers that Think Past Their Training for Length Extrapolationcited by 0
  12. 2025SCEESR: Semantic-Control Edge Enhancement for Diffusion-Based Super-Resolutioncited by 0
  13. 2026HopFormer: Sparse Graph Transformers with Explicit Receptive Field Controlcited by 0
  14. 2026Position Encoding with Random Float Sampling Enhances Length Generalization of Transformerscited by 0
  15. 2026DUET-VLM: Dual stage Unified Efficient Token reduction for VLM Training and Inferencecited by 0
  16. 2026A Measure-Theoretic Analysis of Reasoning: Structural Generalization and Approximation Limitscited by 0
  17. 2026Forget Attention: Importance-Aware Attention Is All You Needcited by 0
  18. 2026RoPE is Dead, Long Live RoPE: Towards Scalable Data-aware Positional Encodingscited by 0