Skip to content
AI-Arena

Temperature and Sampling Explained

· AI-Arena Editorial

A model doesn’t answer — it picks the next token from a probability list, over and over. Sampling settings decide how it picks. Get them wrong and a strong model looks weak.

Temperature: The Risk Dial

Temperature reshapes the probability list before the pick:

  • Low (0–0.3): nearly always the top choice. Deterministic, repeatable, conservative. Right for extraction, classification, code transforms, RAG answers with citations.
  • Mid (0.4–0.7): mostly top choices with occasional variation. Good default for chat and drafting.
  • High (0.8–1.0+): unlikely tokens get real probability. Creative, surprising, less reliable. Right for brainstorming, naming, fiction.

Two habits: extraction and grading jobs usually want temperature 0-ish — you’re paying for accuracy, not variety. And when a model “keeps making the same mistake,” lower temperature won’t fix a capability gap; it just makes the mistake more consistent.

Top-p: The Cutoff Blade

Top-p (nucleus) sampling keeps only the most likely tokens whose probabilities sum to p — say 0.9 — and discards the tail. It’s a different blade for the same job: temperature smooths the whole list, top-p trims it. Move one at a time. Common stable combos: temp 0.2 / top-p 1.0 for determinism, temp 0.7 / top-p 0.9 for drafting. Cranking both to extremes is how you get either frozen repetition or incoherent word salad.

Max Output Tokens: The Silent Failure

Every model has a max-output ceiling (it’s on every spec sheet). If a generation stops mid-JSON or mid-sentence, the most common cause isn’t the model “refusing” — it’s the ceiling. Budget output tokens before the run: a 4,000-token report cannot fit under a 2,000-token ceiling regardless of quality.

The Settings That Interact

  • Stop sequences: cut generations at markers; useful for structured outputs, but they don’t raise the ceiling.
  • System prompts: not sampling, but they shift the probabilities temperature acts on — retune after prompt rewrites.
  • Providers differ: default temperature and the exact re-roll behavior vary by platform; a “temp 0” on one platform isn’t certified identical on another.

Why Benchmarks Lock These Down

A benchmark row without a harness note can’t tell you the sampling settings — which is why two runs of the same eval can disagree. Providers usually quote scores at their best-known settings. When you re-test a model yourself, fix temperature and top-p first, then compare; otherwise you’re measuring your knobs, not the model.