Selective Rotary Position Embedding
ELLIS Institute Tübingen, Max Planck Institute for Intelligent Systems, Tübingen AI Center · ELLIS Institute Tübingen, University of Freiburg · EPFL - Mistral AI · PriorLabs & ELLIS Institute Tübingen & University of Freiburg · ELLIS Institute Tübingen, MPI for Intelligent Systems, Tübingen AI Center, Tübingen, Germany · Swiss Federal Institute of Technology Lausanne
PDF 由论文原始站点提供,PaperCompass 不保存论文文件。
摘要
Positional information is essential for language modeling. Softmax Transformers with Rotary Position Embeddings (RoPE) encode it with fixed-angle rotations, while linear Transformers rely on input-dependent gates that only decay past key-value norms. We provide a theoretical argument for the necessity of a rotation and decay component in well-performing sequence models, and observe that the missing ingredient in linear models is precisely the rotation that softmax attention performs implicitly. We introduce Selective Rotary Position Embedding (*Selective RoPE*), an input-dependent, learnable rotary embedding that generalizes RoPE to arbitrary angles and composes seamlessly with decay gates. Equipping gated linear attention with *Selective RoPE* yields a complex-valued recurrent layer that can be implemented efficiently with the “RoPE trick”. On synthetic benchmarks (MQAR, copying, state tracking) and 370M-parameter language-model pre-training, the method improves recall, downstream accuracy, and expressivity while adding minimal architectural overhead. We open-source our implementation [here](https://github.com/timurcarstensen/selective-rope).