Log inStart free
LESSON 29.19 · 6 STAGES · 2 CONTROLS · 3 CHECKSPRO · PREVIEW

Greedy decoding and temperature

Watch temperature reshape the next-token odds, and greedy decoding take the top.


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

Go Pro · $8.25/mo
EXPLAINER · 29.19 · DECODERSTEP 1 · TOP LOGIT CAT 2.0
01
Stage 1 of 6 · Logits
After the prompt “the”, the model gives a logit to each of the 10 tokens. “cat” has the top logit, 2.0.
Explain it simply

Each row is one word the model knows. The teal bar is its logit, a raw score. A longer bar to the right means the model likes that word more after “the”. Bars to the left of the line are below zero.

Ten rows, one per token. Teal bars show the logits after the. Cat has the longest bar, 2.0, and dog is next with 1.8.

logitstemperature, draw uprobabilities, outputT = 1 bar
step 1, after “the”logit zthe−2.0cat2.0dog1.8sat−1.0ran−1.0on−1.5mat1.0rug0.6and−2.0.−2.5thepromptstep 1step 2step 3step 4step 5step 6step 7step 8step 1, after “the”logit zthe−2.0cat2.0dog1.8sat−1.0ran−1.0on−1.5mat1.0rug0.6and−2.0.−2.5thepromptstep 1step 2step 3step 4step 5step 6step 7step 8
Toy: a 10-token bigram model with hand-set logits, prompt “the”, 8 steps
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
zi=logit of token i\sy{z}{data}{z_i} = \text{logit of token } i
zcat=2.0, zdog=1.8z_{\text{cat}} = 2.0,\ z_{\text{dog}} = 1.8

The model gives each token one raw score.

Common mix-ups

MYTHA higher temperature changes which token is most likely.

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

Predict, then reveal
3 CHECKS · PRO
Q01If T rises from 0.5 to 2.0, does the bar for “cat” get taller or shorter?

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

PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
  • 5 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.