Myth, busted · T5 Evals & reliability

Batch invariance (why temperature 0 isn’t deterministic)

Last reviewed 3 Nov 2026by Pratima Chainani

An inference server is batch-invariant when a request gets bit-identical results no matter which other requests share its batch. Without it, temperature 0 removes sampling randomness but not numerical differences, so identical requests can still return different outputs.

Temperature 0 means the model always picks the most likely next token. That removes sampling, the randomness people usually blame. It does not fix the numbers that decide which token is most likely. Floating-point addition is not associative: add the same values in a different order and the last bits change. When two tokens are close, those bits can flip the choice, and from there the whole answer diverges.

The order changes with the batch. Servers pack concurrent requests together and pick kernels by batch size and sequence shape, so the same request can take a different code path depending on who else arrived at the same moment.

An SGLang pull request opened on 30 October 2026 measured it. Fifty identical requests came back as two to seven different outputs. Even with the server’s deterministic mode on, only 10 of 1,275 responses had bit-identical log-probabilities. The cause: from 8 requests in a batch, packed decode “switches to a row-streaming kernel … which rounds differently from the Triton kernel”, and a short sequence alone takes the fused path while inside a batch it takes the unfused one.

The proposed fix makes that attention kernel batch-invariant. On the PR’s setup it matched 1,275 of 1,275, and 9 of 9 long prompts, at a cost of about 0.5–0.8% throughput within deterministic mode. By our arithmetic from the same PR, deterministic mode itself ran roughly 18–45% below normal-mode throughput. The fix is open, not merged, and was tested on one AMD MI350X setup with one model; a tensor-parallel prefix test still varied.

The misread is common because temperature 0 sounds like a switch for determinism. A day before the PR, an eval plan on GitHub said “With temperature 0 the runs are almost deterministic” and cut three runs per case to one.

Common misread

Temperature 0 makes evals deterministic, so one run per case is enough.

Batching changes the floating-point order. Identical requests can still flip.

For your code

Keep repeat runs per eval case and report which cases flip. If you need reproducibility, use the server’s deterministic mode and check it is batch-invariant on your model and hardware.

For your roadmap

Budget for repeat runs in eval cost, and treat a single-run score change smaller than the observed flip rate as noise.

Sources

  1. sgl-project/sglang PR #47413, “[Fix] deterministic: Batch-invariant Kimi Delta Attention” (open) · 30 Oct 2026
  2. pparitoshh/alembic PR #131, eval plan (“almost deterministic”) · 29 Oct 2026
  3. JakeATX/llamAmpere issue #62, temperature-0 drift between model files · 29 Oct 2026

More on T5 Evals & reliability

Every term, by layer