Position becomes a rotation.
Turn three coordinate pairs at different frequencies and inspect how position changes their phase.
Preparing the 3D view…
Split into pairs
A six-dimensional vector is split into three two-dimensional pairs. Each ring shows one pair, initially (1, 0). The rings are stacked only to separate them visually; depth is the pair index, not an extra embedding coordinate.
Move through the sequence
At position m, pair i rotates by m × 10000^(−2i/6) radians. The first pair turns rapidly; later pairs change more slowly. Every pair keeps its length.
Compare relative positions
Applying these rotations to queries and keys makes their inner product depend on their relative position. This scene shows the rotations only; it does not compute attention, train embeddings, or model long-context extensions.
The equation behind the motion
θᵢ = 10000^(−2i/6); (x₂ᵢ, x₂ᵢ₊₁) ← R(mθᵢ)(x₂ᵢ, x₂ᵢ₊₁)
Synthetic inputs with explicit geometric assumptions. Rotate the view and inspect the model above.
Read the primary sourceHold distance fixed. Move both tokens.
A shared rotation changes the coordinates without changing the query–key dot product.
Reduced motion is on. Use Previous and Next to inspect each state.
R(mθ)q · R(nθ)k = q · R((n−m)θ)k
Rotate queries and keys
One coordinate pair rotates at 0.25 radians per position. Each vector keeps its original length.
Explore the inputs and calculations
Query rotates by 0.75 radians.
Key rotates by 1.75 radians.
Move the query-position slider while holding the offset fixed. Both vectors rotate together; the score stays the same.
Read the identity
q′ = R(mθ)q, k′ = R(nθ)k. Because rotation is orthogonal, q′ᵀk′ = qᵀR((n−m)θ)k. Both vector lengths remain √1.25. Position n = 7; negative indices here are valid algebraic offsets, not a tokenizer convention.
Does moving both tokens by the same amount change this score?
No. R(mθ)ᵀR(nθ) = R((n−m)θ). With fixed unrotated vectors and frequencies, only their position difference enters this pair’s score.