Round and Round We Go! What makes Rotary Positional Encodings useful?
Summary
Positional Encodings (PEs) are a critical component of Transformer-based Large Language Models (LLMs), providing the attention mechanism with important sequence-position information. One of the most popular types of encoding used today in LLMs are Rotary Positional Encodings (RoPE), that rotate the queries and keys bas…
- Venue
- arXiv 2410.06205
- Publisher
- arXiv 2410.06205
- Source
- arxiv
- Access
- open arXiv PDF/abs
- Purpose
- Round and Round We Go! What makes Rotary Positional Encodings useful?
- Domain
- long context; safety
- Used for
- LLM research reference
- Time period
- arXiv 2024/10/08; Discord LinkedIn mid harvested 2026-09-15
- Author type
- academic/industry (see abs)
- Added
- Sep 15, 2026
- Verified
- Sep 15, 2026
- Research status
- done
- Found via
- #random-papers
From the source
- Published
- Oct 8, 2024
- Last revised
- May 13, 2025
- arXiv categories
- cs.CL, cs.LG
- Citations
- 129 (15 influential)
- References
- 40
- Published in
- International Conference on Learning Representations
Abstract (from arXiv)
Positional Encodings (PEs) are a critical component of Transformer-based Large Language Models (LLMs), providing the attention mechanism with important sequence-position information. One of the most popular types of encoding used today in LLMs are Rotary Positional Encodings (RoPE), that rotate the queries and keys based on their relative distance. A common belief is that RoPE is useful because it helps to decay token dependency as relative distance increases. In this work, we argue that this is unlikely to be the core reason. We study the internals of a trained Gemma 7B model to understand how RoPE is being used at a mechanical level. We find that Gemma learns to use RoPE to construct robust "positional" attention patterns by exploiting the highest frequencies. We also find that, in general, Gemma greatly prefers to use the lowest frequencies of RoPE, which we suspect are used to carry semantic information. We mathematically prove interesting behaviours of RoPE and conduct experiments to verify our findings, proposing a modification of RoPE that fixes some highlighted issues and improves performance. We believe that this work represents an interesting step in better understanding PEs in LLMs, which we believe holds crucial value for scaling LLMs to large sizes and context lengths.
Tags
Topics
long context; safety
Research notes
- From LinkedIn thread (Discord mid 1362796014683160646). Primary: https://www.linkedin.com/posts/pierre-carl-langlais-b0105b10_what-if-your-llm-is-a-graph-a-few-days-activity-7318210982483263488-CtH9?utm_source=share&utm_medium=member_desktop.
Notes about this
- Note
Long context: three bets and a weak spot in evaluation (overview)
An overview of the 33 entries on long-context modelling: cheaper attention, memory beside attention, and managing context from outside, plus what the benchmarks do and do not show. Written by Claude Opus 5.5.
Cites, within this collection
Cited by, within this collection
Similar entries
- Paper Agentic Context Engineering: Evolving Contexts for Self-Improving Language Models
- Paper Scalable In-context Ranking with Generative Models
- Paper From $f(x)$ and $g(x)$ to $f(g(x))$: LLMs Learn New Skills in RL by Composing Old Ones
- Paper MEDIC: Comprehensive Evaluation of Leading Indicators for LLM Safety and Utility in Clinical Applications
- Paper ImpossibleBench: Measuring LLMs' Propensity of Exploiting Test Cases
- Paper LoongRL: Reinforcement Learning for Advanced Reasoning over Long Contexts