Context-aware Rotary Position Embedding
Not on the map. Why?
Abstract (arXiv)
Positional encoding is a vital component of Transformer architectures, enabling models to incorporate sequence order into self-attention mechanisms. Rotary Positional Embeddings (RoPE) have become a widely adopted solution due to their compatibility with relative position encoding and computational efficiency. However, RoPE relies on static, input-independent sinusoidal frequency patterns, limiting its ability to model context-sensitive relationships. In this work, we propose CARoPE (Context-Aware Rotary Positional Embedding), a novel generalization of RoPE that dynamically generates head-specific frequency patterns conditioned on token embeddings. This design introduces token- and context-sensitive positional representations while preserving RoPE efficiency and architectural simplicity. CARoPE computes input-dependent phase shifts using a bounded transformation of token embeddings and integrates them into the rotary mechanism across attention heads. We evaluate CARoPE on the FineWeb-Edu-10B dataset using GPT-2 variants trained on next-token prediction tasks. Experimental results show that CARoPE consistently outperforms RoPE and other common positional encoding baselines, achieving significantly lower perplexity, even at longer context lengths. Additionally, CARoPE enables faster training throughput without sacrificing model stability. These findings demonstrate that CARoPE offers a scalable, expressive, and efficient upgrade to existing positional encoding strategies in Transformer models.
Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Builds on 17 of its 21 references that are in the map. First posted on arXiv 30 Jul 2025.
Builds on
17 of 21 references.
References · 17
- 2017Attention Is All You Needcited by 60,361
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,372
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
- 2024Gemma 2: Improving Open Language Models at a Practical Sizecited by 1,998
- 2024The FineWeb Datasets: Decanting the Web for the Finest Text Data at Scalecited by 1,160
- 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,103
- 2017Convolutional Sequence to Sequence Learningcited by 552
5 more
- 2018Fundamentals of Recurrent Neural Network (RNN) and Long Short-Term Memory (LSTM) Networkcited by 420
- 2019Are Transformers universal approximators of sequence-to-sequence functions?cited by 406
- 2021BASE Layers: Simplifying Training of Large, Sparse Modelscited by 320
- 2018Adaptive Input Representations for Neural Language Modelingcited by 226
- 2018Scaling Neural Machine Translationcited by 204
Built on by
Citing papers per year: 2026: 4.
4 papers.
- 2026Adaptive 3D-RoPE: Physics-Aligned Rotary Positional Encoding for Wireless Foundation Modelscited by 2
- 2026Parabolic Position Encoding: Vision-Centric, Principled, Extrapolatable, Generalcited by 0
- 2026Out-of-Length Scene Text Recognition: A Two-Axis Diagnosis and a Training-Free Fixcited by 0
- 2026RoPE is Dead, Long Live RoPE: Towards Scalable Data-aware Positional Encodingscited by 0
- 2026RoPE is Dead, Long Live RoPE: Towards Scalable Data-aware Positional Encodings28 Sep 2026
- 2026Out-of-Length Scene Text Recognition: A Two-Axis Diagnosis and a Training-Free Fix25 Jul 2026
- 2026Adaptive 3D-RoPE: Physics-Aligned Rotary Positional Encoding for Wireless Foundation Models1 May 2026
- 2026Parabolic Position Encoding: Vision-Centric, Principled, Extrapolatable, General1 Feb 2026