Zero Labs
Industry News / AI

Quantization Is Four Decisions, Not One

Source · Towards AI By Satsawat Natakarnkitkul (Net)

From the publisher’s feed, collected in the ZeroLabs newsroom.

FP8, INT4 and NVFP4 are only one of them. The accuracy penalties people quote are often not in the source at all.The serving stack with the memory and precision layer lit.Part four of seven. Same layer as the KV cache, for the same reason: both are about bytes.Part 1: Start Here: The Words Everyone Uses About LLM InferencePart 2: Your KV Cache Is Bigger Than Your ModelPart 3: What a Kernel Is, and Why Everyone Is Writing New OnesParts one and two both ended in the same place: you are limited by how many bytes you move, and the cache is eating your capacity. Quantization is the obvious response. Store the numbers in fewer bits, move fewer bytes, fit more conversations. It does work.The same eight numbers before and after. The move each one makes is the whole cost. The largest weight sets the spacing, which is why one freak value makes every other weight worse.It is also barely specified, and two people in the same conversation often mean different things by it. “Just quantize it” is roughly as useful as “just cache it.” Four things make it specific: the notation, the format, the evaluation, and the capacity it buys.First, read the notationQuantization gets written as WA, for weights and activations. Weights are the model’s learned parameters, the fixed numbers from part one. Activations are the intermediate values that flow through as it computes: the working, rather than the model.W4A16 means 4-bit weights, 16-bit activations. W8A8 means both at 8. That distinction matters more than the headline number, because the two do different things.W4A16 cuts what you fetch. Weights are a quarter the size, so you drag a quarter as much through memory. Given part one, that is exactly the right medicine for memory-bound decode. But the multiply still happens at 16 bits after an unpacking step, so you get no speed up from the hardware itself. There is less to carry, which is most of what you wanted.W8A8 and W4A4 run on faster silicon. Modern GPUs have dedicated paths for low-precision arithmetic. At 8 bits the same multiplications complete roughly twice as fast, and faster still at 4 bits on cards that have four-bit tensor cores. Both figures are peak math rate, which you only collect when you are compute-bound. The method names you will meet come from the same split. GPTQ and AWQ are weight-only, the pair you run for W4A16. SmoothQuant makes W8A8 work by scaling activations down and weights up so that no single outsized channel sets the scale for every ordinary value beside it.This is why “INT4 is 2.7× faster” and “INT4 barely helped” both turn up in the same forum thread, and both are honest. At small batch, memory-bound, cutting fetch is a large win. At large batch it does much less.Always ask which operand was quantized, and at what batch size the number was taken.The formats8-bit floating point (FP8) is the current default-safe choice, and recent hardware supports it natively. The paper this article leans on calls it effectively lossless across every model size it tested, and its 0.4-point drop on MMLU-Pro does not separate from BF16. Unresolved in your favour is not the same as free, but it is the only row below with published evidence behind it.Four-bit, and why there are two of them. Both NVFP4 and MXFP4 store 4-bit numbers with a shared scale factor covering a block of them. The block and the scale are what differ:MXFP4 uses blocks of 32 values and a scale that can only be a power of two. NVFP4 uses blocks of 16, and its scale can carry a fraction.Halving the block means the scale tracks the local range twice as closely, and a scale that can carry a fraction does not have to throw levels away rounding up to the next power of two. It is also not the same bitrate. The scale is one byte either way. MXFP4 spreads that byte over 32 values, which is 4 + (8/32) = 4.25 bits per value. NVFP4 spreads it over 16, which is 4 + (8/16) = 4.5. That gap is the whole comparison:Two rows of four-bit cells, 32 against 16, each followed by one shared scale byte, with the resulting bits per value on the right. The only difference in bitrate is where the scale byte falls, and the 5.9% is that byte amortized over sixteen values instead of thirty-two. The second difference, what that byte is allowed to hold, is in the next paragraph.So NVFP4 costs 5.9% more storage, and what that buys is the halved block. The fractional scale is free: the scale is one byte in either format, and only MXFP4 is required to round it to a power of two. The four-bit values are E2M1, a tiny float whose magnitudes run 0, 0.5, 1, 1.5, 2, 3, 4 and 6, spaced finely at the bottom and coarsely at the top. The scale is the block’s largest value divided by that 6, so a block topping out at 1.05 wants a scale of 0.175. MXFP4’s scale has to be a power of two, so it gets 0.25 instead. That stretches every step by more than forty percent and leaves the top code unreachable. NVFP4’s scale is an 8-bit float, so it can sit at 0.1875 and use the whole range.BF16 to FP8 to MXFP4 to NVFP4: bytes moved per value, against the block of values each shared scale factor has to cover.Watch the last step. It is the only one that moves the two quantities in opposite directions: every step before it takes bytes away and gives nothing back, and NVFP4 spends a little back, 4.5 bits per value against MXFP4’s 4.25. The narrower block is what that buys.That is the comparison between the two four-bit formats. Whether four bits is the right place to be at all is a different question, and it depends on your hardware and your batch more than on either format.How to read the accuracy claimYou will be handed these numbers rather than generating them, so this is the useful skill. The claim in circulation goes like this: INT4 barely moves the average and guts code generation, so never trust an aggregate score. It has a satisfying shape. The hardest task breaks first. I had a table in this article saying exactly that, carried over from my own notes, until I went back for the source and could not find one. The replacement was wrong too, in a way that is much harder to catch. The figures I put in were real, sat in the correct row for the correct model, and came from the column immediately left of the one I wanted. A fabricated number at least looks unfamiliar. A number from the next column along looks exactly like the number you were after.The columns as the paper prints them. Reading one short returns two real numbers for the wrong benchmark, and reverses the sign of the finding.The source, when I did find it, is Give Me BF16 or Give Me Death? Accuracy-Performance Trade-Offs in LLM Quantization (arXiv:2411.02355). For Llama-3.1–70B-Instruct it reports:Llama-3.1-70B-Instruct on MMLU-Pro and HumanEval pass@1, four precisions each, with the delta against BF16 printed under every score. Read from the MMLU-Pro and HumanEval pass@1 columns of Table 3. The deltas are drawn in so you do not have to subtract them. Their size is the argument.INT4 gains eight tenths of a point on code. FP8 gains three tenths. There is no collapse anywhere in the table. That makes the check below more useful, not less.Convert the percentage back into items. HumanEval has 164 problems. BF16’s 79.7% is about 131 of them; INT4’s 80.5% is about 132. The entire INT4 code gap is one problem, and it runs in INT4’s favor. Flip a single test case and the two rows draw level. Converted back to 131 and 132 of 164, the only test those counts let me run treats the two rows as independent samples, and it gives p = 0.89. It is not the right test. Both models answered the same 164 problems, and the paired test needs to know which ones each of them missed. The paper prints percentages.Drawn at real count. The whole reported difference between the two models is the one highlighted cell.That “about” is doing real work. Neither figure lands on a whole problem, and pass@1, the share of problems solved on a first attempt, is usually estimated from several samples rather than counted once. The conversion is a sanity check, not an exact inversion.Every p in this article comes from the percentages alone, which is the weaker version of the check. The stronger one needs to know which items each model got wrong, and no paper prints that.MMLU-Pro has 12,032 questions, so its 0.9-point drop is 108 of them. That is the sturdy end of the table, and 108 sounds like a lot. The same unpaired test puts it at p = 0.16. That is unresolved rather than absent. The limit is in the test, not the benchmark. Read from printed percentages alone, a gap that small only reaches p = 0.05 at roughly 24,000 questions. With per-item results the same 108-question gap would probably resolve on the 12,032 this benchmark already has, as long as the two versions disagree on fewer than about a quarter of the questions. The FP8 row drops 0.4 points on the same benchmark and tests at p = 0.54. If the two were identical, noise alone would produce a gap at least that large about half the time. That is what the number is for: a small p means the gap would be surprising from noise alone, and a large p means the benchmark could not tell.Bar chart with 95% confidence intervals: every interval overlaps BF16’s, and HumanEval’s are twelve points wide against MMLU-Pro’s two.Six of the paper’s numbers with their uncertainty drawn. Nothing here separates from 16-bit, and the benchmark people quote for the big effect is the one least able to resolve one.The paper’s own summary is more careful: INT4 weight-only is “more competitive than expected, rivaling 8-bit quantization.”So the lesson is not the one I started with. I had it as: aggregates hide the damage, and code generation is where it lands. The table says otherwise. The damage people quote is often not in the study it came from.Two habits worth keeping, and they apply to any evaluation claim:Divide before you believe. Percentage times benchmark size gives you items, and one item is not a finding. And remember what error bars can and cannot tell you. If two intervals do not overlap, the benchmark can resolve the difference. If they overlap, it might still be real, and only the test can say. I know that one because I wrote “the intervals do not overlap” into the first version of that chart and my own test suite caught it.None of which makes quantization free. It means the cost does not show up where the folklore puts it, and you find yours the same way: run your own evaluation, convert to items. A 200-case internal suite has no chance at a one-point change; the odds of it reaching significance are about one in twenty, which is another way of saying chance. At ten points it is roughly a coin flip, better if your scores sit near the top of the range and worse in the middle. Your own suite has what a published percentage does not: you know which cases each version failed. Score them in pairs, count only the cases where the two versions disagree, and you can resolve a smaller difference than the arithmetic above. When the number is someone else’s, the per-item results never come with it. Treat it as unsettled and settle it on your own suite. If you want to run the sizing on your own numbers, this calculator does it in the browser.In production this is a capacity decision firstThe reason quantization matters on a live system is usually not the accuracy line. It is part two’s problem. The two halves of this article meet here: the accuracy evidence decides whether you are allowed to make the trade, and the capacity decides whether the trade is worth making.8-bit weights halve what you drag through memory on the bandwidth-bound path. 8-bit KV cache halves the cache, which roughly doubles the conversations that fit. The conversations that fit are your batch size, and a bigger batch means each weight serves more requests before you drag it again. In vLLM, two flags do the work:--quantization fp8 --kv-cache-dtype fp8On part two’s example, 8-bit KV takes you from fifteen concurrent conversations at 128K to thirty. It also halves what attention reads on every step, which roughly doubles decode-attention intensity. Decode attention is the one part of the model batching never helped. Fifteen conversations is a demo. Thirty is a product, and no amount of scheduler tuning gets you the second one.The weights and the cache are two separate bets, and only one of them has evidence behind it. The paper behind every accuracy number above evaluates weights and activations. It does not test the KV cache at all. So 8-bit cache rests on the mechanism rather than on that result, and it is the half to re-check on long-context work, the regime the capacity argument above is built on. Laid out side by side, the whole choice looks like this.Two of the six rows have no accuracy figure behind them, because the paper this article leans on never measured them.ConclusionQuantization is four decisions wearing one word, and people usually only argue about the bit count. What to pick depends on where you are bound, and two numbers you already have will tell you which. One is your card’s ridge point from part one, peak FLOP/s divided by memory bandwidth: 296 on an H100, 153 on an A100, 419 on an L40S. The other is how many requests are running at once, which your serving logs report. During decode those concurrent requests are your arithmetic intensity, so below the ridge you are memory-bound and above it you are not. Memory-bound at small batch, and the four-bit row is the one that helps. The hardware speedup you are not getting costs you nothing. Compute-bound and four bits can lose to BF16 outright, while 8-bit is where the gain sits. The cache is its own bet either way. If you have no task-specific evaluation, that is a bigger finding than any quantization number.Below 8 bits, prove it rather than assume it. When someone hands you a number to justify going further, divide it back into items first. One problem out of 164 is not a finding, however confidently it is printed. The interesting engineering is not in the format. It is in knowing what you actually bought.Part five is vLLM, and what each of its settings is really a knob on.Quantization figures are from published 70B-class evaluations and are second-hand. Trace them to “Give Me BF16 or Give Me Death?” (arXiv 2411.02355) before repeating them. The significance testing is mine and reproducible; the script is llm-inference-arithmetic on GitHub, MIT, no dependencies.Quantization Is Four Decisions, Not One was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.