Lune

ACL2025Top-tier venue

Extending LLM Context Window with Adaptive Grouped Positional Encoding: A Training-Free Method

Xinhao Xu, Jiaxin Li, Hui Chen, Zijia Lin, Jungong Han, Guiguang Ding

Abstract

Processing long input remains a significant challenge for large language models (LLMs) due to the scarcity of large-scale long-context training data and the high computational cost of training models for extended context windows. In this paper, we propose Ada ptive Gro uped P ositional E ncoding (AdaGroPE), a training-free, plug-and-play method to enhance long-context understanding in existing LLMs. AdaGroPE progressively increases the reuse count of relative positions as the distance grows and dynamically adapts the positional encoding mapping to sequence length, thereby fully exploiting the range of pre-trained position embeddings. Its design is consistent with the principles of rotary position embedding (RoPE) and aligns with human perception of relative distance, enabling robust performance in real-world settings with variable-length inputs. Extensive experiments across various benchmarks demonstrate that our AdaGroPE consistently achieves state-of-the-art performance, surpassing baseline methods and even outperforming LLMs inherently designed for long-context processing on certain tasks.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

Questions to start from

Lune can draw on

the full paper · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation cites Language Models are Few-Shot Learners
  • Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation cites Compressive Transformers for Long-Range Sequence Modelling
  • Random-Access Infinite Context Length for Transformers cites Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
  • Random-Access Infinite Context Length for Transformers cites Language Models are Few-Shot Learners
  • Random-Access Infinite Context Length for Transformers cites Compressive Transformers for Long-Range Sequence Modelling
  • LLM Maybe LongLM: SelfExtend LLM Context Window Without Tuning cites Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
  • LLM Maybe LongLM: SelfExtend LLM Context Window Without Tuning cites Language Models are Few-Shot Learners
  • LLM Maybe LongLM: SelfExtend LLM Context Window Without Tuning cites Compressive Transformers for Long-Range Sequence Modelling
Builds onCited byLeft to right by year; the more cited, the higher.

Builds on12

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Train Short, Test Long: Attention with Linear Biases Enables Input Length ExtrapolationOfir Press, Noah A. Smith, Mike LewisICLR 2022 · 1,168 citations
  3. Compressive Transformers for Long-Range Sequence ModellingJack W. Rae, Anna Potapenko, Siddhant M. Jayakumar, Chloe Hillier et al.ICLR 2020 · 833 citations
  4. Random-Access Infinite Context Length for TransformersAmirkeivan Mohtashami, Martin JaggiNeurIPS 2023 · 207 citations
  5. LLM Maybe LongLM: SelfExtend LLM Context Window Without TuningHongye Jin, Xiaotian Han, Jingfeng Yang, Zhimeng Jiang et al.ICML 2024 · 167 citations

Related papers

  1. LaMPE: Length-aware Multi-grained Positional Encoding for Adaptive Long-context Scaling Without TrainingSikui Zhang, Guangze Gao, Ziyun Gan, Chunfeng Yuan et al.ACL Findings 2026
  2. AdaRoPE: Not All Attention Heads Should Rotate and Scale EquallyShaowen Wang, Yuke Zheng, Tansheng Zhu, Shuang Chen et al.ICML 2026
  3. HoPE: A Novel Positional Encoding Without Long-Term Decay for Enhanced Context Awareness and ExtrapolationYuhan Chen, Ang Lv, Jian Luan, Bin Wang et al.ACL 2025
  4. PEPE: Long-context Extension for Large Language Models via Periodic Extrapolation Positional EncodingsJikun Hu, Dongsheng Guo, Yuli Liu, Qingyao Ai et al.EMNLP Findings 2025
  5. MrRoPE: Mixed-radix Rotary Position EmbeddingQingyuan Tian, Wenhong Zhu, Xiaoran Liu, Xiaofeng Wang et al.ICLR 2026 · 3 citations
Dusk over the sea between two cliffs drawn in fine vertical lines