Interactive exploration of how RoPE encodes position information in transformer models
Visualization of how RoPE rotates vector components in 3D space. Each pair of vector dimensions is rotated by an angle determined by the position and frequency.
Shows the geometric progression of frequencies across dimensions. Lower dimensions have higher frequencies (shorter wavelengths) while higher dimensions have lower frequencies.
Dimension Pair | Original Values | Rotated Values | Rotation Angle | Frequency |
---|
Rotary Positional Embedding (RoPE) encodes position information by rotating pairs of vector components:
The rotation matrix for each pair is:
Mᵢ = [ cos(pωᵢ) -sin(pωᵢ) ]
[ sin(pωᵢ) cos(pωᵢ) ]