The same language model, with the same weights and greedy decoding, can produce different text on different GPUs, with different batch sizes, or with a different number of GPUs sharing the model. The cause is ordinary rounding. Floating-point addition gives slightly different answers depending on the order in which numbers are added, and parallel hardware changes that order from run to run. Current fixes pay heavily for determinism. They either force a fixed summation order with custom kernels, which is slow, or they do the arithmetic in 32-bit floats, which costs memory and compute. Integer addition has no such problem: it is exact, so the order does not matter. Quantized models already store weights, and sometimes activations, as small integers. This proposal asks whether quantization, usually treated only as a source of accuracy loss, can instead be engineered into a cheap source of determinism. The idea is to keep every large reduction in exact integer arithmetic, across hardware tiles and across GPUs, and to convert back to floating point only once.
In two sentences: most of an LLM's non-determinism comes from order-dependent floating-point sums inside matrix multiplies and cross-GPU reductions, and those sums become order-independent if they are carried out in wide integers. We build quantized inference kernels that do exactly this, including a variant with power-of-two block scales that keeps 4-bit accuracy workable. We then test whether they give bit-identical outputs across batch sizes, GPU types and parallelism layouts at close to native quantized speed.
Core Claim
Integer multiply-accumulate is associative. Suppose weights and activations are integers and each output's scale factors are shared across the whole reduction, as with per-output-channel weight scales and per-token activation scales. Then the matrix-multiply result is identical however the hardware tiles, splits or schedules the sum. The same holds for the tensor-parallel all-reduce, provided the ranks exchange integer partial sums instead of dequantized 16-bit values.
For group-wise 4-bit schemes, each group of $g$ elements has its own scale, and that normally breaks exactness. The fix is to restrict scales to powers of two, as microscaling formats already do. Write the output as $y=\sum_j 2^{e_j} S_j$, where $S_j$ is the exact integer dot product for group $j$ and $e_j$ is that group's shared exponent. This value can be computed exactly by shifting each $S_j$ to the minimum exponent $e_{\min}$ and summing in a 64-bit integer accumulator:
$$y = 2^{e_{\min}} \sum_j \left(S_j \ll (e_j - e_{\min})\right).$$
The single floating-point rounding happens only when this final integer is converted. What remains order-sensitive is small. It consists of softmax normalization, RMSNorm, and the split of attention over the key/value sequence. These are per-row operations that can be pinned to a fixed order at low cost, because they are not the throughput-dominant matrix multiplies.
What would be new is determinism as a property of the number format itself, rather than of a slowed-down schedule. The comparison is with Deterministic Inference across Tensor Parallel Sizes That Eliminates Training-Inference Mismatch. That paper forces a fixed binary-tree order in 16-bit GEMMs and all-reduces, reports 22–63% latency overhead, and explicitly names extension to INT8/FP8 as its next step. Our approach does not fix an order at all. It makes order irrelevant.
Motivation and Constraints from Prior Work
Three papers establish the gap. Understanding and Mitigating Numerical Sources of Nondeterminism in LLM Inference shows that greedy outputs of reasoning models diverge across 12 GPU/batch configurations. It traces the problem to BF16's short mantissa and to small margins between the top-1 and top-2 tokens. Its fix, LayerCast, upcasts to FP32 for the math. It never examines sub-16-bit formats. When LLMs get significantly worse finds that moving an unquantized model from H100 to A100 flips 1.3% to 2.8% of answers. It also shows that INT4 (w4a16) quantization is a statistically significant degradation while FP8 is not, but it leaves open whether quantization amplifies hardware jitter. A Paired Testing Protocol for Batch-Conditioned Refusal Robustness in LLM Serving shows batch composition alone can flip safety refusals. Enabling vLLM's batch-invariant mode removed all 22 observed flips, on 16-bit models only.
Two findings constrain the design. First, the ultra-low-bit literature shows that sub-4-bit models keep their fluency but lose multi-step reasoning (Evaluating Quantized Large Language Models). That fact cuts both ways. It suggests quantized models have narrower token margins and so may flip more under float jitter, which strengthens the case. It also caps how aggressive our exact formats can be, so we target W8A8 and 4-bit weight groups, not 2-bit. Second, Benchmarking Post-Training Quantization of Large Language Models under Microscaling Floating Point Formats finds MXFP8 lossless and MXFP4 lossy. It also finds that rotation methods such as QuaRot and SpinQuant can fall below round-to-nearest under MXFP4, and it points to block scales as the main bottleneck. Our power-of-two-scale integer variant (MXINT-style elements with shared exponents) is therefore a genuine accuracy risk. We measure that risk directly rather than assume it away.
For measurement we reuse methods from two papers. Total Variation Distance Estimation in Autoregressive Models supplies a bounded engine-discrepancy metric, which is how we separate distribution shift caused by quantization from shift caused by reordering. The paired McNemar test of Kübler et al. supplies the accuracy comparison. The underlying mechanism, rounding error compounding through layers until a decision flips, is documented by Schlögl et al. and Shanmugavelu et al..
Research Program
The work has three parts.
Part 1: kernels. We build three kernel families in Triton on NVIDIA INT8 tensor cores (A100, L40S, H100-class):
- W8A8 with per-channel and per-token scales and INT32 accumulation.
- W4A8 with power-of-two group scales and a shift-and-add INT64 epilogue.
- An integer tensor-parallel all-reduce that exchanges integer partial sums before dequantization.
Around these we build a fixed-order path for softmax, RMSNorm and split-KV attention. The integer all-reduce carries 32- or 64-bit words instead of 16-bit ones. That doubles or quadruples communication bytes, and we report this cost honestly. We also bound overflow analytically, since INT8 products summed over typical hidden sizes stay well inside INT32. For the shifted group sums we clamp the exponent spread and count how often clamping triggers.
Part 2: the interaction study. We measure how conventional quantized kernels behave under hardware variation. These are float-accumulating kernels such as w4a16 dequantize-then-FP16, and MXFP4. For each we record flip rates and logit-margin distributions relative to BF16. This tests whether quantization amplifies non-determinism by shrinking margins.
Part 3: the settings where bit-exactness matters. We rerun the GRPO training-versus-rollout mismatch experiment and the batch-conditioned refusal protocol with the exact-sum models.
Baselines
Do nothing. The naive reference is stock vLLM serving in BF16, plus stock float-accumulating quantized kernels at the same bit-widths, all under default cuBLAS/NCCL. It sets the flip rate, unique-output count and throughput that everything else is measured against. On GSM8K RL, the TBIK paper reports vanilla BF16 Pass@1 of 0.60.
The strongest existing method: Tree-Based Invariant Kernels. These are the Triton GEMM and all-reduce kernels from Deterministic Inference across Tensor Parallel Sizes. They are the strongest competitor because they achieve true bit-exactness across tensor-parallel sizes, cutting 12 configurations to 1 unique output with zero rollout/training probability divergence. That paper reports GSM8K RL Pass@1 of 0.73, against 0.68 for batch-invariant operations and 0.60 for BF16. We run it on the same models (Qwen3-8B, Llama-3.1-8B), the same 12 configurations, the same GPUs and the same RL recipe and step budget. Our method beats it if it (a) also reaches one unique output across all configurations, and (b) has lower end-to-end latency than TBIK's reported 22–63% overhead band. For W8A8 the target is within roughly 10% of an ordinary nondeterministic INT8 kernel. It must also (c) match or exceed 0.73 Pass@1 in RL, or show no significant McNemar degradation against TBIK-BF16 on AIME24, AMC23 and GSM8K.
The deployable alternatives. These are LayerCast from Yuan et al., which reports 0% accuracy variance and 34% memory savings versus FP32, and vLLM's batch-invariant mode as used by Kadadekar. Both are run under identical serving loads and prompt sets.
Ablation isolating the key ingredient. We keep the quantized weights, the kernel structure and the fixed-order softmax and normalization identical, and change only the accumulation. One arm dequantizes and accumulates in FP32; the other accumulates exactly in integers. A second ablation keeps integer GEMMs but uses a float all-reduce, which isolates the cross-GPU contribution.
Why not just…?
Why not just use batch-invariant operations or TBIK on the 16-bit model? These are real competitors. If vLLM's batch-invariant mode turns out cheap and also covers tensor-parallel changes, our advantage shrinks to whatever speed and memory quantization itself provides. Evidence so far suggests a gap. Batch-invariant operations reached 0.68 against TBIK's 0.73 in RL, which implies residual mismatch across tensor-parallel sizes. TBIK closes that mismatch but costs 22–63% latency. The head-to-head latency and unique-output measurements settle this directly.
Why not just accumulate the quantized model in FP32, as LayerCast does? Wider accumulators shrink rounding error but do not make addition associative. Across tensor-parallel layouts and reduction trees, outputs can still differ in their last bits, and a single greedy token flip is enough to change a long reasoning trace. The accumulation ablation measures exactly how much residual non-determinism FP32 accumulation leaves in quantized models. If it is zero in practice across all 12 configurations, the simpler method wins on the matrix multiplies and we will say so.
Why not just accept the flips, since Kübler et al. show they are statistically harmless? For aggregate accuracy they often are. But bit-exactness is a hard requirement in some settings. The RL rollout/training mismatch is one. Neural entropy coding, where sender and receiver must compute identical probabilities, is another (Synchronizing Probabilities in Model-Driven Lossless Compression). Verification-to-deployment soundness is a third (No Soundness in the Real World). In these settings a harmless 2% flip rate is still a failure.
Why not just use native MXFP4 hardware? MXFP4 elements are floats, so summing them is non-associative. It is also lossy under common post-training quantization methods, per Zhang et al. If our MXINT-style variant loses more accuracy than MXFP4, the 4-bit exact path is not worth it. In that case we fall back to the W8A8 exact path, which is expected to be near-lossless since MXFP8 and FP8 are.
Proposed Experiments
We use Qwen3-8B, Llama-3.1-8B and DeepSeek-R1-Distill-Qwen-7B. They are evaluated on AIME24, AMC23, GSM8K and MMLU-Pro, plus Kadadekar's advbench_refusal and arc_challenge controls, across the 12-configuration grid of 2 GPU types, 2 tensor-parallel sizes and 3 batch sizes.
Determinism metrics:
- Count of unique outputs.
- Fraction of bitwise-identical logits.
- Paired flip rate.
- TV distance between configurations, via the Price et al. estimator. Their only reported engine-to-engine figure is 0.586 over 500 tokens between vLLM and SGLang serving Qwen3-0.6B; we report the analogous quantity at 8B scale.
Accuracy metrics: one-sided McNemar tests against BF16.
Cost metrics: tokens per second, time to first token, and communication bytes.
Decisive checks. The first is whether exact-sum W8A8 yields exactly one unique output across all 12 configurations while running measurably faster than TBIK. If not, the core claim fails. The second is whether float-accumulating quantized kernels show higher flip rates than BF16, with flips concentrated at small top-1/top-2 margins. That would confirm the amplification hypothesis and show that determinism matters more for quantized deployment, not less. The third is whether the power-of-two-group 4-bit variant passes McNemar against the best MXFP4 post-training quantization configuration. The last is whether GRPO training with exact-sum rollouts matches TBIK's 0.73 GSM8K Pass@1.
References
- Deterministic Inference across Tensor Parallel Sizes That Eliminates Training-Inference Mismatch
- Understanding and Mitigating Numerical Sources of Nondeterminism in LLM Inference
- When LLMs get significantly worse: A statistical approach to detect model degradations
- A Paired Testing Protocol for Batch-Conditioned Refusal Robustness in LLM Serving
- Evaluating Quantized Large Language Models
- Benchmarking Post-Training Quantization of Large Language Models under Microscaling Floating Point Formats
- QuaRot: Outlier-Free 4-Bit Inference in Rotated LLMs
- SpinQuant: LLM Quantization with Learned Rotations
- Total Variation Distance Estimation in Autoregressive Models
- Causes and Effects of Unanticipated Numerical Deviations in Neural Network Inference Frameworks
- Robustness of Deep Learning Classification to Adversarial Input on GPUs: Asynchronous Parallel Accumulation Is a Source of Vulnerability
- Synchronizing Probabilities in Model-Driven Lossless Compression
- No Soundness in the Real World: On the Challenges of the Verification of Deployed Neural Networks