Lune

NeurIPS2024Top-tier venue

Base of RoPE Bounds Context Length

Mingyu Xu, Xin Men, Bingning Wang, Qingyu Zhang, Hongyu Lin, Xianpei Han, Weipeng Chen

Abstract

Position embedding is a core component of current Large Language Models (LLMs). Rotary position embedding (RoPE), a technique that encodes the position information with a rotation matrix, has been the de facto choice for position embedding in many LLMs, such as the Llama series. RoPE has been further utilized to extend long context capability, which is roughly based on adjusting the base parameter of RoPE to mitigate out-of-distribution (OOD) problems in position embedding. However, in this paper, we find that LLMs may obtain a superficial long-context ability based on the OOD theory. We revisit the role of RoPE in LLMs and propose a novel property of long-term decay, we derive that the base of RoPE bounds context length: there is an absolute lower bound for the base value to obtain certain context length capability. Our work reveals the relationship between context length and RoPE base both theoretically and empirically, which may shed light on future long context training.

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.

21 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Rope to Nope and Back Again: A New Hybrid Attention Strategy cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • Rope to Nope and Back Again: A New Hybrid Attention Strategy cites YaRN: Efficient Context Window Extension of Large Language Models
  • Rope to Nope and Back Again: A New Hybrid Attention Strategy cites The Impact of Positional Encoding on Length Generalization in Transformers
  • FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness cites Compressive Transformers for Long-Range Sequence Modelling
  • YaRN: Efficient Context Window Extension of Large Language Models cites The Impact of Positional Encoding on Length Generalization in Transformers
  • YaRN: Efficient Context Window Extension of Large Language Models cites Compressive Transformers for Long-Range Sequence Modelling
  • SkyLadder: Better and Faster Pretraining via Context Window Scheduling cites YaRN: Efficient Context Window Extension of Large Language Models
  • SkyLadder: Better and Faster Pretraining via Context Window Scheduling cites The Impact of Positional Encoding on Length Generalization in Transformers
  • Test-Time Training Done Right cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • Untie the Knots: An Efficient Data Augmentation Strategy for Long-Context Pre-Training in Language Models cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • Untie the Knots: An Efficient Data Augmentation Strategy for Long-Context Pre-Training in Language Models cites YaRN: Efficient Context Window Extension of Large Language Models
  • LongLLaDA: Unlocking Long Context Capabilities in Diffusion LLMs cites YaRN: Efficient Context Window Extension of Large Language Models
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers21

  1. Test-Time Training Done RightTianyuan Zhang, Sai Bi, Yicong Hong, Kai Zhang et al.ICLR 2026 · 127 citations
  2. Rope to Nope and Back Again: A New Hybrid Attention StrategyBowen Yang, Bharat Venkitesh, Dwaraknath Gnaneshwar, Hangyu Lin et al.NeurIPS 2025 · 51 citations
  3. LongLLaDA: Unlocking Long Context Capabilities in Diffusion LLMsXiaoran Liu, Yuerong Song, Zhigeng Liu, Zengfeng Huang et al.AAAI 2026 · 30 citations
  4. Untie the Knots: An Efficient Data Augmentation Strategy for Long-Context Pre-Training in Language ModelsJunfeng Tian, Da Zheng, Yang Chen, Rui Wang et al.ACL 2025 · 8 citations
  5. SkyLadder: Better and Faster Pretraining via Context Window SchedulingTongyao Zhu, Qian Liu, Haonan Wang, Shiqi Chen et al.NeurIPS 2025 · 6 citations

Builds on14

  1. FlashAttention: Fast and Memory-Efficient Exact Attention with IO-AwarenessTri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra et al.NeurIPS 2022 · 5,493 citations
  2. Compressive Transformers for Long-Range Sequence ModellingJack W. Rae, Anna Potapenko, Siddhant M. Jayakumar, Chloe Hillier et al.ICLR 2020 · 833 citations
  3. YaRN: Efficient Context Window Extension of Large Language ModelsBowen Peng, Jeffrey Quesnelle, Honglu Fan, Enrico ShippoleICLR 2024 · 508 citations
  4. The Impact of Positional Encoding on Length Generalization in TransformersAmirhossein Kazemnejad, Inkit Padhi, Karthikeyan Natesan Ramamurthy, Payel Das et al.NeurIPS 2023 · 444 citations
  5. RWKV: Reinventing RNNs for the Transformer EraBo Peng, Eric Alcaide, Quentin Anthony, Alon Albalak et al.EMNLP Findings 2023 · 391 citations

Related papers

  1. Scaling Laws of RoPE-based ExtrapolationXiaoran Liu, Hang Yan, Chenxin An, Xipeng Qiu et al.ICLR 2024 · 130 citations
  2. The Rotary Position Embedding May Cause Dimension Inefficiency in Attention Heads for Long-Distance RetrievalTing-Rui Chiang, Dani YogatamaACL Findings 2025 · 1 citation
  3. Frequency Bands in RoPE: Base Frequency and Context Length Shape the Interpolation-Extrapolation Trade-offYui Oka, Itsumi Saito, Kyosuke Nishida, Kuniko SaitoICLR 2026
  4. 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
  5. 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
Dusk over the sea between two cliffs drawn in fine vertical lines