Defeating Nondeterminism in LLM Inference

AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story.

Why it matters

Teams needing reproducible LLM outputs can now use batch-invariant kernels instead of blaming seeds or floats; but it costs performance, so most won't switch yet.

Read this as

LLMs often give different answers to the same question even when a fixed 'seed' (a setting meant to lock randomness) is used. A new paper from Thinking Machines, the AI lab started by Mira Murati in February 2025, says the real cause is that servers handle varying numbers of requests at once, changing the math. The popular 'floating point' explanation turns out to be mostly wrong. The lab released code that makes a model called Qwen3-8B answer identically every time.

Thinking Machines, the lab founded by former OpenAI CTO Mira Murati, published its first public research explaining why LLM APIs produce different answers to identical prompts. The cause is varying server batch sizes, not floating-point math as widely assumed. The accompanying open-source PyTorch code runs Qwen3-8B deterministically under vLLM. This matters for anyone needing reproducible AI outputs in testing, compliance or enterprise workflows.

Thinking Machines' paper rejects the 'concurrency + floating point' hypothesis: a typical LLM forward pass contains no single atomic add, so non-associative floating point plus racing cores is not the culprit. The actual cause of nondeterminism is that server load makes batch sizes vary unpredictably, on GPUs, CPUs and TPUs alike. The accompanying thinking-machines-lab/batch_invariant_ops repo implements batch-invariant kernels in PyTorch and demonstrates deterministic Qwen3-8B inference under vLLM. No performance or throughput cost figures are given.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

Thinking Machines Mira Murati OpenAI Qwen3-8B vLLM PyTorch Hacker News

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading