Quantization lowers weight precision, for example from FP16 to INT8 or INT4. Distillation trains a small "student" model to mimic a large "teacher". Both shrink footprint and cost.
Quantization and distillation compared
| Technique | What changes | Typical use |
|---|---|---|
| Quantization | Weights drop from FP16 to INT8 or INT4, cutting weight memory about 2 to 4 times. GGUF, AWQ and GPTQ are examples. | Constrained hardware, such as self-hosted setups and edge devices |
| Distillation | A smaller student trains on the outputs of a larger teacher, so it needs fewer parameters. | High-volume tasks where teacher data can be generated |
Quantization lets larger models run on smaller GPUs, usually with a small drop in quality at 8-bit and a larger one at 4-bit. A distilled 7 billion parameter model can approach a 70 billion parameter model on a narrow task, though results vary.
Distillation works by feeding the student the teacher's outputs. The student learns to reproduce the teacher's behavior with fewer parameters, which yields a smaller model that keeps much of the accuracy on the target task and uses fewer resources.
The two techniques can be combined. That makes it feasible to run capable models where compute is limited and to deploy them more efficiently.
Where the quality loss shows up first
Both techniques resemble lossy compression or minification. In AI the loss is in model quality, and it is not uniform. Edge cases and complex reasoning tend to degrade first, which can cause unexpected failures. Quantized models can falter on reasoning because of the reduced precision, most often at 4-bit and below.
Match model size to the task
A common default is to run the largest model available. That wastes money and adds latency on simple queries. A quantized or distilled model can give comparable results on easier tasks at lower cost and with faster responses. Picking by task demand avoids over-provisioning.
- Quantize when hardware is limited.
- Distill when volume is high and you can generate teacher data.
- Keep full precision for the most complex reasoning.
Serving costs fall, which makes local or edge models more economical.
Example scenario: inference slows after quantization
Suppose inference time rises 30% against a 200 ms ceiling, with accuracy dropping as well. Both figures are illustrative. Aggressive quantization can reduce accuracy, and it can also slow inference when the hardware lacks fast low-precision kernels.
- Check the quantization configuration and its effect on performance.
- Measure latency and throughput in production against the baseline.
- Log accuracy after quantization and compare it with the values before.
Fine-tuning the quantized model can recover accuracy, with a possible small latency increase. Monitor latency and accuracy against thresholds you set, for instance 200 ms and accuracy within 2% of the original, both illustrative.