Mechanism · Cryptographic & computational
Deterministic and bit-exact inference
Making model inference reproducible bit for bit, so that a verifier's re-run must match the provider's output exactly rather than approximately.
Also called Bit-exact inference; Batch-invariant inference; Reproducible inference
Summary
Re-running the same AI model on the same input often gives slightly different numbers. Floating-point results depend on the order of operations, which shifts with batch size, hardware and software. This noise forces recomputation checks to accept approximate matches, which a cheating provider could exploit. Deterministic inference removes the noise in one of two ways: kernels whose results do not depend on batch size, or recording enough about the hardware and software for a verifier to reproduce every rounding error. vLLM and SGLang offer batch-invariant or deterministic modes, and a published software emulator predicts, bit for bit, the outputs of dense transformer blocks on four NVIDIA GPU models. The obstacles are the throughput cost of batch-invariant kernels, gaps in the emulator's coverage (mixture-of-experts models, one proprietary kernel family, non-NVIDIA GPUs), no independent security evaluation, and the provider's need to disclose its full configuration.
R2: public code reproduces dense LLM blocks bit for bit on realistic GPUs against a stated adversary, but no third party relies on exact replay and no independent evaluation exists.
Rubric assessment
- R1 met: the verification claim, a covert-adversary threat model and the information a verifier needs are published 1.
- R2 met: public code predicts dense LLM blocks bit for bit on A100, L40, L40S and H100 GPUs running unmodified vLLM and Hugging Face engines, against a stated adversary 1. Batch-invariant modes are public in vLLM (beta) and SGLang 12 11, and batch invariance was shown on a 235-billion-parameter model 8. Exact CPU reproduction of GPU matrix multiplication is peer-reviewed 9. The only Implementation record for this mechanism, Low-trust AI compute verification system overview, is a proposed architecture assessed R1, so the level rests on these systems directly.
- R3 not met: determinism modes are available in production engines, and one model developer reports using end-to-end deterministic kernels 10, but no party other than a developer is documented relying on exact replay for a verification decision. As of September 2026 no independent audit, red-team or peer-reviewed security analysis of bit-exact verification has been published.
Confidence is medium because the verification-specific evidence is one single-author preprint covering dense model blocks.
- Reliance by a party other than the developer on exact-match recomputation for a verification decision, or a production-grade verification stack built on it.
- An independent public evaluation (audit, red-team or peer-reviewed security analysis) of bit-exact verification.
How it works
Floating-point arithmetic is not associative, so the same sum computed in a different order can round differently 5 8. In LLM serving, the order changes with 4:
- batch size and kernel strategy, which depend on server load;
- GPU type, CUDA version and kernel implementations;
- in mixture-of-experts models, routing that depends on other tokens in the batch.
Thinking Machines Lab argues that the main reason inference endpoints are nondeterministic is that load, and so batch size, varies while kernels are not batch-invariant 8. The bit-exact work separates true nondeterminism, caused by atomic functions, from non-invariance: deterministic computation that follows different reduction trees 1.
There are two routes to exact results:
- Invariant kernels. Kernels fix the reduction order for each output element whatever the batch size 8. vLLM offers a batch-invariant mode, currently in beta 12, and SGLang offers a deterministic inference mode 11. DeepSeek reports end-to-end bitwise batch-invariant and deterministic kernels, built with the goal of bitwise alignment among its pre-training, post-training and inference pipelines 10. LLM-42 enforces determinism through scheduling, replaying candidate tokens under a fixed reduction schedule instead of rewriting kernels 13.
- Record and replay. Stock engines already give deterministic outputs that a verifier can reproduce bit for bit, if the verifier knows the key factors and no atomic functions are called 1. The factors are the hardware model, exact weights, parallelism layout, software versions and the batch size of each forward pass 3 1. Software emulation removes the need for identical hardware 1, and Hawkeye re-executes GPU matrix multiplications on a CPU without precision loss 9.
For verification, exactness turns a recomputation check (Sampled inference recomputation) into a pass/fail test 1. Zero-knowledge proofs of inference need determinism as a precondition 1, and packet-based schemes (Reproducible computation packets) need workloads to be reproducible 6.
What it establishes
Under exact replay, the accumulated rounding errors become an auditable signature of the software and hardware used 1. The bit-exact work names three attacks that exploit the tolerance of approximate checks: steganography, unreported changes to inference software, and covert computation in unreported batch elements 1. It argues that statistical schemes can bound the covert bandwidth these leave, but cannot close it 1.
Determinism does not capture traffic or choose samples; those come from recording and sampling mechanisms such as Network taps and certifiers and Sampled inference recomputation 2 6. Batch-invariant kernels give identical results only while the model, inference implementation and device stay fixed 4. For varied inference stacks and mixed GPU types, DiFR's authors expect statistical verification to remain necessary 4.
Threat model
- Adversary. The bit-exact work targets covert adversaries, who comply with monitoring only when the chance of detection is high 1.
- Full disclosure. Exact replay assumes the verifier learns every factor that affects the numerics 1. A reference architecture for low-trust verification lists the same replay metadata 3. Recording the batch size is described as negligible overhead for the prover 1.
- No atomic functions. Backends must avoid atomic functions 1.
- Correct hardware model. Cross-hardware emulation assumes the hardware's rounding, subnormal handling and accumulation order have been characterized correctly 9 1.
Evidence
- Nondeterminism measured. For 1,000 temperature-0 completions of one prompt on Qwen3-235B-A22B, Thinking Machines reports 80 unique outputs with default kernels 8. With batch-invariant kernels, all 1,000 were identical 8.
- Bit-exact emulation. On Qwen3 4B blocks, the emulator reports zero BF16 differences for feed-forward blocks on A100, L40, L40S and H100 GPUs 1. It reports zero differences out of 71 million elements for FlashAttention-2 at 4,000 tokens 1. The paper received a best-paper award at the ICML 2026 TAIGR workshop, and its code is public 1.
- Matrix multiplication on CPU. Hawkeye, peer-reviewed at MLSys 2026, reports 100% success replicating 4096 × 4096 matrix multiplications on Ampere, Hopper and Lovelace GPUs 9.
- Engines. vLLM documents its batch-invariant mode 12. SGLang reports an average slowdown of 34.35% for its deterministic mode on FlashInfer and FlashAttention 3 backends 11.
- Without determinism. In DiFR's tests with synchronized seeds, over 98% of tokens already match exactly between provider and verifier 4.
Limitations
- Throughput. In Thinking Machines' test on Qwen3-8B, vLLM's default took 26 s, the unoptimized deterministic build 55 s, and the build with an improved attention kernel 42 s 8.
- Coverage. The emulator does not yet cover mixture-of-experts inference, non-NVIDIA GPUs, the proprietary nvjet kernel family on Hopper, or training 1. Hawkeye covers matrix multiplication only; attention and convolutions need further reverse engineering 9. As of its September 2025 post, SGLang supported deterministic inference only for dense models, and only with tensor parallelism across one or two GPUs 11.
- Residual nondeterminism. Some integer de-quantization kernels use atomic additions and remain truly nondeterministic 1.
- Disclosure. Replay requires exact weights and configuration details 1.
- Maturity. Amodo rates a reproducible inference stack for verification as not started, and red-teaming of recomputation schemes as not started 7.
Known flaws
Published flaws, with their severity, kind and status. How flaws are rated.
Some kernels remain genuinely nondeterministic
The bit-exact work separates kernels that are deterministic but not batch-invariant from truly nondeterministic ones that use atomic functions. Some integer de-quantization kernels use atomic additions and remain nondeterministic, so exact replay needs backends that avoid them 1.
Cross-hardware replay relies on reverse-engineered, closed behaviour
Emulating one GPU's rounding on another requires reverse-engineering tensor-core arithmetic and modelling proprietary kernel choices. Hawkeye covers a subset of NVIDIA architectures and states that attention and other higher-level operations need further reverse engineering 9. For the bit-exact emulator, a proprietary Hopper kernel family is an open edge case 1.
Blockers
Batch-invariant kernels cost throughput: in Thinking Machines' Qwen3-8B test, an improved deterministic build took 42 s against 26 s for vLLM's default, and SGLang reports an average 34.35% slowdown on its FlashInfer and FlashAttention 3 backends.
Coverage is incomplete: the bit-exact emulator targets dense blocks on NVIDIA GPUs and excludes mixture-of-experts inference and training; SGLang's deterministic mode supported dense models and one- or two-GPU tensor parallelism as of September 2025.
A reproducible inference stack for verification has not been built; Amodo rates it 'not started'.
Exact replay requires the prover to disclose weights, software versions, parallelism and batch sizes to whoever recomputes.
Technical detail
Show technical detail
Two routes lead to exact results.
- Invariance. Kernels fix the reduction order for each output element regardless of batch size. Thinking Machines made RMSNorm, matrix multiplication and attention batch-invariant, the last with a fixed split size for the key-value dimension rather than a fixed number of splits 8. vLLM exposes this behind VLLM_BATCH_INVARIANT=1 on NVIDIA GPUs of compute capability 8.0 or higher, in beta 12. SGLang integrated batch-invariant attention for its FlashInfer, FlashAttention 3 and Triton backends 11. LLM-42 instead decodes on a non-deterministic fast path and replays candidate tokens under a fixed-shape reduction schedule, rolling back any that are inconsistent 13.
- Record and replay. Stock engines are deterministic but not invariant. Outputs are bitwise reproducible if the verifier knows the hardware model, the exact deployed weights, the parallelism topology (separately for prefill and decode), software versions including custom kernels, and the batch size of each forward pass 3 1. Of these, only batch size changes during serving, and it costs one extra integer per forward pass to record 1. A software emulator reproduces the rounding of other GPU models by modelling tensor-core accumulation and kernel-specific reduction trees 1. Hawkeye reproduces tensor-core matrix multiplication exactly on a CPU for Ampere, Hopper and Ada Lovelace GPUs in FP16, BF16 and FP8 9.
With exact replay, verification is pass/fail, and the chance of catching at least one false output in k samples is 1 − (1 − p)^k for a false-output rate p 1.
Sources
- BN. Cankaya (2026). Bit-Exact AI Inference Verification Without Performance Tradeoffs. ICML 2026 Workshop on Technical AI Governance Research. Source recordSupports: covert-adversary threat model; deterministic but non-invariant engines; required metadata; software emulator and its results; limitations; comparison with statistical schemes; best-paper award and public code (arXiv comments) · abstract; §1; results; limitations section; arXiv comments
- BR. Rinberg et al. (2025). Verifying LLM Inference to Detect Model Weight Exfiltration. arXiv. Source recordSupports: logging of inferences and random sampling for verification as components separate from recomputation · §5
- BN. Cankaya (2026). A System Overview for Near-Term, Low-Trust AI Compute Verification. Machine Intelligence Research Institute. Source recordSupports: replay metadata in a low-trust verification system · §5.2.2
- BA. Karvonen et al. (2025). DiFR: Inference Verification Despite Nondeterminism. arXiv. Source recordSupports: sources of benign nondeterminism; fixed-hardware determinism vs heterogeneous deployments; >98% token agreement · §2; §3; §7
- CAmodo Design (2026). Example Schemes for Verifying High-Stakes AI Agreements. Amodo Design. Source recordSupports: floating-point non-associativity; fuzzy comparison in recomputation schemes · determinism discussion
- CR. Dean (2026). Verification Plan. AI 2040. Source recordSupports: reproducibility required for packet correctness checks · Concrete inference-only retrofitting proposal
- CAmodo Design (2026). AI 2040 Plan A — Verification SITREP. Amodo Design. Source recordSupports: status of reproducible inference stack · status items
- CH. He & Thinking Machines Lab (2025). Defeating Nondeterminism in LLM Inference. Thinking Machines Lab: Connectionism. Source recordSupports: batch invariance as main cause; kernels made invariant; Qwen3-235B experiment; timings · whole post
- AE. Badash et al. (2026). Hawkeye: Reproducing GPU-Level Non-Determinism. Proceedings of Machine Learning and Systems 8 (MLSys 2026). Source recordSupports: exact CPU reproduction of tensor-core matrix multiplication; scope limits · abstract; §8; §9
- BDeepSeek-AI (2026). DeepSeek-V4: Towards Highly Efficient Million-Token Context Intelligence. arXiv. Source recordSupports: provider-reported end-to-end batch-invariant and deterministic kernels · §3.3
- CThe SGLang Team (2025). Towards Deterministic Inference in SGLang and Reproducible RL Training. LMSYS Org blog. Source recordSupports: SGLang deterministic mode, overhead and limitations · whole post
- BvLLM project (2026). Batch Invariance (vLLM documentation). vLLM documentation (GitHub, docs/features/batch_invariance.md). Source recordSupports: vLLM batch-invariance flag, hardware requirement, beta status · whole page
- BR. Gond et al. (2026). LLM-42: Enabling Determinism in LLM Inference with Verified Speculation. arXiv. Source recordSupports: scheduling-based determinism alternative · abstract