The Rotary Position Embedding (RoPE) Complex Inner Product Proof establishes the mathematical necessity of orthogonal block-diagonal rotation matrices for encoding relative position semantics into Transformers; the core functional equation requires finding representations
fq(xm,m) and
fk(xn,n) such that their inner product depends strictly on relative offset
m−n:
⟨fq(xm,m),fk(xn,n)⟩=g(xm,xn,m−n); using complex analysis and Euler's formula, the unique 2D solution is complex multiplication
f(x,m)=xeimθ; expanding across
d/2 orthogonal sub-planes yields a block-diagonal orthogonal rotation matrix
RΘ,md, achieving
relative position interactions through absolute coordinate rotations with norm preservation and seamless context scaling (YaRN / NTK-aware interpolation).