← All entries
Post#1504

Is RoPE Just a Recency Bias?

Summary

A mechanistic explainer (with the author's own simulations) asking whether RoPE is merely a recency bias. Answer: partly - but trained models split the frequency spectrum into two regimes, and RoPE's deepest value may be as a training scaffold. (1) DEPHASING IS REAL: for a matching key (q = k), each 2D pair contributes ||k_i||^2 cos(omega_i * delta), and the pairs rotate at different rates, so the match decays to the chance level of an unrelated key (+-1/sqrt(d)): at head dim 128, base 10K, the fastest 16 pairs dephase by offset ~4, the middle 32 by ~512, the slowest 16 by ~4K (the author's simulations; 20K random keys per band). Past a quarter turn a pair's contribution flips sign and works against the match. (2) CONTENT LIVES IN THE SLOW PAIRS: at base 10K only 9 of 64 pairs stay under a quarter turn across 4K tokens and none at 32K - which is why long-context models raise the base (500K in Llama 3) - and Barbero et al. find Gemma 7B concentrates most Q/K norm in the slowest pairs. Their p-RoPE ablation (Gemma 2B from scratch, Wiki/FlanV2 ppl): unrotating the slowest 25% of pairs is free, marginally better (4.44/6.44 vs full RoPE 4.46/6.44); unrotating the fastest 25% is also nearly free (4.46/6.47); unrotating the slowest 75% hurts (4.53/6.51); NoPE is far worse (4.86/6.64). Partial RoPE (GPT-NeoX, Pythia rotate 25% of dims) and DeepSeek's MLA build the content/position separation in by design. A second threshold is one full turn: pairs completing less than a full turn in training (18 of 64 at 4K) rotate into unseen angles at longer contexts - YaRN interpolates exactly those pairs. (3) WHAT A RECENCY BIAS CANNOT DO: exact-offset heads. With a token-independent carrier on the fast pairs, setting W_Q = W_K rotated by omega_i*delta_0 in each 2D block - a fixed linear map, no MLP - peaks the logit at an exact offset delta_0; the author's toy head puts 0.998 of its weight on offset 3, while ALiBi always peaks at 0. Gemma 7B's previous-token and diagonal heads (the first half of an induction circuit) are built from its highest frequencies. Offset 0 is easy (any symmetric W_Q ~ W_K alignment phases all pairs at delta=0); offset >= 1 needs the per-block rotation in W_Q^T W_K, and because RoPE phases never enter the residual stream, a dynamic content-dependent offset delta(x) genuinely is hard - in practice sidestepped by induction circuits. (4) WHERE RECENCY HOLDS: at 120M / context 512 (Bianchessi et al.), ALiBi matches RoPE within 0.3 ppl (Wiki 18.55 vs 18.36; FineWeb 22.18 vs 22.44; NoPE trails both by 1.3-1.6), so short-context perplexity cannot separate the two explanations. Retrieval beyond the training length can: at 2x context on RULER multi-query/key/value, Gelberg et al.'s 500M models score RoPE 0/0/0, ALiBi 5.2/0/1.1 (its penalty downweights distant semantic matches), NoPE 9.2/36.2/21.4, DroPE 28.0/41.6/23.3. (5) ROPE AS TRAINING SCAFFOLD (Gelberg et al., DroPE, ICLR 2026): their theorem shows a causal NoPE transformer at small-variance init keeps attention near-uniform with gradients too bounded to build positional structure quickly, while RoPE breaks uniformity from step 0. Dropping RoPE mid-run (500M, 16B FineWeb tokens, 16K steps): NoPE throughout 23.77 val ppl; drop at 8K 22.42; drop at 14K 21.73; RoPE throughout 21.72 - free to drop at the end, but the 8K drop leaves a 0.70 gap, so RoPE keeps helping through most of training. Applied to pretrained SmolLM and Llama-2-7B, DroPE recalibration beats zero-shot YaRN/NTK on long-context benchmarks - with the author's own caveat that SmolLM-360M needs 60B recalibration tokens to fully match and there is no baseline spending those tokens on continued RoPE. Recalibration spikes the gradient norm 45x before settling; attention maps stay correlated (r = 0.68), diverging mainly in positional heads. (6) A TELLING ASYMMETRY: from scratch, losing rotation on either quarter of pairs barely matters, but in pretrained models the fast pairs matter more - Ji et al. (MHA2MLA) keeping only the fastest pairs in SmolLM costs -0.85% accuracy vs -6.49% for only the slowest at 135M (-0.76% vs -1.21% at 1.7B). The post closes with four cheap experiments that would separate the recency and offset-head accounts (induction vs skip-k head formation timing under RoPE/ALiBi/NoPE; matched-fraction band removal from scratch vs post-training; dropping ALiBi at 8K/14K as a scaffold control; offset profiles in Pythia's log-spaced early checkpoints). Provenance: a synthesis, not new experiments - the dephasing figures are the author's own simulations and the empirical results are Barbero et al. (ICLR 2025) and Gelberg et al. (ICLR 2026); the author discloses the write-up and figures were produced with Claude and Gemini assistance and edited by him, and he himself rates two external DroPE replication reports cited along the way as weak/suggestive only.

Venue
Personal research blog (blog.blackhc.net)
Source
blog
Access
free
Language
en
Added
Nov 3, 2026
Verified
Nov 3, 2026

Research notes

  • Blog post published 1 Nov 2026; shared via the author's X thread (@BlackHC, status 2117296183811215693, 2 Nov 2026). Synthesis/explainer: no new training experiments; figures simulated by the author (make_figures.py linked from the post). AI assistance (Claude, Gemini) disclosed by the author. Main sources: Barbero et al., arXiv 2410.06205 (ICLR 2025); Gelberg et al., DroPE (ICLR 2026). No license stated on the blog - flagged.

Similar entries