Skip to main content

Sampling

Sampling

  • Model capabilities
  • Stage 2 · Hands On
  • refs checked 2026-11-19
What problem it solves

How the model picks among candidate tokens — this determines how far the output diverges.

What it is
A collective term for parameters controlling generation: temperature, Top-p, Top-k and so on. They affect only how a token is chosen, not the intelligence of the model itself.
Logits are scaled by temperature, truncated by top-k/top-p, then sampled from the remaining probabilities.
Logits are scaled by temperature, truncated by top-k/top-p, then sampled from the remaining probabilities.
Why it matters

Once you know these parameters, unstable output has an explainable cause instead of "it was feeling odd today".

Sources
  • Gemini sampling parameters (topK/topP) ↗
  • Anthropic Messages API sampling parameters ↗
Use this term in a task

Don’t stop at the definition: use the task handbook for the order and checks, or filter three tool candidates for the job at hand.

Task handbooks → · Filter three candidates →