RoPE relative-position rotation
Shows why rotary position embedding makes a query-key attention score depend on relative position even though each vector receives an absolute-position rotation.
Rotated query at position m transpose times rotated key at position n equals query m transpose times the relative rotary matrix at position difference n minus m times key n.
Rotate queries and keys separately, yet make their similarity depend on the distance between token positions.
The dot product is the output operation; orthogonal rotation algebra transforms its two absolute phases into one relative phase.
Implementations apply sine and cosine elementwise rather than constructing full block-diagonal matrices, but the same identity governs the result.