LESSON 29.22 · 6 STAGES · 2 CONTROLS · 2 CHECKSPRO · PREVIEW
Beam search
Watch beam search keep the best few sentences, one token at a time.
Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 2 controls and 2 checks, in this lesson and every other.
Go Pro · $8.25/moEXPLAINER · 29.22 · DECODERSTEP 1 · 10 CANDIDATES
01
Stage 1 of 6 · Expand
Beam search extends the prompt “the” by each of the 10 tokens. Each cell holds the log probability log p.
Explain it simply
The chip at the top left is the prompt. The grid below has one cell for each word the model knows. Each cell holds the log of that word's chance, and a number closer to zero means more likely. Here “cat” is the most likely, at minus 0.96.
The prompt chip the sits at the top left. Below it, a row of 10 cells holds log p for each token. The highest is cat at −0.96.
promptkept beams, scorespruned, misseddead end
Toy: a 10-token bigram model with hand-set logits, 8 steps, scored at T = 1
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
Each candidate's log probability is its logit minus the log of the softmax sum.
PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
- 5 more stages and 2 live controls
- 2 mix-up cards and 2 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.