What is weight-only quantisation?
Weight-only quantisation is a quantisation method storing a model's weights as 8, 4 or fewer bit integers or low-bit formats such as NF4 while leaving activations at high precision; weights are dequantised on the fly during computation.
Unlike activation quantisation, which also lowers intermediate values and enables integer matrix multiplication, weight-only quantisation shrinks memory and data read. Since outliers make activations hard to quantise, it can reach lower bit widths with less accuracy loss.
- Topic
- Machine learning, models and training
- Also known as
- Weight-only quantization
How weight-only quantisation works
- Weights are split into groups; a scale and, if needed, a zero point are computed per group.
- Some methods quantise weights in sequence to minimise error using a small calibration set.
- Some find important weight channels from the activation distribution and protect them by scaling.
- At inference, quantised weights are read from memory and dequantised on the fly.
Commonly confused terms
| Term | How it differs |
|---|---|
| Quantisation-aware training | Weight-only quantisation is usually applied after training, compressing a trained model with a small calibration set and little or no retraining, as in GPTQ or AWQ, whereas quantisation-aware training simulates quantisation noise during training or fine-tuning so the weights adapt to low precision. |
| KV cache quantisation | Weight-only quantisation shrinks model parameter memory and weight-read bandwidth, whereas KV cache quantisation compresses the attention key-value cache that grows with context length and batch size during long-context inference. |
Why weight-only quantisation matters for on-premises AI
Token-by-token generation in large language model inference is often memory bandwidth-bound, so shrinking weights directly improves memory and speed. One method quantised 175 billion parameter models to 3 or 4 bits per weight in about four GPU hours with negligible accuracy loss, letting the 3-bit model run on a single GPU. Another showed protecting just the most important 1% of weights, by scaling rather than higher precision, greatly reduces quantisation error. It is the most common compression route in in-house deployments.
To run a 70 billion parameter open-weight model on one server, an insurer applies 4-bit weight-only quantisation; it compares the quantised model with the original on its own claims question set and confirms the gap is acceptable.
Common questions
Does weight-only quantisation speed things up?
Usually yes for memory-bound token generation, since less data is read. Gains can be limited for compute-bound work.
How does it differ from activation quantisation?
Weight-only quantisation keeps activations at high precision. Activation quantisation shrinks intermediate values too, enabling integer arithmetic.
Related terms
- Quantisation
- Activation quantisation
- Activation-aware Weight Quantisation
- GPTQ
- Model memory footprint
- Post-training quantisation
Sources
- Frantar et al., GPTQ: Accurate Post-Training Quantization for Generative Pre-trained Transformers, 2022
- Lin et al., AWQ: Activation-aware Weight Quantization for LLM Compression and Acceleration, 2023
In the glossary: Glossary, R to Z