In 30 Sekunden
Matthew Berman reviews Thinking Machines Lab’s 2025 post on nondeterminism in language-model inference. He explains how changing batch sizes can change floating-point calculations and describes a reported experiment in which batch-invariant kernels produced identical completions under a particular setup.
- 1Sampling versus implementationSampling normally selects from a probability distribution; greedy selection at temperature zero removes this source of intentional randomness but does not guarantee identical calculations.
- 2Batch size affects numerical resultsDifferent batch sizes can change how floating-point reductions are performed, producing small numerical differences that may change a selected token.
- 3Batch-invariant kernelsThe post describes making operations such as normalization, matrix multiplication and attention invariant to batching, with possible performance costs.
- 4One experiment, 1,000 completionsThe reported baseline produced 80 unique completions; with the modified kernels the 1,000 completions were identical in that experiment.
Das Wichtigste
- Random sampling can intentionally vary outputs, while temperature-zero inference can still vary for numerical and implementation reasons.
- Floating-point rounding is not inherently random; changes in the order of operations can change numerical results.
- A request’s batch size may affect the computation even when each fixed-shape operation is repeatable.
- Batch-invariant kernels aim to preserve numerical results across batch sizes, potentially with performance tradeoffs.
- The reported 1,000 identical completions apply to one model, prompt and experimental setup, not all possible deployments.
- Reproducibility helps debugging and auditing, but identical answers are not necessarily accurate or safe.
Den bearbeiteten Text nach Kapiteln lesen
Why reproducibility matters
Berman introduces Thinking Machines Lab’s post and distinguishes repeated responses from deliberate sampling variability. Even temperature-zero generation can vary in practice.
Thinking Machines Lab, founded by former OpenAI CTO Mira Murati, has launched its research blog with a post about nondeterminism in language-model inference. I want to unpack the idea: give a model the same prompt repeatedly, and its responses may differ. That makes reproducing an experiment or debugging a result harder.
Identical responses can be useful for scientific testing and investigation, although variation can be desirable for creative writing. The post separates ordinary sampling from a less obvious problem. Sampling generally selects a token from a probability distribution; choosing the highest-probability token is the greedy, temperature-zero case, not the definition of all sampling.

Even with temperature set to zero, an inference service can produce different answers. A common explanation combines finite-precision floating-point arithmetic with parallel execution. Finite precision means calculations are rounded, and changing the grouping or order of additions can produce different results; rounding itself is not random.
Floating-point operations and batches
He discusses numerical precision, concurrency and the role of changing batch sizes. The post identifies a lack of batch invariance in the inference path.
GPUs perform many calculations in parallel, but concurrency alone does not mean every calculation produces a different answer. The post notes that repeatedly multiplying the same matrices in the same setup can give bitwise-identical results. It argues that this simple observation does not explain what changes when a serving system handles different batches.
Think of a batch as a carpool containing several user requests. The number of requests grouped together can vary with load. A different batch size can lead an implementation to organize its numerical work differently; because floating-point operations have finite precision, the resulting tiny differences can affect a token choice and later output.

Batch-invariant kernels and experiment
Berman uses a kitchen analogy for consistent calculation and reviews the reported Qwen experiment. He closes with possible benefits for debugging and auditing.
The proposed approach is to make the relevant operations batch-invariant: a request should yield the same numerical result regardless of the batch size. I use a kitchen analogy: weigh and mix each bowl consistently even when the kitchen is busy. The underlying implementation addresses operations including normalization and matrix multiplication, not simply keeping processing speed constant.

Attention also involves combining information across prior tokens. If work is divided into different chunks, the order of numerical reductions can change. Consistent methods for those reductions can help preserve the result; the post goes into more technical detail and notes a potential performance tradeoff.

The researchers tested Qwen3-235B-A22B-Instruct-2507 with the prompt asking about Richard Feynman, at temperature zero, generating 1,000 completions of 1,000 tokens each. Without their batch-invariant kernels, they report 80 unique completions, with the most common appearing 78 times. With the kernels enabled, all 1,000 completions were identical in that experiment.
That result is encouraging for reproducibility in the tested configuration, not proof that every model, hardware setup or source of variation has been solved. Repeatable results can make benchmarks, debugging and audits easier to interpret. They do not ensure that a response is correct, safe or trustworthy; those qualities still require separate evaluation.
Mehr aus diesem Kanal
34:21EN
25:50EN
32:20EN
1:03:37EN
0:53EN
0:22EN