Inference, Serving & Production·Question 11 of 76Basic

We set temperature to 0, so outputs should be deterministic. Why do users still get different answers to the same prompt?

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

Temperature 0 makes the sampling step deterministic (take the argmax), but it does not make the logits bit-identical between runs. Once two candidate tokens are close in probability, a last-bit difference flips the argmax, and the continuation diverges from there.

Full worked answer

Temperature 0 makes the sampling step deterministic (take the argmax), but it does not make the logits bit-identical between runs. Once two candidate tokens are close in probability, a last-bit difference flips the argmax, and the continuation diverges from there.

Where the non-determinism comes from:

  • Kernels are not batch-invariant. Floating point addition is not associative, so the order of reductions changes the result in the last bits. Matmul and attention kernels pick split strategies and reduction orders based on the shape of the batch. Under continuous batching, your request is batched with different neighbours every time, and batch composition depends on other users' traffic. That is the dominant cause.
  • MoE routing can depend on batch composition when implementations use per-expert capacity limits.
  • Fleet heterogeneity: different GPU generations, kernel or driver versions, tensor-parallel degree, or quantization all change numerics. Providers also roll model snapshots underneath you.

What helps: a seed parameter removes sampling randomness only, so it is necessary but not sufficient. Providers expose a backend fingerprint precisely because they cannot promise more than best effort. True bitwise reproducibility needs batch-invariant kernels (fix the reduction order regardless of batch shape) plus a pinned model version, hardware type, and parallelism config, and you pay throughput for it.

The practical stance: do not build systems that depend on exact token equality. Test on semantics (schema validity, evals with tolerance, property checks), not string comparison. Log outputs, because you cannot reliably regenerate them.

The misconception to kill: "greedy means deterministic." Greedy is deterministic given identical logits. The logits are the problem.

What a good answer covers

  • Temperature 0 makes the sampling step deterministic (take the argmax), but it does not make the logits…
  • Kernels are not batch-invariant
  • MoE routing can depend on batch composition when implementations use per-expert capacity limits
  • Fleet heterogeneity: different GPU generations, kernel or driver versions, tensor-parallel degree, or…
  • What helps: a seed parameter removes sampling randomness only, so it is necessary but not sufficient

Key terms: Kernels are not batch-invariant · MoE routing · Fleet heterogeneity

Interviewer follow-ups to expect

  1. Why does a busier server make divergence more likely?

  2. How would you write a regression test for an LLM feature that cannot rely on exact output matching?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep