AI CompendiumA public chart of the language
Home / Training & Inference / Non-determinism
Training & Inference

Non-determinism

The same input can produce different output, and that is by design.

Definition

The property that identical requests may yield different results, because generation samples from a probability distribution and, in production, requests are batched across different hardware states.

Even at temperature zero, floating-point arithmetic and batching mean bit-for-bit reproducibility is not guaranteed across runs. Treat outputs as stochastic and evaluate statistically.

Assume that identical requests will differ, and build accordingly: evaluate over multiple samples rather than one, log enough to reproduce the inputs, and never write a test that asserts an exact string from a generative call. Assert on properties instead.

How people use it
A test suite failing intermittently.
"The test asserts an exact string. Nothing about this system promises an exact string. Assert on structure and meaning."
Worked example

The test that fails one run in ten

A regression test compares the model output to a stored golden string.

It will flake, and the team will start ignoring it. Assert on what actually matters: the response parses against the schema, contains the required fields, cites a source, and refuses the input that should be refused. That test is stable and still catches real regressions.

Avoid

Writing tests that assert on exact model output.

Sources
Related terms