Skip to lesson
How AI Works , back to the course page

Same prompt, different answers

Sampling and temperature: why a reply can change when nothing else did.

Module 1, lesson 4 of 4 · 4 min

Key terms: Sampling Picking each next token at random, in proportion to the model's odds., Temperature A setting that sharpens or flattens the odds before sampling., Prompt The instructions and material you give a model.

The same request can get different replies. In lesson 2's loop, the model doesn't have to take the top token. It Sampling Picking each next token at random, in proportion to the model's odds.: it picks at random, weighted by the odds, and one different early pick sends the rest down another path. The dial sets Temperature A setting that sharpens or flattens the odds before sampling.: how concentrated those odds are. It shows lesson 2's six likeliest tokens, 80 percent of the recorded odds, stretched to fill the chart. At temperature 1, delayed fills about 55 percent of the chart, from recorded odds of 45 percent.

Low temperature puts the odds on one word; high temperature spreads them out

The most common complaint from our coffee subscribers this week was about the

Shares among these 6 tokens at temperature 1.0 Shares among these 6 tokens at temperature 1.0

  1. ·delayed 55%
  2. ·incons 12%
  3. ·quality 10%
  4. ·delay 8%
  5. ·delivery 8%
  6. ·inconsistent 7%

Every other token is left out, so these 6 add up to 100%. · marks a space. Computed from GPT-4.1 mini’s odds, recorded on 9 Nov 2026.

At 1, the six keep their recorded ratios.

Step 1 of 4 Same prompt, different answers