Log inStart free
LESSON 30.12 · 5 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

Speculative sampling

Watch a keep test and a refill give the target model's exact chances.


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

Go Pro · $8.25/mo
EXPLAINER · 30.12 · DECODE BAYPLACE 4 · TINY DRAFT · TOP MAT
01
Stage 1 of 5 · Two distributions
At place 4, the target model gives a probability distribution p over 12 words. The draft model gives a flatter q.
Explain it simply

Each column is one word. The left bar is the draft's chance for it, and the right bar is the target's. The draft sees less of the text, so it is less sure. The draft likes "cat" most, but the target likes "mat".

Twelve word columns. mat: draft chance 0.16, target chance 0.59.

draft chance qtarget chance p, refillthrown awaydraft q, as an outlinetick: target chance p
0.000.300.60chance… sat on the?place 4 of 12 · tiny draftthecatdogsatsleptonbymatdoorrugand.draft q and target pdraft's top word: cat 0.30 · target's top word: mat 0.590.000.300.60chance… sat on the?place 4 of 12 · tiny draftthecatdogsatsleptonbymatdoorrugand.draft q and target pdraft's top word: cat 0.30 · target's top word: mat 0.59
Toy: the 30.C2 trigram target and two drafts over 12 words; one place; 2000 seeded trials
STAGE 1 / 5
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
x∼q,goal: x∼px \sim \sy{q}{data}{q},\quad \text{goal: } x \sim \sy{p}{out}{p}
q(mat)=0.16,  p(mat)=0.59q(\text{mat}) = 0.16,\; p(\text{mat}) = 0.59

The draft draws x from q, but the output must follow p.

Common mix-ups

MYTHAfter a reject, the target can draw from its whole p.

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

Predict, then reveal
3 CHECKS · PRO
Q01With the keep test, will a stronger draft model keep more of its words, or fewer?

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 3 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.