Orthogonal matrix
A matrix that only rotates (or mirrors) vectors: it keeps every length and every angle, and its transpose undoes it. R^⊤R = I says exactly that.
Because (the transpose is the inverse), the RoPE identity follows in one line: undo a rotation by , then apply a rotation by , and the net rotation is by . And because rotations keep lengths, RoPE cannot make a query or key longer or shorter. It only turns it, so position is encoded without changing the vector's size.
Example
A 90° rotation. Both vectors have length 5.
Where the course uses it
Related terms
- RoPE rotation matrixRead "R theta m". It rotates a query or key vector by an angle that grows with the token's position m, so position is stored as an amount of rotation.
- TransposeRead "A transpose". The raised T flips a matrix so its rows become its columns. On a vector it turns a column into a row.
- I — the identity matrixRead "I" or "the identity". It is a square matrix with 1s on the diagonal and 0s elsewhere. Multiplying by it leaves a vector unchanged.