RoPE, Visualized: An Interactive Guide from Attention Scores to Rotary Position Embeddings
CSProfKGD · x · 2026-12-04
Kaili Huang published an interactive blog post, RoPE, Visualized, explaining position encoding in modern LLMs with draggable figures.
- Why it matters: Attention alone ignores word order—shuffling "I love cats" leaves every pairwise score unchanged. Absolute encodings break when inserting a word shifts all positions, changing scores between still-adjacent words.
- RoPE's approach: Instead of tagging positions, it rotates q and k by position-dependent angles, so scores depend only on relative distance. Proposed by Jianlin Su et al. in 2021, it now powers LLaMA, Qwen, Mistral and other mainstream open models.
- Unplanned bonus: Because positions became angles, context length can be extended after training—the first LLaMA read only 2K tokens, but scaling down RoPE angles with under 1,000 fine-tuning steps stretched it to 32K.
The post walks from attention scores through reinventing RoPE step by step, covering the 2D design, higher dimensions, and code details, with bilingual English/Chinese versions and companion Transformer notes for Stanford CS224N.
More from Models
- Antigravity users report ~40% weekly quota cut with zero notice, logs show — kalyan_kpl · 2026-12-04
- Interactive 40-term Activation & Gating dictionary built to decode Amazon's Ergo 1.0 architecture — Dave_Maynor · 2026-12-04
- Ollama pre-release adds Alibaba's new Qwen4-35B-A3B model — ollama · 2026-12-04
- unsloth's Qwen4-35B-A3B GGUF quantization trends on Hugging Face — unsloth · 2026-12-04
- Bindu Reddy: OpenAI Is a Giant Mystery — Astra 6.2 Flopped as Google Takes Share — bindureddy · 2026-12-04
- Qwen4-35B-A3B Q8 eval: matches Qwen3.8-27B xhigh, faster on fewer tokens — norenEnmotalen · 2026-12-04