Self-Attention Dynamics with Rotary Position Embeddings: Twisted States and Explicit Consensus Rates on the Sphere
2026-07-27 • Machine Learning
Machine Learning
AI summaryⓘ
The authors investigate how Rotary Position Embeddings (RoPE) affect the way attention mechanisms behave when queries and keys are rotated, while values stay fixed on a sphere. They analyze the system using continuous-time dynamics and discover that the attention behaves like a reversible process with a consistent minimum softmax value. Their work explains how different configurations of tokens stabilize or become unstable, especially on a ring structure with specific frequency patterns. They also find that how energy spreads across frequency components influences the system in complex ways, and they verify their mathematical results through multiple computational methods.
Rotary Position Embeddingsself-attentionsoftmaxcontinuous-time dynamicsMarkov operatorBessel spectrumfrequency resonancestability analysisunit sphere
Authors
Hao Ye
Abstract
Rotary position embeddings (RoPE) modify attention scores through position-dependent rotations, but their effect on normalized token dynamics is not captured by the vanilla spherical self-attention model. We study the continuous-time dynamics obtained when queries and keys are rotated while values remain on the unit sphere. The resulting attention kernel is reversible and admits a sharp uniform softmax floor, yet the natural RoPE interaction energy has derivatives of both signs within one fixed nontrivial system. Every consensus state remains an equilibrium, and its transverse linearization is a reversible Markov operator whose kernel depends on the consensus point through its energy across RoPE planes. On a resonant single-frequency ring we derive an exact Bessel-aliasing spectrum, including non-coprime frequencies and the correct fixed-ring large-$β$ asymptotics. Globally, closed hemispheres are invariant, while pairwise non-obtuse configurations and strict open semicircles contract with explicit half-angle and single-point tail bounds. These regional estimates instantiate a kernel-generic positivity principle with the sharp RoPE softmax floor. RoPE also selects an explicit score-flattening twisted branch; the generic resonant family is non-hyperbolic and linearly unstable, whereas an odd antipodal family becomes a hyperbolic saddle after quotienting global rotation. In multiple dimensions, the local consensus gap can depend non-monotonically on the allocation of energy across frequency planes, so no universal ordering by frequency is valid. Independent matrix, finite-difference, and nonlinear-flow computations cross-check the theorem boundaries and the reported constants.