DAPE: Data-Adaptive Positional Encoding for Length Extrapolation
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
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,304
- 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,616
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
- 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,530
- 2020Longformer: The Long-Document Transformercited by 3,362
- 2023Efficient Streaming Language Models with Attention Sinkscited by 2,115
38 more
- 2022BLOOM: A 176B-Parameter Open-Access Multilingual Language Modelcited by 1,968
- 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,830
- 2018CommonsenseQA: A Question Answering Challenge Targeting Commonsense Knowledgecited by 1,793
- 2020Rethinking Attention with Performerscited by 1,584
- 2018Self-Attention with Relative Position Representationscited by 1,112
- 2019PEGASUS: Pre-training with Extracted Gap-sentences for Abstractive Summarizationcited by 1,100
- 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,085
- 2023RWKV: Reinventing RNNs for the Transformer Eracited by 814
- 2023Extending Context Window of Large Language Models via Positional Interpolationcited by 721
- 2023YaRN: Efficient Context Window Extension of Large Language Modelscited by 584
- 2024xLSTM: Extended Long Short-Term Memorycited by 320
- 2023The Impact of Positional Encoding on Length Generalization in Transformerscited by 319
- 2024LongRoPE: Extending LLM Context Window Beyond 2 Million Tokenscited by 302
- 2023Effective Long-Context Scaling of Foundation Modelscited by 301
- 2020Sparse Sinkhorn Attentioncited by 250
- 2021LongT5: Efficient Text-To-Text Transformer for Long Sequencescited by 232
- 2024Griffin: Mixing Gated Linear Recurrences with Local Attention for Efficient Language Modelscited by 232
- 2022Neural Networks and the Chomsky Hierarchycited by 214
- 2023What Algorithms can Transformers Learn? A Study in Length Generalizationcited by 198
- 2020Rethinking Positional Encoding in Language Pre-trainingcited by 197
- 2023Zoology: Measuring and Improving Recall in Efficient Language Modelscited by 188
- 2024Data Engineering for Scaling Language Models to 128K Contextcited by 183
- 2022Transformer Language Models without Positional Encodings Still Learn Positional Informationcited by 148
- 2024Infini-gram: Scaling Unbounded n-gram Language Models to a Trillion Tokenscited by 148
- 2023Progressive-Hint Prompting Improves Reasoning in Large Language Modelscited by 147
- 2023Focused Transformer: Contrastive Training for Context Scalingcited by 133
- 2024LLM Maybe LongLM: Self-Extend LLM Context Window Without Tuningcited by 133
- 2023Scaling Laws of RoPE-based Extrapolationcited by 124
- 2024Keyformer: KV Cache Reduction through Key Tokens Selection for Efficient Generative Inferencecited by 124
- 2022A Length-Extrapolatable Transformercited by 123
- 2023Randomized Positional Encodings Boost Length Generalization of Transformerscited by 114
- 2023PoSE: Efficient Context Window Extension of LLMs via Positional Skip-wise Trainingcited by 109
- 2022KERPLE: Kernelized Relative Positional Embedding for Length Extrapolationcited by 84
- 2023CoLT5: Faster Long-Range Transformers with Conditional Computationcited by 84
- 2024Long-Context Language Modeling with Parallel Context Encodingcited by 84
- 2024Transformers Can Achieve Length Generalization But Not Robustlycited by 82
- 2023In-context Pretraining: Language Modeling Beyond Document Boundariescited by 76
- 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
Citing papers per year: 2024: 4; 2025: 18; 2026: 8.
30 papers.
Sort:
By area:
- 2024VisionZip: Longer is Better but Not Necessary in Vision Language Modelscited by 298
- 2025In Prospect and Retrospect: Reflective Memory Management for Long-term Personalized Dialogue Agentscited by 102
- 2024Why Does the Effective Context Length of LLMs Fall Short?cited by 60
- 2025PaTH Attention: Position Encoding via Accumulating Householder Transformationscited by 32
- 2025Extending the Context of Pretrained LLMs by Dropping Their Positional Embeddingscited by 23
- 2024HoPE: A Novel Positional Encoding Without Long-Term Decay for Enhanced Context Awareness and Extrapolationcited by 17
- 2025ParallelComp: Parallel Long-Context Compressor for Length Extrapolationcited by 13
- 2024DAPE V2: Process Attention Score as Feature Map for Length Extrapolationcited by 10
- 2025A Survey of Scaling in Large Language Model Reasoningcited by 10
- 2025RiemannFormer: A Framework for Attention in Curved Spacescited by 8
- 2025Kairos: Toward Adaptive and Parameter-Efficient Time Series Foundation Modelscited by 8
- 2025Hidden in the Haystack: Smaller Needles are More Difficult for LLMs to Findcited by 7
18 more
- 2025Group Representational Position Encodingcited by 5
- 2025Rethinking Addressing in Language Models via Contexualized Equivariant Positional Encodingcited by 4
- 2025Self-Adjust Softmaxcited by 3
- 2025LEDiT: Your Length-Extrapolatable Diffusion Transformer without Positional Encodingcited by 3
- 2025SAS: Simulated Attention Scorecited by 3
- 2025Context-aware Biases for Length Extrapolationcited by 2
- 2025RDDM: Practicing RAW Domain Diffusion Model for Real-world Image Restorationcited by 2
- 2025Beyond Real: Imaginary Extension of Rotary Position Embeddings for Long-Context LLMscited by 2
- 2026REAL: A Reasoning-Enhanced Graph Framework for Long-Term Memory Management of LLMscited by 2
- 2026Training Trajectories Determine Circuit Removability in Annealable Soft-Prior Transformerscited by 1
- 2025Position as Probability: Self-Supervised Transformers that Think Past Their Training for Length Extrapolationcited by 0
- 2025SCEESR: Semantic-Control Edge Enhancement for Diffusion-Based Super-Resolutioncited by 0
- 2026HopFormer: Sparse Graph Transformers with Explicit Receptive Field Controlcited by 0
- 2026Position Encoding with Random Float Sampling Enhances Length Generalization of Transformerscited by 0
- 2026DUET-VLM: Dual stage Unified Efficient Token reduction for VLM Training and Inferencecited by 0
- 2026A Measure-Theoretic Analysis of Reasoning: Structural Generalization and Approximation Limitscited by 0
- 2026Forget Attention: Importance-Aware Attention Is All You Needcited by 0
- 2026RoPE is Dead, Long Live RoPE: Towards Scalable Data-aware Positional Encodingscited by 0
- 2026RoPE is Dead, Long Live RoPE: Towards Scalable Data-aware Positional Encodings28 Sep 2026
- 2026Training Trajectories Determine Circuit Removability in Annealable Soft-Prior Transformers9 Sep 2026
- 2026REAL: A Reasoning-Enhanced Graph Framework for Long-Term Memory Management of LLMs9 Jun 2026
- 2026Forget Attention: Importance-Aware Attention Is All You Need1 Jun 2026
- 2026A Measure-Theoretic Analysis of Reasoning: Structural Generalization and Approximation Limits19 May 2026
- 2026DUET-VLM: Dual stage Unified Efficient Token reduction for VLM Training and Inference21 Feb 2026
- 2026Position Encoding with Random Float Sampling Enhances Length Generalization of Transformers15 Feb 2026
- 2026HopFormer: Sparse Graph Transformers with Explicit Receptive Field Control2 Feb 2026
- 2025Extending the Context of Pretrained LLMs by Dropping Their Positional Embeddings13 Dec 2025
- 2025Group Representational Position Encoding8 Dec 2025
- 2025Beyond Real: Imaginary Extension of Rotary Position Embeddings for Long-Context LLMs8 Dec 2025
- 2025SCEESR: Semantic-Control Edge Enhancement for Diffusion-Based Super-Resolution22 Oct 2025
18 more
- 2025Kairos: Toward Adaptive and Parameter-Efficient Time Series Foundation Models30 Sep 2025
- 2025RDDM: Practicing RAW Domain Diffusion Model for Real-world Image Restoration26 Aug 2025
- 2025SAS: Simulated Attention Score10 Jul 2025
- 2025RiemannFormer: A Framework for Attention in Curved Spaces9 Jun 2025
- 2025Position as Probability: Self-Supervised Transformers that Think Past Their Training for Length Extrapolation1 Jun 2025
- 2025Hidden in the Haystack: Smaller Needles are More Difficult for LLMs to Find23 May 2025
- 2025PaTH Attention: Position Encoding via Accumulating Householder Transformations22 May 2025
- 2025A Survey of Scaling in Large Language Model Reasoning2 Apr 2025
- 2025Context-aware Biases for Length Extrapolation11 Mar 2025
- 2025In Prospect and Retrospect: Reflective Memory Management for Long-term Personalized Dialogue Agents11 Mar 2025
- 2025LEDiT: Your Length-Extrapolatable Diffusion Transformer without Positional Encoding6 Mar 2025
- 2025Self-Adjust Softmax25 Feb 2025
- 2025ParallelComp: Parallel Long-Context Compressor for Length Extrapolation20 Feb 2025
- 2025Rethinking Addressing in Language Models via Contexualized Equivariant Positional Encoding1 Jan 2025
- 2024VisionZip: Longer is Better but Not Necessary in Vision Language Models5 Dec 2024
- 2024HoPE: A Novel Positional Encoding Without Long-Term Decay for Enhanced Context Awareness and Extrapolation28 Oct 2024
- 2024Why Does the Effective Context Length of LLMs Fall Short?24 Oct 2024
- 2024DAPE V2: Process Attention Score as Feature Map for Length Extrapolation7 Oct 2024
- 2025A Survey of Scaling in Large Language Model Reasoningcited by 10
- 2025Rethinking Addressing in Language Models via Contexualized Equivariant Positional Encodingcited by 4
- 2026REAL: A Reasoning-Enhanced Graph Framework for Long-Term Memory Management of LLMscited by 2
- 2026DUET-VLM: Dual stage Unified Efficient Token reduction for VLM Training and Inferencecited by 0
- 2026A Measure-Theoretic Analysis of Reasoning: Structural Generalization and Approximation Limitscited by 0
- 2026REAL: A Reasoning-Enhanced Graph Framework for Long-Term Memory Management of LLMs9 Jun 2026
- 2026A Measure-Theoretic Analysis of Reasoning: Structural Generalization and Approximation Limits19 May 2026
- 2026DUET-VLM: Dual stage Unified Efficient Token reduction for VLM Training and Inference21 Feb 2026
- 2025A Survey of Scaling in Large Language Model Reasoning2 Apr 2025
- 2025Rethinking Addressing in Language Models via Contexualized Equivariant Positional Encoding1 Jan 2025
- 2024Why Does the Effective Context Length of LLMs Fall Short?cited by 60
- 2025PaTH Attention: Position Encoding via Accumulating Householder Transformationscited by 32
- 2025Extending the Context of Pretrained LLMs by Dropping Their Positional Embeddingscited by 23
- 2024HoPE: A Novel Positional Encoding Without Long-Term Decay for Enhanced Context Awareness and Extrapolationcited by 17
- 2024DAPE V2: Process Attention Score as Feature Map for Length Extrapolationcited by 10
- 2025RiemannFormer: A Framework for Attention in Curved Spacescited by 8
- 2025Kairos: Toward Adaptive and Parameter-Efficient Time Series Foundation Modelscited by 8
- 2025Hidden in the Haystack: Smaller Needles are More Difficult for LLMs to Findcited by 7
- 2025Group Representational Position Encodingcited by 5
- 2025Self-Adjust Softmaxcited by 3
- 2025SAS: Simulated Attention Scorecited by 3
- 2025Context-aware Biases for Length Extrapolationcited by 2
12 most cited of 19 All 19 (JSON)
- 2026RoPE is Dead, Long Live RoPE: Towards Scalable Data-aware Positional Encodings28 Sep 2026
- 2026Training Trajectories Determine Circuit Removability in Annealable Soft-Prior Transformers9 Sep 2026
- 2026Forget Attention: Importance-Aware Attention Is All You Need1 Jun 2026
- 2026Position Encoding with Random Float Sampling Enhances Length Generalization of Transformers15 Feb 2026
- 2026HopFormer: Sparse Graph Transformers with Explicit Receptive Field Control2 Feb 2026
- 2025Extending the Context of Pretrained LLMs by Dropping Their Positional Embeddings13 Dec 2025
- 2025Group Representational Position Encoding8 Dec 2025
- 2025Beyond Real: Imaginary Extension of Rotary Position Embeddings for Long-Context LLMs8 Dec 2025
- 2025Kairos: Toward Adaptive and Parameter-Efficient Time Series Foundation Models30 Sep 2025
- 2025SAS: Simulated Attention Score10 Jul 2025
- 2025RiemannFormer: A Framework for Attention in Curved Spaces9 Jun 2025
- 2025Position as Probability: Self-Supervised Transformers that Think Past Their Training for Length Extrapolation1 Jun 2025
12 newest of 19 All 19 (JSON)