# Quantizing Decision Models
> Quantization is how large models are made to fit and run fast, and each kind of accelerator wants a different format. Benchmark accuracy can't tell two quantized builds apart. The share of answers that change can. This is how we measure it, what moved it at 8 bits, and why a quantized model disagrees with itself.
- Author: Peter Us (Head of Inference Infrastructure)
- Published: 2026-11-27
- Tags: inference, quantization, evaluation
- Source: https://sference.com/blog/quantizing-decision-models

---

At Sference we serve open-weight models on several kinds of accelerators. Most large open-weight models are served quantized: weights and activations are stored in fewer bits than the model was trained with. It has become the default way to ship a model. NVIDIA publishes its own flagship model as a [4-bit checkpoint](https://developer.nvidia.com/blog/creating-the-nvidia-nemotron-3-ultra-nvfp4-checkpoint-with-nvidia-model-optimizer/), and the Hugging Face Hub lists more than 220,000 [quantized model repositories](https://huggingface.co/models?library=gguf).

![Two panels on the same scale for four builds of Clef against full precision on 31,275 questions. Accuracy changes by -0.01, -0.11, -0.08 and -0.65 points for an unquantized second engine, FP8, int8 and NVFP4, while the share of answers that change is 0.50%, 1.66%, 2.08% and 4.80%.](https://sference.com/blog/quantizing-decision-models/assets/accuracy-vs-answers.svg)

The reason is size and speed. A quantized model takes less memory, and sometimes that is the only way it fits on a card at all. On hardware with fast kernels for the format it also runs faster. For the model in this post, an 8-bit integer build takes roughly half the memory of full precision and runs about 1.45 times as fast on the same card. On another card, moving most layers from 8-bit to 4-bit floats was worth a further 18%.

Each kind of accelerator is fast at different formats, so how a model is quantized depends on the hardware as much as on the model. We evaluate quantized builds for every model we bring up, and each time there are several candidates: which layers get fewer bits, how the values are prepared, how much speed each choice buys. For each of them we have to know how close it is to the original.

For a model that generates text, that is hard to measure directly. You can compare token probabilities or score multiple-choice benchmarks, but those are proxies: what users get is long generated text, where two outputs can differ in wording and both be fine, and one different early token changes everything after it.

For a decision model it can be measured directly. This post walks through how we do that, using one model as the example: [Clef](https://huggingface.co/Cloudflare/clef), Cloudflare's 27B open-weight [decision model](https://blog.cloudflare.com/clef-decision-models). Most of it is about 8-bit integers, with 4-bit floats for contrast. A decision model doesn't generate text. It reads a prompt and returns a probability for each of a few given answers, and customers build logic on those: approve or escalate, route left or right. Every request has one answer and a probability behind it, and both can be compared exactly with what the full-precision model returned. So we score a quantized decision model by whether it gives the answer the full-precision model would have given.

## The hardware picks the format

A format is only worth having if the card has a fast matrix multiply for it, and each card has its own list. For some cards it is very short.

Recent NVIDIA GPUs have kernels for FP8 and for NVFP4, both floating-point formats. There, a profile shows the FP8 layers costing about twice as much GPU time per weight as the NVFP4 ones, so the question is how many layers can go to 4 bits. Some other accelerators have neither. Their only fast low-precision path is an int8 matrix multiply, so there the question is how good int8 can be made.

The three formats in this post differ in more than the number of bits (Hugging Face's [quantization concepts guide](https://huggingface.co/docs/transformers/quantization/concept_guide) has a fuller introduction):

- **int8** has 255 evenly spaced levels and one scale for a whole weight row or a whole token. It is simple and the multiply is exact, but one large value stretches the scale for everything that shares it.
- **[FP8](https://arxiv.org/abs/2209.05433)** is 8-bit floating point. Its levels are dense near zero and sparse further out, so small and large values in the same tensor both keep their relative precision without any help.
- **[NVFP4](https://developer.nvidia.com/blog/introducing-nvfp4-for-efficient-and-accurate-low-precision-inference/)** is 4-bit floating point: 15 distinct values, with a separate scale for every 16 neighbouring values. It takes half the memory of an 8-bit format and is the fastest where the card supports it, but its steps are far coarser.

That's why one model can end up in multiple formats. The format is given by the card. What we decide is which layers get it and how the values are prepared, and that's where candidate builds come from.

## Counting the answers that change

The obvious way to compare candidate builds is to run a benchmark and look at accuracy. For Clef that told us very little: every build we scored was within a few tenths of a point of full precision. The share of answers that changed separated them clearly: it ranged from barely above what two full-precision engines differ by, for the best builds, to 9% for the most aggressive format.

So for every question we compare the quantized build with the full-precision one (BF16) and count a **flip** when the top answer differs. This is an established way to judge compressed models ([Accuracy is Not All You Need](https://arxiv.org/abs/2407.09141) is the usual reference), and for a decision model it's the natural one. We count any change of the top answer, including one between two wrong answers, since it's still a different decision. We also measure how far the answer probabilities moved, which catches a build whose answers hold while its confidence drifts. And we look at how decided full precision was: a flip on a coin-toss question is expected, a flip on a question the model was sure about is not. For the best builds those are under a tenth of a percent.

A flip count needs a noise floor next to it, because full precision disagrees with itself. There is a public [quantization benchmark for Clef](https://arxiv.org/abs/2611.15671) that publishes per-question outputs for several builds, and in it two full-precision engines differ on 0.29% of the six easier tasks and 0.93% of the six harder ones. A build that flips 1% of the hard answers is at the floor, and there is nothing left to measure.

The test set matters as much as the metric:

- **Hard questions.** On easy questions full precision is about 90% accurate and rarely undecided, and builds look alike: on a 4,020-question set from a public intent-classification dataset, an all-4-bit build and a mixed 4-bit and 8-bit one flipped 59 and 60 answers. On 14,063 harder public questions, where full precision is around 70% accurate, flip rates are about three times higher and the same two builds were half a point of accuracy apart.
- **Enough questions.** Flips are rare events, so they need a large sample. A 1% flip rate measured on 1,000 questions is ten flips, and the 95% interval around it runs from roughly 0.5% to 1.8%. On 10,000 questions it narrows to 0.8% to 1.2%. The builds we choose between are often less than a point apart, so a thousand questions can't rank them: the same build flipped 0.81% of the answers on one quarter of the benchmark and 1.25% on the next. We size the test set from the difference we need to see, and confirm the result on a second set that shares nothing with the first.
- **A rule written down first.** With several builds and several metrics, one of them will always look good after the fact. We fix the pass/fail rule before the run, so that we don't overfit on the metric.

## At 8 bits, the activations are the problem

An 8-bit integer has 255 levels. To quantize a set of numbers you divide them by a scale chosen so the largest one lands on the top level, and round the rest to whatever level is nearest. That works well when the numbers are of similar size. It works badly when one of them is much larger than the others: the large one sets the scale, and all the small ones get squeezed into the bottom few levels, where rounding wipes out most of what distinguished them.

A layer multiplies two things, its weights and the activations coming into it, and both get quantized. The weights are the easy half. They are known ahead of time, each row gets its own scale, and within a row the values are of similar size. At 8 bits their rounding error is small.

The activations are the hard half. They depend on the input, so their scale has to be computed at run time, one per token. And they are not of similar size: within a single token, a handful of channels are 12 to 16 times larger than the rest. Those few set the token's scale, and every other channel is left with a few of the 255 levels.

![Illustration of one token's activations, one bar per channel, before and after rounding to int8. Left: with one scale for the whole token, three large channels set the step size and the many small channels round to zero or to the same single level. Right: with the three large channels handled separately and exactly, the step size fits the small channels and they keep their values](https://sference.com/blog/quantizing-decision-models/assets/per-token-outliers.svg)

The standard fix is [SmoothQuant](https://arxiv.org/abs/2211.10438). Ahead of time, it scales down the channels that tend to be large and scales the matching weights up, which leaves the layer's output unchanged and the activations more even. It makes a large difference. On the 4,020-question set, plain int8 flipped 59 answers, 23 of them on questions where full precision was sure. With smoothing that became 21 and 4, from a calibration run of only 100 synthetic prompts.

It can't remove the problem completely, though. Smoothing is fixed per channel, and the channels that are extreme change from token to token.

The usual next step is better weight rounding, with methods like [GPTQ](https://arxiv.org/abs/2210.17323). At 8 bits it changed no answers, which fits the picture above: the weights weren't the half that was hurting. At 4 bits, where there is much more weight error to remove, the same methods do help.

So we split the outliers off at run time. For each token, the few largest channels are carried exactly, the scale is set from the next largest, and the contribution of those few channels is added back after the integer multiply. The weights stay int8. Most current work on these outliers removes them ahead of time, by rotating the activations so no channel stands out ([QuaRot](https://arxiv.org/abs/2404.00456) and the methods that followed it). We handle them where they appear: the set is picked per token, inside the kernel that quantizes the activations. Built from stock tensor operations the split added 85% to a layer's time. As a fused kernel it adds 12%.

![Share of answers that differ from full precision, on the six easier and the six harder benchmark tasks. The noise floor, a second full-precision engine, is 0.29% and 0.93%. int8 with smoothing and outlier split: 0.66% and 2.05%. FP8: 0.94% and 3.17%. int8 with smoothing: 1.22% and 3.88%. A mixed NVFP4 and FP8 build: 1.97% and 6.43%. NVFP4: 2.83% and 8.94%](https://sference.com/blog/quantizing-decision-models/assets/flips-harder-tasks.svg)

The split halves the flips and puts int8 below FP8, the usual 8-bit format on NVIDIA cards, on the easier tasks and the harder ones. It costs about 6% of throughput. A build that mixes the two float formats sits between them.

It also showed that the error of a layer doesn't predict the answers. Tuning that lowered layer error by 30% changed nothing end to end, while the split, which went after the error that mattered, halved the flips.

## Quantization amplifies numerical noise

Every model is a little noisy: the floor above is two full-precision engines disagreeing with each other. What surprised us is how much quantization amplifies that. We took an int8 build and changed something that shouldn't matter: a small floating-point operation, outside the quantized layers, was swapped for a different implementation of the same math. The int8 weights were identical before and after.

In full precision that swap changed 2 answers out of 1,092. In int8 it changed 6, and moved the answer probabilities about five times as far. That is as much as the int8 build differs from full precision in the first place.

The reason is that rounding is a step function. In full precision a difference in the last bits of a float stays small. In a quantized model it decides, for some values, which side of a step they land on, and from there the build carries a different set of rounding errors through the rest of the network. So a large part of a quantized build's distance from full precision isn't a fixed property of the build. It is noise, and any small numeric change draws it again.

This matters in two places.

**Comparing builds.** When two quantized variants differ by a handful of flips, that tells you nothing about which is better. It is why the sample sizes above are as large as they are.

**Batching.** Thinking Machines [showed](https://thinkingmachines.ai/blog/defeating-nondeterminism-in-llm-inference/) that most nondeterminism in LLM serving comes from kernels whose result depends on the shape of the batch. A quantized model takes those last-bit differences and turns some of them into different rounding. So a flip count measured with several requests in flight varies from run to run, for full precision too, and the benchmark's authors report the same when they restart an identical build.

It isn't inherent to quantization, though. The integer multiply is exact, so it can't be the source. The float operations that feed the quantizer are, and those can be made independent of the batch. In one of our int8 setups, the same questions answered alone and with other requests in flight differed on 0.08% of answers, against 0.20% for full precision on the same engine.

For measuring, this means comparing builds one request at a time, or with order and concurrency held fixed.

## In practice

For every model and every kind of card we evaluate, the card decides the format, and we benchmark each candidate against full precision, with the noise floor measured the same way. For a decision model that benchmark can be exact, by counting the answers that change. What's left is a trade between speed and how close the build stays to the original.
