Beyond 4 bits: Data-Centric Post-training Quantization and Recovery
Organizations: Applied Sciences Group (ASG), Microsoft · Microsoft Research
Abstract
Post-training quantization (PTQ) compresses the weights of a trained model with limited compute and data. Down to 4 bits it is near-lossless, but at 2 bits scalar PTQ configurations fall to chance-level accuracy. We study three choices usually treated as implementation details that matter little at 4 bits but decide 2-bit quality: the quantization representation, the calibration data, and the recovery fine-tuning data, across six dense and mixture-of experts models (ranging from to B parameters). Representation is the largest factor and vector codebooks restore usable models where scalar PTQ pipelines collapse. Most of the remaining loss in accuracy is on generative tasks, and the amount of performance drop is model-dependent. Furthermore, at a short recovery budget, calibration and recovery data are coupled. The best recovery data depends on the calibration data, so the two must be chosen jointly. The resulting recipe involves a vector codebook representation, a small task-aligned calibration mixture, and an inexpensive codebook-only recovery stage. Including codebooks, it uses about effective bits per weight and retains to of full-precision question-answering (QA) accuracy where scalar PTQ is at chance, and, including recovery, uses to less compute than the strongest quantization-aware-training (QAT) baseline.
Figures & tables
| Phi-4-mini | Llama-3.1 | Qwen3-MoE | ||||
|---|---|---|---|---|---|---|
| Recipe | QA | Gen | QA | Gen | QA | Gen |
| Web | 63.3 | 12.2 | 65.1 | 9.6 | 66.0 | 54.0 |
| Math | 58.5 | 37.4 | 62.1 | 26.6 | 64.5 | 61.8 |
| Code | 55.9 | 18.7 | 60.8 | 22.6 | 62.8 | 48.9 |
| Math+web .5/.5 | 62.6 | 24.7 | 65.7 | 17.8 | 66.7 | 56.5 |
| Web+math .7/.3 | 63.0 | 27.7 | 65.5 | 15.1 | 65.8 | 56.2 |
| Precision | Accuracy | Mean CoT | Cap-hit | Markers/1k | Loop ( -gram) | R-then-A |
|---|---|---|---|---|---|---|
| bf16 | 0.675 | 4928 | 0.25 | 15.5 | 0.39 | 0.69 |
| 4-bit | 0.650 | 5265 | 0.25 | 12.4 | 0.41 | 0.50 |
| 2-bit | 0.450 | 5900 | 0.45 | 23.7 | 0.67 | 0.41 |
| Rep. penalty | Marker penalty | Accuracy | Mean CoT | Cap-hit | Markers/1k | Loop ( -gram) |
|---|---|---|---|---|---|---|
| 1.0 | 0 | 0.425 | 5884 | 0.475 | 23.0 | 0.66 |
| 1.0 | 2 | 0.475 | 5156 | 0.375 | 10.2 | 0.62 |
| 1.0 | 6 | 0.500 | 4726 | 0.350 | 2.2 | 0.59 |
| 1.2 | 0 | 0.575 | 5052 | 0.300 | 15.0 | 0.40 |
| 1.3 | 0 | 0.625 | 4799 | 0.250 | 13.0 | 0.30 |
| Decision | Recommendation |
|---|---|
| Representation | vector codebook (YAQA). |
| Calibration | task-aligned Hessian mixture |
| Recovery | short codebook-only KD, or none for base models. |
| Recovery data | choose jointly with calibration. |
| KD settings | defaults ( ). |
| Teacher | 4-bit (matches bf16 ) or none. |
Appendix figures & tables31 assets
Supplementary material from the paper’s appendix.
Appendix
| Model | Calibration | AvgQA | GSM8K | HumanEval | HumanEval c |
|---|---|---|---|---|---|
| Qwen3-MoE | web | 64.8 | 69.5 | 25.6 | 64.6 (70%) |
| instruction | 64.8 | 67.5 | 19.5 | 67.7 (73%) | |
| code | 63.8 | 66.9 | 39.0 | 76.2 (82%) | |
| math | 59.8 | 72.2 | 17.7 | 59.8 (64%) | |
| all-4 mixture | 63.7 | 75.1 | 18.3 | 76.2 (82%) | |
| web/math | 66.0 | 76.3 | 22.6 | 67.1 (72%) |
| Fixed | Learned, | Learned, | ||||
|---|---|---|---|---|---|---|
| Model | Bits | AvgQA | AvgQA | AvgGen | AvgQA | AvgGen |
| Phi-4-mini | 4 | 69.2 | 68.4–69.3 | 63.2–68.9 | 68.2–69.7 | 62.9–70.4 |
| 2 | 29.3 | 28.8–29.3 | 0.0 | 28.7–29.4 | 0.0 | |
| Llama-3.1-8B | 4 | 71.8 | 70.4–71.6 | 36.5–40.5 | 70.9–71.9 | 37.1–41.8 |
| 2 | 29.8 | 28.7–29.4 | 0.0 | 29.3–29.7 | 0.0 | |
| web | math | |||
|---|---|---|---|---|
| Method (bits/weight) | AvgQA | AvgGen | AvgQA | AvgGen |
| VPTQ ( / ) | ||||
| VPTQ, model-wide ( / ) | ||||
| YAQA ( / ) | ||||
| Model | Method | Web | Instruct | Math | Code | Mixture |
|---|---|---|---|---|---|---|
| Phi-4-mini | VPTQ | 51.5 | 53.9 | 41.0 | 44.4 | 47.8 |
| YAQA | 63.3 | 56.8 | 58.5 | 55.9 | 58.8 | |
| Llama-3.1-8B | VPTQ | 57.6 | 59.8 | 45.7 | 53.4 | 54.5 |
| YAQA | 65.1 | 63.9 | 62.1 | 60.8 | 64.3 | |
| Qwen3-30B-A3B | VPTQ S | 64.8 | 64.8 | 59.8 | 63.8 | 63.7 |
| YAQA | 66.0 | 64.9 | 64.5 | 62.8 | 66.0 |
| Hessian mixture weight | Phi-4-mini | Llama-3.1-8B | Qwen3-30B-A3B | ||||||||
| Group | Recipe | Code | Web | Math | Instr | QA | Gen | QA | Gen | QA | Gen |
| Single | Web | 1 | 63.3 | 12.2 | 65.1 | 9.6 | 66.0 | 54.0 | |||
| Instruct | 1 | 56.8 | 10.7 | 63.9 | 11.8 | 64.9 | 49.8 | ||||
| Math | 1 | 58.5 | 37.4 | 62.1 | 26.6 | 64.5 | 61.8 | ||||
| Code | 1 | 55.9 | 18.7 | 60.8 | 22.6 | 62.8 | 48.9 | ||||
| Standard mix | math+web | 0.5 | 0.5 | 62.6 | 24.7 | 65.7 | 17.8 | 66.7 | 56.5 | ||
| 4-bit scalar (QA / Gen spread) | 2-bit YAQA | |||
|---|---|---|---|---|
| Model | SpinQuant | QuaRot | KronQ | (QA / Gen) |
| Phi-4-mini | 1.4 / 2.9 | 0.5 / 6.5 | 1.3 / 5.0 | 7.5 / 26.7 |
| Llama-3.1-8B | 1.6 / 4.4 | 1.0 / 2.6 | 0.6 / 7.3 | 4.9 / 17.0 |
| Source | GSM8K (test) | HumanEval | MATH-500 |
|---|---|---|---|
| web (FineWeb-Edu) | 0.0 | 0.0 | 0.0 |
| math (OpenR1-Math-220k) | 0.0 | 0.6 | 4.8 |
| code (Evol-Instruct-Code-80k) | 0.0 | 5.5 | 1.0 |
| instruction (Alpaca-cleaned) | 0.0 | 2.4 | 0.6 |
| Calibration | Recovery | Core6 | GSM8K | HumanEval | AvgGen | IFEval |
|---|---|---|---|---|---|---|
| Web | Web | 65.7 | 23.5 | 14.0 | 18.8 | 28.1 |
| Web | Math | 65.0 | 35.1 | 14.0 | 24.6 | 26.6 |
| Math | Web | 61.6 | 56.3 | 31.1 | 43.7 | 32.0 |
| Math | Math | 60.1 | 60.1 | 25.0 | 42.6 | 27.5 |
| Calib. | Recovery | AvgQA | GSM8K | HEval | AvgGen | IFEval |
|---|---|---|---|---|---|---|
| Phi-4-mini (three recovery seeds) | ||||||
| bf16 | 70.8 | 81.7 | 62.8 | 72.3 | 55.8 | |
| web | none | 63.1 | 15.5 | 6.7 | 11.1 | 29.0 |
| web | web | |||||
| web | math | |||||
| math | none | 58.3 | 53.2 | 20.1 | 36.7 | 31.2 |
| Examples | Tokens | PFLOP | AvgQA | AvgGen |
|---|---|---|---|---|
| 0 | 0 | 58.5 | 37.4 | |
| 0.2M | 6 | 58.8 | 38.5 | |
| 0.8M | 25 | 59.1 | 41.8 | |
| 3.3M | 101 | 60.3 | 43.7 | |
| 13.1M | 403 | 61.0 | 44.2 |
| Calib. | Recovery | AvgQA | GSM8K | HEval | AvgGen | IFEval |
|---|---|---|---|---|---|---|
| bf16 | 70.9 | 87.5 | 61.6 | 74.5 | 25.0 | |
| web | none | 63.3 | 53.0 | 7.9 | 30.5 | 15.2 |
| web | web | |||||
| web | math | |||||
| math | none | 60.7 | 77.9 | 20.1 | 49.0 | 16.5 |
| math | web | |||||
| Benchmark | Phi-4-mini | Llama-3.1-8B | Qwen3-8B |
|---|---|---|---|
| MBPP | |||
| HumanEval+ | |||
| MATH-500 | |||
| MBPP+MATH-500 | |||
| All three |
| Sample | web web | web math | math web | math math | Interaction |
|---|---|---|---|---|---|
| original | 24.2 / 13.6 | 33.8 / 14.2 | 56.9 / 34.6 | 60.1 / 24.6 | |
| k rows | 23.2 / 13.4 | 33.6 / 12.2 | 56.3 / 35.4 | 60.1 / 25.0 | |
| k rows | 25.1 / 14.6 | 34.4 / 14.6 | 58.4 / 31.7 | 61.5 / 27.4 |
| web recovery | math recovery | |||||||
|---|---|---|---|---|---|---|---|---|
| Calib. | Base | GSM8K | HEval | AvgGen | GSM8K | HEval | AvgGen | Effect |
| web | original | 24.2 | 13.6 | 18.9 | 33.8 | 14.2 | 24.0 | |
| web | replicate 1 | 29.9 | 8.5 | 19.2 | 42.3 | 6.7 | 24.5 | |
| web | replicate 2 | 25.7 | 10.4 | 18.0 | 39.6 | 17.1 | 28.3 | |
| math | original | 56.9 | 34.6 | 45.7 | 60.1 | 24.6 | 42.3 | |
| math | replicate 1 | 57.3 | 33.5 | 45.4 | 61.0 | 27.4 | 44.2 | |
| Model | Method | Web | Instruct | Math | Code | Mixed |
|---|---|---|---|---|---|---|
| Phi-4-mini | VPTQ-rotated | 51.4 / 1.5 | 53.7 / 7.5 | 40.9 / 6.4 | 44.6 / 11.4 | 47.6 / 7.8 |
| VPTQ-native | 57.4 / 7.6 | 57.6 / 12.9 | 47.8 / 13.2 | 51.0 / 29.5 | 56.2 / 26.0 | |
| YAQA-rotated | 63.1 / 11.1 | 56.8 / 10.9 | 58.3 / 36.7 | 55.8 / 19.2 | 58.8 † / 19.9 † | |
| Llama-3.1-8B | VPTQ-rotated | 57.5 / 2.6 | 59.6 / 10.3 | 45.8 / 8.5 | 53.2 / 15.8 | 54.4 / 13.2 |
| VPTQ-native | 63.3 / 5.5 | 62.4 / 11.4 | 57.8 / 16.0 | 57.6 / 19.7 | 62.0 / 17.1 | |
| YAQA-rotated | 65.1 / 9.5 | 63.7 / 12.3 | 62.0 / 27.4 | 60.7 / 22.9 | 64.2 / 18.5 |
| Checkpoint | fp16 | 8-bit | 4-bit | 2-bit |
|---|---|---|---|---|
| YAQA math+web | 68.5 | 68.5 | 68.5 | 68.6 |
| YAQA MWI442 | 68.2 | 68.1 | 68.0 | 68.0 |
| Model | Type | Params (B) | Completion | HumanEval |
|---|---|---|---|---|
| Phi-4-mini | dense | – | ||
| OLMoE-1B-7B | MoE | / | ||
| Llama-3.1-8B | dense | – | ||
| Qwen3-8B | dense | – | ||
| Qwen3-32B | dense | |||
| Qwen3-30B-A3B | MoE | / |
| Configuration | AvgQA | GSM8K | HEval | PTB ppl |
|---|---|---|---|---|
| bf16 ceiling | 68.3 | 33.7 | 31.1 | 14.7 |
| VPTQ S web | 62.7 | 11.8 | 7.9 | 22.2 |
| VPTQ S web+math | 63.0 | 18.7 | 11.6 | 21.7 |
| YAQA web+math | 64.0 | 26.0 | 15.2 | 19.3 |
| Model | Configuration | IFEval |
| Phi-4-mini-instruct | bf16 | 56.6 |
| 2-bit YAQA (math+web) | 37.2 | |
| + codebook recovery | 36.0 | |
| Llama-3.1-8B | bf16 | 8.9 |
| 2-bit YAQA | 7.4 | |
| Qwen3-30B-A3B | bf16 | 28.3 |
| Calib. | Recovery | GSM8K | HumanEval | IFEval |
|---|---|---|---|---|
| Phi-4-mini (YAQA) | ||||
| bf16 | 81.4 | 73.8 | 69.7 | |
| web | none | 13.0 | 15.2 | 43.1 |
| web | web | 24.4 | 18.9 | 43.8 |
| web | math | 36.5 | 21.3 | 44.2 |
| math | none | 55.0 | 34.1 | 40.3 |
| Model | Method | bf16 | 4-bit | 2-bit |
|---|---|---|---|---|
| Phi-4-mini | SpinQuant | 71.0 | 69.2 | 29.3 |
| QuaRot | 71.0 | 69.3 | 29.8 | |
| Llama-3.1-8B | SpinQuant | 73.1 | 71.8 | 29.8 |
| QuaRot | 73.1 | 71.7 | 29.3 | |
| Qwen3-MoE | SpinQuant | 72.6 | 70.8 | 29.4 |
| QuaRot | 72.6 | 70.3 | 29.3 |
LLM Quantization
Large language model quantization reduces numerical precision to lower memory use and accelerate training or inference.
See all 381 papers