Quantization · Evaluation
Searching for a better proxy than KL for quantized models
KL doesn't track quantized model performance very accurately. Interestingly, the clearest sign of lost accuracy is one kind of mistake that KL can't see.
On this page
Quantizing a language model stores its weights in fewer bits. The model gets cheaper to run and slightly worse. To judge how much worse without running a full benchmark, people usually measure the KL divergence between the quantized model and the original. KL is also the standard way to win the accuracy back: quantization-aware distillation trains the quantized model to make that KL small.
In a post on making quantized models more accurate, Applied Compute showed that KL is an unreliable guide to accuracy. One distillation recipe cut KL by 41% and recovered none of the lost task reward; another cut KL by only 10% and recovered all of it. They posed an open question: what other metrics might be better proxies for preserving evaluation accuracy following quantization?
I became interested in figuring out what exactly an accurate proxy would look like. KL turns out to spread its attention over differences that don't matter: it weights every change by how likely the original model thought the token was, so it barely notices the original's unlikely alternatives at positions where it's confident. That's where the clearest sign of lost accuracy shows up: the quantized model confidently writing one of the original's close runner-ups, a plausible-looking but wrong token, at a step where the original was nearly certain. Measuring how often that happens gives a proxy that orders quantized models by accuracy correctly 93% of the time on new checkpoints, against 66% for KL, and it holds up on another number format and on a non-math task. The swaps turn out to be a symptom rather than the cause, which also explains why training directly against them doesn't work.
Setup#
Most of what follows uses Qwen3-8B on 1,819 math problems (GSM8K and MATH-500). Accuracy is the fraction answered correctly, averaged over several sampled solutions per problem.
I made quantized versions two ways:
- Post-training quantization: round every weight to a 3- or 4-bit format (MXFP4, NVFP4, INT4, INT3, and variants that quantize only some layers) and stop.
- Quantization-aware distillation: start from a rounded model and keep training it. The forward pass uses the rounded weights, and gradient descent updates the underlying full-precision weights so the quantized model's predictions match the original's.
KL compares the two models' next-token distributions at a position, p for the original and q for the quantized model:
KL and accuracy disagree#
Post-training quantization (15)Quantization-aware distillation (10)
Each dot is one checkpoint, scored on 1,819 GSM8K and MATH-500 problems. The two circled models have the same KL, but the distilled one loses more than three times as much accuracy.
KL gets the broad trend right, but it can be misleading:
- Same KL, very different accuracy. The two circled models both have KL around 0.035. The untrained one loses 2.2 points of accuracy. The one that went through distillation loses 7.4.
- Less KL, less accuracy. Halfway through one distillation run, the model has half the KL of the model it started from (0.018 against 0.034), but it is less accurate (−3.1 points against −2.2).
Why KL misses what matters#
A model writes its answer one token at a time, picking each token from a probability distribution. Most choices don't affect the answer: "Let's" or "We" lead to the same place. A few do. Suppose the model has written:
The capital of Australia is
The original model gives "Canberra" a probability of about 0.9997 here, and its runner-up, "Sydney", about 0.0003. If a quantized model writes "Sydney", the answer is wrong. Choices like this one, where the original is nearly sure and its alternative is wrong, are where a quantized model's mistakes become visible.
KL measures something different. At every position, it adds up how much the probability of each token changed, weighting each change by how likely the original thought that token was. That weighting has two consequences.
1. Most of KL comes from positions that don't matter. Sort positions by how confident the original is in its top token. The 20% where it's least confident produce 85% of the KL. Those are mostly interchangeable phrasings, where the original itself was unsure.
2. At confident positions, a wrong alternative is nearly invisible. Suppose quantization shifts the probabilities like this:
| "Canberra" | "Sydney" | |
|---|---|---|
| original | 0.9997 | 0.0003 |
| quantized | 0.996 | 0.004 |
"Sydney" became 13 times more likely, a real step toward a wrong answer. But its change is weighted by the original's probability of it, 0.0003, so it barely registers: this position's KL is 0.003, less than an average position contributes.
So KL puts most of its weight where the original is unsure, and very little on unlikely tokens at positions where it's confident. Those positions are where a mistake can be recognized as a mistake, since the original is nearly certain of the right answer. That's where I looked next.
Looking at the rare tokens#
Quantization does change these tokens. At positions where the original gives its top token more than 90%, the quantized models put 3.5 to 9 times more probability on tokens the original gives under 1 in 1,000. Rounding the weights takes a little probability from the top token and spreads it into the tail, and the rarest tokens gain the most.
Most of that spread doesn't matter on its own: even at 0.004, "Sydney" gets written well under 1% of the time. What matters is what the quantized model commits to, which can be measured by cooling its distribution:
Cooling. Divide the quantized model's logits by T = 0.1 before the softmax. That raises every probability to the 10th power before renormalizing, so any gap between options becomes huge.
| quantized model | after cooling |
|---|---|
| "Canberra" 0.996, "Sydney" 0.004 (drifting) | "Canberra" 1.000, "Sydney" 0.000 |
| "Canberra" 0.5, "Sydney" 0.5 (a tie) | "Canberra" 0.5, "Sydney" 0.5 |
| "Canberra" 0.29, "Sydney" 0.70 (committed to the wrong answer) | "Canberra" 0.0001, "Sydney" 0.9999 |
After cooling, each position's distribution is essentially the quantized model's favorite token, with credit split only when two options are nearly tied.
Which rare tokens matter#
When a quantized model commits to a token the original considers unlikely, it's usually one of three kinds:
- Formatting quirks: a stray symbol or space where the original wouldn't put one.
- Glitches: with MXFP4, an internal activation occasionally blows up at one position, the next-token distribution goes nearly flat, and the model writes a nonsense token before picking the thread back up.
- Plausible wrong answers: "Sydney" for "Canberra".
To see which of these matter, I collected about 1,500 swaps: places in a quantized model's own solutions where it wrote something other than the original's top choice. From each one, the original model finished the solution twice, once after the quantized model's token and once after its own, always taking the most likely next token. Both versions were graded. The harm of a type of swap is how much more often the original-token version is correct.
I grouped swaps by the substituted token's rank: its position when the original's candidates are sorted from most to least likely (the top choice is rank 1).
How often each kind of swap turns a correct answer into a wrong one, measured by letting the original model finish the solution both ways (about 1,500 swaps from four quantized models; net rate, so swaps that happened to fix a wrong answer count against it). “Rare” means the original gives the token under 1 in 1,000; “ranked” is its position in the original’s own list of candidates.
What matters is what the substitute is, not just how unlikely it is. A rare token far down the original's list does almost no harm. A rare token the original ranks 2nd to 5th, a near runner-up, breaks a correct answer 12% of the time. A far-out token is obviously wrong: a stray symbol stands out, the intended meaning is still clear from context, and the solution carries on. A near runner-up looks right: "Sydney" is a reasonable thing to write, nothing later flags it, and the rest of the answer builds on it.
What distillation changes#
This also explains the paradox in the first figure. Take positions where a quantized model's favorite token is one the original gives under 1 in 1,000:
- Before distillation, 52–84% of those tokens (depending on the format) rank below 16th in the original's list: formatting quirks and glitches.
- After standard distillation, 72–83% of the remaining ones rank 2nd to 5th: plausible wrong answers.
Distillation removes the glitches and cleans up the formatting, which lowers KL a lot but changes accuracy very little. The near-runner-up swaps carry almost no KL, so they barely get trained away. That's how a distilled model can have the same KL as an untrained one and lose more than three times as much accuracy.
A better proxy: the near-runner-up swap rate#
The proxy measures only the plausible wrong answers:
Near runner-up. At a given position, a token is a near runner-up if the original gives it under 1% probability and it is still among the original's 16 most likely tokens.
Near-runner-up swap rate. Have the quantized model write one solution per problem. Run both models over those solutions. At each position, cool the quantized model's distribution (T = 0.1) and add up its probability on that position's near runner-ups. Average over all positions.
In plain terms, it is roughly the share of positions where the quantized model's favorite token is one of the original's plausible-but-wrong runner-ups. A committed "Sydney" counts as 1, a drifting one as 0, and a stray symbol as 0 however confident the quantized model is, because it's outside the original's top 16. It costs about the same as KL, one pass of each model over the quantized model's solutions, and needs no answer key.
To compare it with KL, I use ordering accuracy. Take every pair of quantized models whose accuracies are reliably different: when the problem set is resampled 500 times, the same model comes out ahead at least 95% of the time. Then count the fraction of those pairs the measure puts in the right order. 50% is a coin flip.
Post-training quantization (15)Quantization-aware distillation (10)
Right: the near-runner-up swap rate, roughly how many positions per 1,000 of its own solutions have, as the quantized model’s favorite token, one the original gives under 1% but ranks in its top 16. Six of the distillation checkpoints were trained after the rule was written down. Rank correlation measures how well each score orders the models (1 = perfectly).
I developed the measure on the 19 models I started with. To test it, I made three more sets: six distillation checkpoints trained with different objectives (forward KL, reverse KL and one-hot cross-entropy, each saved halfway through and at the end); five NVFP4 checkpoints; and fourteen checkpoints scored on 2,000 TriviaQA questions instead of math.
| ordering accuracy | KL | near-runner-up swap rate |
|---|---|---|
| the 19 models used to develop it | 85% | 97% |
| pairs involving the 6 new distillation checkpoints | 66% | 93% |
| pairs involving the 5 NVFP4 checkpoints | 80% | 97% |
| TriviaQA, 14 checkpoints | 92% | 95% |
On the new distillation checkpoints, KL and the swap rate disagree on 27 pairs, and the swap rate is right on all 27. For example, KL rates the worst of them, which lost 7.4 points, as better than one that lost 1.6.
NVFP4 is the format Applied Compute used, and it shows the same pattern they reported: standard distillation lowered KL (0.0137 → 0.0104) but made the model less accurate (−0.7 → −1.3 points). The swap rate puts all five NVFP4 checkpoints in exact accuracy order.
On TriviaQA, a near runner-up is a wrong name or fact rather than a wrong number, and the same rule works unchanged. KL does nearly as well there. The distilled checkpoints were trained on math, so nothing had pushed their KL down on trivia text, which fits the picture of KL failing mainly once a model has been trained to lower it.
The swaps are a symptom, not the cause#
The harm measurement above shows what a swap does to a solution the original would otherwise get right. A separate question is whether the swaps are what the quantized model actually loses its accuracy to. If they are, fixing them should bring the accuracy back.
To test this, I had the MXFP4 model write two solutions to each of the 526 hardest problems while the original model read along. Whenever the quantized model wrote a token of one kind, it was replaced by a sample from the original's distribution; everything else was left alone. The original model scores 75.8% on these problems.
| repaired | how often (per 1,000 tokens) | accuracy |
|---|---|---|
| nothing | 68.9% | |
| near runner-ups (under 1%, ranked 2nd–16th) | 1.2 | 68.5% |
| far-out rare tokens (under 1%, ranked below 16th) | 0.7 | 68.8% |
| plausible alternatives (1% or more, not the top choice) | 62.6 | 70.7% |
| every disagreement (anything that isn't the original's top choice) | 63.3 | 72.7% |
Repairing the near-runner-up swaps recovers none of the gap. Repairing every disagreement recovers about half of it, so repairs can work, but only when they're applied to many token choices at once. The damage is spread across the quantized model's choices rather than concentrated in the swaps.
Splitting the MXFP4 model's solutions to all 1,819 problems shows why. Solutions that contain a near-runner-up swap are less accurate (82% against 89%), but so are the quantized model's other solutions to the same problems (85% against 89%), and so is the original model (87% against 91%). The swaps happen mostly on problems that are hard for both models, where the quantized model's computation is unreliable throughout. Fixing one visible token doesn't make the problem solvable for it.
This is also why the proxy works. A near-runner-up swap is the kind of quantization error that can be recognized without knowing the answer: at those positions the original is nearly certain, so a confident disagreement is almost certainly a mistake. It comes from the same degraded computation as the rest of the damage, so the rate of swaps tracks the total damage, even though the swaps themselves are a small part of it.
What this means for training#
A natural next step is to train against these swaps directly. Two results suggest that isn't straightforward.
Upweighting the swaps made things worse. Giving the training loss 10× extra weight at positions where the quantized model currently makes a near-runner-up swap made accuracy worse (−1.8 points) and the swaps more common. Model-update research has seen the same failure: positive-congruent training, which protects an old model's correct decisions, breaks down when the protected cases are weighted too heavily. Given the repair experiment, this is what you'd expect from pushing on a symptom.
A smooth version of the swap rate rewards the wrong behavior. Cooling makes the swap rate a count, and counts don't give useful gradients. The obvious smooth alternative is the quantized model's raw probability on near runner-ups, without cooling. But it ranks models backwards, getting only 12% of the new pairs right. The damaged checkpoints have less of it, because they became more confident everywhere: that drains probability from runner-ups at the thousands of positions where they're right, while they commit harder at the few where they're wrong. A loss built from it would reward exactly that failure.
Classifiers have the same split: they're evaluated on accuracy but trained on cross-entropy, because accuracy is a count with no useful gradient. For quantized models, KL has been used for both jobs. These results suggest separating them: the swap rate as the measure of quality, and a training loss chosen because it improves that measure. Finding that loss is still open.
Conclusion#
KL doesn't accurately track the performance of quantized models because it weights every difference by how likely the original thought the token was, so most of it comes from harmless differences, and it barely registers the one place where lost accuracy is easiest to see: unlikely tokens at positions where the original is nearly certain. There, the quantized model's confident swaps to one of the original's close runner-ups are a reliable sign of damage. Measuring how often they happen orders quantized models by accuracy much more reliably than KL, on new checkpoints, on NVFP4 and on a non-math task, at about the same cost and without an answer key. The swaps are a symptom of damage spread across the model's choices, which is why they make a good measure of quality but a poor training target.