RoPE: Rotary Positional Embeddings, and Why Relative Distance Is What Actually Matters

Part five of the transformer study notes: how rotary positional embeddings encode relative position by rotating query and key vectors, the 2D rotation mechanic behind Q·Kᵀ depending only on m−n, per-dimension-pair frequencies, why only Q and K are rotated, and why RoPE coexists cleanly with KV-caching — grounded in the Llama/Gemma backbones behind OpenVLA and π0.

In this article

  • The limits of adding position once, up front
  • What actually matters: relative distance
  • The rotation mechanic
  • Different pairs, different frequencies
  • Where RoPE actually runs
  • Why this still works with a KV cache
  • Where this shows up in the VLAs already covered
  • Mistakes I made learning this
  • Glossary