Quantization in depth
Choosing a quantization method
The right method depends on the hardware, the serving software and how much quality loss the task can tolerate:
| Method or format | Typical use |
|---|
| FP8 weights and activations | Recent data-center GPUs that support FP8, served with vLLM or TensorRT-LLM |
| INT8 weight-only or SmoothQuant-style W8A8 | Broad GPU support with small quality loss |
| GPTQ or AWQ 4-bit weights | Fitting larger models on fewer or smaller GPUs |
| GGUF quantization levels | llama.cpp and Ollama on CPUs, laptops and small servers |
| bitsandbytes 4-bit with QLoRA | Fine-tuning large models on limited GPU memory |
Weight-only quantization saves memory and helps when generation is limited by memory bandwidth. Quantizing activations as well can raise throughput further on hardware with fast low-precision math, but it is harder to do without accuracy loss.
Example: fitting a model onto existing GPUs
Example: a team wants to serve a 14 billion parameter open-weight model on GPUs it already has, each with 24 GB of memory. At 16-bit, the weights alone need about 28 GB, so the model will not fit on one card. With AWQ 4-bit weights, they need roughly 8 GB, leaving room for the attention cache and several concurrent users. The team runs its evaluation set through both the full-precision model (on a rented larger GPU) and the 4-bit version. Extraction accuracy is nearly unchanged, but answers to Hindi questions drop slightly, so they test an 8-bit version for that route and compare again. The decision is recorded with the scores, and both versions stay in the model registry.
How to evaluate a quantized model
- Run the same evaluation set on the full-precision and quantized versions, with identical prompts and sampling settings.
- Compare task scores, not just perplexity. Perplexity changes can be small while task accuracy moves more.
- Break results down by language, task type and input length.
- Measure serving metrics on target hardware: memory use, time to first token, tokens per second and maximum concurrent requests.
- Repeat after any change to the serving stack, since kernels and formats affect both speed and output.
Common mistakes
- Choosing the lowest bit width that loads, without measuring quality.
- Using a calibration dataset that does not resemble real inputs, such as English-only text for a Hindi workload.
- Forgetting the attention cache, which can need as much memory as the weights for long contexts and many users.
- Downloading community quantizations without checking the source model and method.
- Assuming a format runs fast everywhere. Some formats are fast only on specific GPUs or runtimes.
Quantization is one of several ways to make inference faster and less costly. Distillation trains a smaller model to imitate a larger one, and small language models start small by design; the approaches combine well. Quantization often decides whether a private deployment is practical at all. Gepton applies it in private AI deployment, sizes GPU platforms in MLOps and AI infrastructure, and weighs it against other options in AI cost optimization.