LESSON 29.21 · 5 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW
Repetition, frequency and presence penalties
Watch three penalties push a looping greedy decoder onto new tokens.
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/moEXPLAINER · 29.21 · DECODERGREEDY · 16 TOKENS · 11 REPEATS
01
Stage 1 of 5 · Greedy loops
Greedy decoding takes the top logit at every step. The text falls into a loop: “cat sat on the”.
Explain it simply
Greedy decoding always takes the token with the highest score, its logit. After “on” the top logit is “the”, and after “the” it is “cat”. So the same four words come back again and again. The top row shows this loop, and a mark under a chip shows a repeated phrase.
The top row shows 16 greedy tokens with no penalty: cat sat on the, four times. The rows below show the logits at step 4, after on. The top logit is the at 2.20.
logits and countsbefore the penalty: logit, pickpenalty, repeated phrasepicked token
Toy: a 10-token bigram model with hand-set logits, prompt “the”, 16 greedy steps
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
Greedy takes the token with the largest logit.
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.