Skip to content
mentoor

Sampling and temperature

For both

Why the same prompt gives different answers, the temperature and top-p knobs, and how to get repeatable or varied output on purpose

See where you stand

110 questions across four stages: Understand, Apply, Solve and Judge.

Try 5 questions

Practice items, not counted towards your mastery. No account needed.

Check yourself · 1 of 5

You run the same prompt twice in a chat assistant and get two differently worded answers. What is the most likely reason?

Choose one answer

Check yourself · 2 of 5

What does lowering the temperature do to next-token probabilities?

Choose one answer

Check yourself · 3 of 5

Why can a request at temperature zero still return different text on different runs?

Choose one answer

Check yourself · 4 of 5

Which task is best served by a temperature close to zero?

Choose one answer

Check yourself · 5 of 5

You ask a model the same factual question five times and get five different answers. What does this most likely tell you?

Choose one answer

Topics

  1. Why the same prompt varies4 min read · Random sampling, server-side nondeterminism and silent model updates all change answers
  2. Temperature, top-p and top-k settings5 min read · How each knob reshapes the next-token probabilities and what that does to the text
  3. Getting repeatable model outputs5 min read · Why temperature zero is not a guarantee, and how seeds, pinned model versions and structured outputs help
  4. Matching sampling settings to tasks5 min read · Settings for extraction, code and brainstorming, and why many reasoning models fix sampling for you
  5. Sampling many answers and choosing5 min read · Regenerating, best-of-n and majority voting turn randomness into a signal of uncertainty

Start here

Helps to know first

110 questions · last verified 2026-12