Log inStart free
LESSON 10.08 · 5 STAGES · 2 CONTROLS · 3 CHECKSPRO · PREVIEW

RoPE scaling and position interpolation

Watch slow RoPE pairs turn past the trained range, then two fixes pull them back.


Pro lesson. Stage 1 is free to watch. Pro opens all 5 stages, 2 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 10.08 · ROPE SCALINGTRAINED ON 8 POSITIONS · 4 PAIRS
01
Stage 1 of 5 · Trained turns
In training, RoPE turns each pair by its position times ω. The ochre arcs mark the turns the model saw.
Explain it simply

Each circle is one pair of numbers in a query or key. RoPE turns that pair by an angle that grows with the position. Pair 0 turns fast and goes full circle in about 6 positions, inside the 8 it trained on. Pair 3 turns so slowly that the dial zooms in 250 times to show it.

Four dials, one per pair. Positions 0 to 7 sit on each dial. An ochre arc covers the turns that training saw; pair 0's arc is a full circle.

positions (hollow: past 7)turns (band: trained; arc: 0 to 4)out of rangetrained turn, or past 7
pthe0cat1sat2on3the4mat5at6night701234567pair 0 · ω₀ = 1true scale · full circle01234567pair 1 · ω₁ = 0.1dial zoomed ×2.501234567pair 2 · ω₂ = 0.01dial zoomed ×2501234567pair 3 · ω₃ = 0.001dial zoomed ×250no scalingθ = p × ω for positions 0–7: pair 1 reaches 7 × 0.1 = 0.70 radpthe0cat1sat2on3the4mat5at6night701234567pair 0 · ω₀ = 1true scale · full circle01234567pair 1 · ω₁ = 0.1dial zoomed ×2.501234567pair 2 · ω₂ = 0.01dial zoomed ×2501234567pair 3 · ω₃ = 0.001dial zoomed ×250no scalingθ = p × ω for positions 0–7: pair 1 reaches 7 × 0.1 = 0.70 rad
Toy: 16 tokens, width 8 (4 pairs), trained on 8 positions; seeded embeddings (not trained)
STAGE 1 / 5
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
θp,i=p ωi,ωi=base−2i/d\sy{th}{param}{\theta_{p,i}} = \sy{p}{data}{p}\,\sy{w}{param}{\omega_i},\quad \sy{w}{param}{\omega_i} = \text{base}^{-2i/d}
ω=1, 0.1, 0.01, 0.001,θ7,i=7.000, 0.700, 0.070, 0.007\omega = 1,\ 0.1,\ 0.01,\ 0.001,\quad \theta_{7,i} = 7.000,\ 0.700,\ 0.070,\ 0.007

Each pair turns by its position times its frequency.

Common mix-ups

MYTHSlow pairs barely turn, so a longer input cannot hurt them.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01At 8 tokens, how much does position interpolation change the turns?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 5
Unlock the full explainer
  • 4 more stages and 2 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.