AdaRoPE: Not All Attention Heads Should Rotate and Scale Equally
Shaowen Wang, Yuke Zheng, Tansheng Zhu, Shuang Chen, Shaofan Liu, Suncong Zheng, Jian Li
Abstract
Rotary Position Embedding (RoPE) is widely adopted in Transformers to encode positional information, yet standard implementations enforce a uniform frequency schedule and scaling across all attention heads. Using simplified retrieval tasks and length generalization scenarios, we show -- both empirically and theoretically -- that heads with different functional roles require distinct frequency ranges and attention scaling factors to operate effectively. Ignoring this structure leads to suboptimal utilization of embedding dimensions and degraded performance, particularly under long-context settings. To address these limitations, we propose AdaRoPE, which equips each attention head with learnable rotation frequencies and attention scaling factors. Pretrained LLMs with AdaRoPE consistently outperform existing RoPE variants, including partial RoPE and NoPE baselines. For context extension, we further show that uniform frequency and attention scaling, used in methods such as YaRN, are suboptimal. By applying head-specific scaling, AdaRoPE enables better context extension while better preserving short-context performance in both the extrapolation setting and the long-context continued pretraining setting. These results highlight the importance of optimizing rotary position embedding at the level of individual attention heads.
Create a lesson
Metadata
- Categories
- cs.AI, cs.CL
- Comments
- Accepted at ICML 2026
Related papers
Agentic Waterfall: An Intent-Driven Information Discovery Framework for Reclaiming User Control in the Attention Economy
Shared title terminologycs.AIYige Luo, Shining Zhang, Jikun Liu et al.
EATS: Scaling Tool-Use Experience for Medical Reasoning Agents
Shared title terminologycs.AIMingyuan Li, Tong Jia, Haoran Wang et al.
The Platonic Representation Hypothesis in Jacobian-Space: Language and Vision Models Agree Approximately Up to a Rotation
Shared title terminologycs.AIRoss Murphy, Gabriel Brostow
Perception Is Enough, at the Right Scale: Scale-Adaptive Token Pruning for Vision-Language-Action Models
Shared title terminologycs.AIYifeng Lin, Liuxiang Qiu, Yunfeng Chen et al.
Do We Really Need Adaptive Global Spatial Attention for Traffic Forecasting?
Shared title terminologycs.AIQihang Zhang, Siyao Zhang, Letao Kang et al.
RedKnot: Efficient Long-Context LLM Serving with Head-Aware KV Reuse and SegPagedAttention
Shared title terminologycs.AIYang Liu, Zhaokai Luo, Huayi Jin et al.