Skip to content

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 source

Hold distance fixed. Move both tokens.

A shared rotation changes the coordinates without changing the query–key dot product.

1 of 4

Reduced motion is on. Use Previous and Next to inspect each state.

Rotate queries and keysOne coordinate pair rotates at 0.25 radians per position. Each vector keeps its original length. Dot product -0.0908 · offset 4qkQuery position 0Key position 4Both lengths = √1.25θ = 0.25 rad / position

R(mθ)q · R(nθ)k = q · R((n−m)θ)k

Dot product -0.0908 · offset 4

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
x₀x₁qk

Query rotates by 0.75 radians.

Key rotates by 1.75 radians.

Dot product -0.0908Relative-position calculation: -0.0908

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.

One coordinate pair at θ = 0.25 radians per position, q = (1, 0.5), k = (0.5, 1). Real RoPE sums contributions across many pairs. This does not establish long-context extrapolation or monotonic score decay.

Su et al.Read the full explanation