Effective Length Extrapolation via Dimension-Wise Positional Embeddings Manipulation
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) often struggle to process and generate coherent context when the number of input tokens exceeds the pre-trained length. Recent advancements in long-context extension have significantly expanded the context window of LLMs but require expensive overhead to train the large-scale models with longer context. In this work, we propose Dimension-Wise Positional Embeddings Manipulation (DPE), a training-free framework to extrapolate the context window of LLMs by diving into RoPE's different hidden dimensions. Instead of manipulating all dimensions equally, DPE detects the effective length for every dimension and finds the key dimensions for context extension. We reuse the original position indices with their embeddings from the pre-trained model and manipulate the key dimensions' position indices to their most effective lengths. In this way, DPE adjusts the pre-trained models with minimal modifications while ensuring that each dimension reaches its optimal state for extrapolation. DPE significantly surpasses well-known baselines such as YaRN and Self-Extend. DPE enables Llama3-8k 8B to support context windows of 128k tokens without continual training and integrates seamlessly with Flash Attention 2. In addition to its impressive extrapolation capability, DPE also dramatically improves the models' performance within training length, such as Llama3.1 70B, by over 18 points on popular long-context benchmarks RULER. When compared with commercial models, Llama 3.1 70B with DPE even achieves better performance than GPT-4-128K.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 24 of its 34 references that are in the map. First posted on arXiv 26 Apr 2025.
Builds on
24 of 34 references.
References · 24
- 2017Attention Is All You Needcited by 60,361
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
- 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,598
- 2023Efficient Streaming Language Models with Attention Sinkscited by 2,186
- 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,850
- 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,346
- 2023Extending Context Window of Large Language Models via Positional Interpolationcited by 740
- 2019Compressive Transformers for Long-Range Sequence Modellingcited by 726
- 2025Native Sparse Attention: Hardware-Aligned and Natively Trainable Sparse Attentioncited by 407
- 2024MInference 1.0: Accelerating Pre-filling for Long-Context LLMs via Dynamic Sparse Attentioncited by 383
- 2024LongRoPE: Extending LLM Context Window Beyond 2 Million Tokenscited by 313
12 more
- 2023Effective Long-Context Scaling of Foundation Modelscited by 303
- 2024HELMET: How to Evaluate Long-Context Language Models Effectively and Thoroughlycited by 125
- 2024Round and Round We Go! What makes Rotary Positional Encodings useful?cited by 115
- 2024Why Does the Effective Context Length of LLMs Fall Short?cited by 63
- 2024Training-Free Long-Context Scaling of Large Language Modelscited by 62
- 2023CLEX: Continuous Length Extrapolation for Large Language Modelscited by 44
- 2025Towards Economical Inference: Enabling DeepSeek's Multi-Head Latent Attention in Any Transformer-based LLMscited by 27
- 2024A Controlled Study on Long Context Extension and Generalization in LLMscited by 26
- 2024LongHeads: Multi-Head Attention is Secretly a Long Context Processorcited by 16
- 2024On the token distance modeling ability of higher RoPE attention dimensioncited by 13
- 2025Thus Spake Long-Context Large Language Modelcited by 12
- 2024HiRoPE: Length Extrapolation for Code Models Using Hierarchical Positioncited by 8
Built on by
Not cited yet.