Log inStart free
LESSON 10.C1 · 5 STAGES · 2 CONTROLS · 3 CHECKSPRO · PREVIEW

Position schemes past the training length

Watch seven position schemes score one word pair past position 7.


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.C1 · POSITION BAYROPE · SCORE −0.49 AT 3
01
Stage 1 of 5 · Seven schemes
One head scores “sat” then “on”, 1 position apart. Each row gives the head positions a different way.
Explain it simply

You see one attention head and one pair of words, “sat” then “on”. Each row is one way to tell the head where words sit, and its name links to its lesson. The note in each row says what it does with position. Training saw positions 0 to 7, and the dashed frame holds 8 to 15.

Five rows now: sine code, learned table, relative values, RoPE and ALiBi. Interpolation and the NTK base join in stage 5. Above the left panel are the 16 tokens. “sat” then “on” is in bold. Positions 8 to 15 sit in a dashed frame.

tokens at positions 0–7scores; hollow past 7past position 7; no table row
past position 7offsets past 70781507815query positionoffset kthecatsatonthematatnightandthedogsatontheoldrugSine codelesson 10.04Learned tablelesson 10.05Relative valueslesson 10.05RoPElesson 10.06ALiBilesson 10.07seven schemessame pair, latersame words, farther apart“sat” at 0, “on” at offset kadds sin, cos of preads token positionsadds a learned row per preads token positionsadds a learned breads the offset onlyturns q, k by p × ωreads the offset onlysubtracts ¼ per stepreads the offset onlypast position 7offsets past 70781507815query positionoffset kthecatsatonthematatnightandthedogsatontheoldrugSine codelesson 10.04Learned tablelesson 10.05Relative valueslesson 10.05RoPElesson 10.06ALiBilesson 10.07seven schemessame pair, latersame words, farther apart“sat” at 0, “on” at offset kadds sin, cos of preads token positionsadds a learned row per preads token positionsadds a learned breads the offset onlyturns q, k by p × ωreads the offset onlysubtracts ¼ per stepreads the offset only
Toy: W_Q, W_K seeded (10.06), not trained; ALiBi head 1 = dims 0–1; table and offset values trained on 0–7
STAGE 1 / 5
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
sij=(Riω q)⋅(Rjω k)\sy{s}{out}{s_{ij}} = (\sy{pos}{param}{R_{i\omega}}\,\sy{q}{data}{q})\cdot(\sy{pos}{param}{R_{j\omega}}\,\sy{k}{data}{k})
s3,2=−0.18−0.31=−0.49s_{3,2} = -0.18 - 0.31 = -0.49

Turn the query and the key by their positions, then compare them.

Common mix-ups

MYTHThe sine code reads offsets, so it extends like RoPE.

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

Predict, then reveal
3 CHECKS · PRO
Q01With “the” then “the”, does the RoPE score stay the same past position 7?

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.