Frequency Bands in RoPE: Base Frequency and Context Length Shape the Interpolation-Extrapolation Trade-off
Yui Oka, Itsumi Saito, Kyosuke Nishida, Kuniko Saito
摘要
Rotary Position Embeddings (RoPE) are widely adopted in LLMs, and it is commonly believed that larger base frequencies yield better long-context performance. In this paper, we show that a high-norm RoPE dimension, referred to as the “frequency band,” consistently emerges across multiple models, and we focus on this band to reveal the trade-offs inherent in RoPE. We find that replacing the RoPE dimensions below the frequency band with NoPE during inference has little effect on performance, indicating that these lower-frequency dimensions are only weakly utilized. We further find that the location of the frequency band depends on the RoPE base and the training sequence length. Moreover, the band forms early during pre-training and persists even after context extension via position interpolation. Notably, we show that setting to the training length shifts the band toward lower frequencies and improves extrapolation, whereas increasing enhances interpolation but reduces extrapolation, revealing a clear trade-off between interpolation and extrapolation. We believe this work is a step toward a sharper understanding of positional embeddings in LLMs, with falsifiable diagnostics and practical guidance for choosing that support scaling to longer contexts.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
脉络
- YaRN: Efficient Context Window Extension of Large Language Models 引用了 The Impact of Positional Encoding on Length Generalization in Transformers
- The Impact of Positional Encoding on Length Generalization in Transformers 引用了 Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
- LongRoPE: Extending LLM Context Window Beyond 2 Million Tokens 引用了 YaRN: Efficient Context Window Extension of Large Language Models
它引用的 Paper10
- PIQA: Reasoning about Physical Commonsense in Natural LanguageYonatan Bisk, Rowan Zellers, Ronan Le Bras, Jianfeng Gao 等AAAI 2020 · 2,916 次引用
- Train Short, Test Long: Attention with Linear Biases Enables Input Length ExtrapolationOfir Press, Noah A. Smith, Mike LewisICLR 2022 · 1,168 次引用
- YaRN: Efficient Context Window Extension of Large Language ModelsBowen Peng, Jeffrey Quesnelle, Honglu Fan, Enrico ShippoleICLR 2024 · 508 次引用
- The Impact of Positional Encoding on Length Generalization in TransformersAmirhossein Kazemnejad, Inkit Padhi, Karthikeyan Natesan Ramamurthy, Payel Das 等NeurIPS 2023 · 444 次引用
- LongRoPE: Extending LLM Context Window Beyond 2 Million TokensYiran Ding, Li Lyna Zhang, Chengruidong Zhang, Yuanyuan Xu 等ICML 2024 · 316 次引用
相关 Paper
- Scaling Laws of RoPE-based ExtrapolationXiaoran Liu, Hang Yan, Chenxin An, Xipeng Qiu 等ICLR 2024 · 130 次引用
- Base of RoPE Bounds Context LengthMingyu Xu, Xin Men, Bingning Wang, Qingyu Zhang 等NeurIPS 2024 · 56 次引用
- AdaRoPE: Not All Attention Heads Should Rotate and Scale EquallyShaowen Wang, Yuke Zheng, Tansheng Zhu, Shuang Chen 等ICML 2026
- HoPE: A Novel Positional Encoding Without Long-Term Decay for Enhanced Context Awareness and ExtrapolationYuhan Chen, Ang Lv, Jian Luan, Bin Wang 等ACL 2025
- On the token distance modeling ability of higher RoPE attention dimensionXiangyu Hong, Che Jiang, Biqing Qi, Fandong Meng 等EMNLP Findings 2024 · 2 次引用
