Field noteNov 13, 20265 min read1 source

Eliminating Nondeterminism in LLM Inference with Integer-Only Arithmetic

In one minute

DetLLM is an open-source inference pipeline for Qwen3-0.6B that uses integer arithmetic throughout the forward pass. Its author reports identical logits across runs, batch configurations, prefill/decode paths, and several CPU and GPU platforms—a useful demonstration for teams that need reproducible inference, though its scope remains narrow.

What changed: DetLLM introduces integer-only arithmetic aimed at making LLM inference deterministic across devices.

What happened

The DetLLM GitHub repository describes an inference pipeline for Qwen/Qwen3-0.6B in which every operation from input IDs to int32 logits uses integer arithmetic. That includes matrix multiplication, normalization, activation functions, softmax, and rotary embeddings. The project says its aim is determinism, not compression: integer addition and accumulation avoid the order-dependent rounding differences that can arise in floating-point reductions.

The repository identifies the problem as variability in high-performance floating-point kernels. Kernel choice and reduction order can change with batch size, batch composition, whether tokens are processed in prefill or incremental decode, and hardware backend. Small logit changes can sometimes change an argmax and then cascade into a different generated sequence. DetLLM says ordinary deterministic-mode flags address repeatability only under constrained conditions, while batch-invariant floating-point kernels remain platform-specific.

The project reports an end-to-end test across an A100, an H100, CPU systems using AMD EPYC 7J13 and Intel Xeon Platinum 8480+, and an Apple M1 Pro. Its demo generates 512 tokens from the first 64 tokens of Shakespeare’s Sonnet 18 and hashes the int32 logits at every step. The tested variations include batch 1, batch 8 with seven unrelated prompts, split prefill and decode, and a CPU reference implementation. The repository reports one identical int8 logits hash across all nine runs. Its fp16 comparison produces nine different hashes. The repository also describes a case where a near-tie in logits led the M1 Pro and A100 to choose different next tokens.

For quality and speed, the repository reports WikiText2 perplexity of 20.72 for its int8 pipeline and 20.95 for fp16. On an A100, CUDA-graphed integer decode is reported at 3.6 times the fp16 eager baseline for batch 1 and 3.4 times for batch 8, with the listed throughputs of 106 and 783 tokens per second, respectively. The project provides code, tests, a specification, and benchmark results in the repository. To compare another machine, it instructs users to download the same published model artifact and check its SHA-256; artifact preparation is not claimed to be reproducible across machines. No price or hosted service is announced.

What the archive adds

New Runtime's earlier coverage has discussed quantization as a way to reduce model size and hardware requirements, including a note on reducing model size through quantization. That story concerned a different model and task; it does not establish this project’s results. DetLLM is a new event that connects integer arithmetic with cross-device reproducibility, rather than presenting quantization only as compression.

Trend signal

This supports the broad direction in agent economics moves to completed work only weakly: reproducible inference could make task outcomes easier to compare, but the repository does not measure verified task completion or cost per task. The stronger signal is technical determinism, which does not yet fit a pattern New Runtime tracks.

Why it matters

For teams evaluating or deploying models, reproducibility across hardware can make regression tests and incident analysis more meaningful. A bit-identical result would reduce one source of noise when comparing inference backends, batching strategies, or machines. That does not by itself make a model’s output correct, stable under changed weights, or suitable for a particular application; it makes a particular computation easier to reproduce under the same artifact and inputs.

The project is still a single-model implementation, and its quality and speed figures are author-reported. Builders should treat it as an experiment to inspect or reproduce, not as evidence that integer-only inference is ready to replace established serving stacks. Its most immediate value is as a testable design: deterministic behavior can be pursued by constraining the arithmetic itself, rather than relying only on backend settings.

Limits and uncertainty

The repository’s claims have not been independently benchmarked here. Its demonstration covers Qwen3-0.6B and a specific published artifact, not arbitrary models, runtimes, GPUs, or production serving conditions. The reported perplexity comparison is one metric and does not establish equivalent quality across tasks. The throughput figures compare CUDA-graphed integer decode with an fp16 eager baseline, so they do not establish an advantage over optimized production inference. The project does not show adoption or sustained use at larger scales.

Skill to build now

If reproducibility matters to your team, run the repository’s demo with the published artifact on two different supported machines. Confirm that the artifact hash matches before comparing the logits hashes, then repeat with your own prompt and batch composition. Record the backend, hardware, and software versions alongside the result; a matching hash is evidence about that computation, not a general guarantee about other models or deployments.

Reader takeaway

DetLLM demonstrates one route to cross-device bit-level reproducibility: remove floating-point operations from the model’s forward pass. The result is a promising, testable prototype for one small model—not yet a general inference solution or independently validated performance win.

Evidence / sources

  1. 1github.com/nathanrs/detllm
All Field Notes

Next reads

Read next

Open the graph
  1. 01topicInferenceExplore the inference topic hub.
  2. 02archiveField NotesOpen the latest editorial analysis.
  3. 03sourcesSourcesSee the original sources this archive cites.
Who read this page?Machine requests, hidden until opened

Loading the privacy-safe route aggregate...

Open the JSON contract