LLM Quantization Explained: FP16, INT8, 4-bit, GGUF and AWQ
How quantization shrinks large language models: precision formats, memory math, quality trade-offs, GGUF vs GPTQ vs AWQ, and choosing a level.
Published December 1, 2026
Running a 70-billion-parameter model at full 16-bit precision needs about 140 GB of memory for the weights alone. Quantization stores weights in fewer bits, 8, 5 or 4, cutting memory by two to four times with a modest quality loss. It is the reason capable open models run on laptops and single GPUs.
The concept
Memory for weights is roughly parameters × bytes per parameter. FP16/BF16 uses 2 bytes, INT8 1 byte, and 4-bit formats about half a byte plus a little overhead for scaling factors. So a 7B model is about 14 GB at FP16, 7 GB at 8-bit and 4-4.5 GB at 4-bit. You also need memory for the KV cache, which grows with context length and batch size.
Quantization methods differ in how they choose which precision loss to accept. GGUF is the file format used by llama.cpp and tools built on it (like Ollama and LM Studio), with "K-quant" variants such as Q4_K_M and Q5_K_M that mix precisions. GPTQ and AWQ are GPU-oriented methods that use calibration data to protect the most important weights, popular with serving engines like vLLM.
Memory by precision
Common formats
| Format / method | Typical use | Notes |
|---|---|---|
| FP16 / BF16 | Training, high-quality serving | Baseline quality, most memory |
| FP8 | Modern GPU serving | Good quality, hardware support needed |
| GGUF (Q8, Q5_K_M, Q4_K_M…) | CPU / Apple Silicon / consumer GPU via llama.cpp, Ollama | Flexible, single-file models |
| GPTQ | GPU inference | Calibration-based 4-bit |
| AWQ | GPU inference (vLLM and others) | Activation-aware, protects salient weights |
How to choose
- Check available memory (VRAM or unified memory)
- Subtract room for KV cache and OS (a few GB)
- Pick the largest model that fits at Q4_K_M or Q5_K_M
- Prefer a bigger model at 4-bit over a smaller one at 8-bit, usually
- Validate quality on your own tasks
Practical examples
Memory estimate
Weights only; add KV cache and overhead.
def weight_gb(params_billion, bits):
return params_billion * 1e9 * bits / 8 / 1e9
for bits in (16, 8, 5, 4):
print(bits, round(weight_gb(8, bits), 1), "GB") # 8B modelPull a specific quantization with Ollama
Tags select the quantization variant where available.
ollama pull llama3.1:8b-instruct-q5_K_M
ollama show llama3.1:8b-instruct-q5_K_MServe an AWQ model with vLLM
GPU serving with an OpenAI-compatible API.
vllm serve TheOrg/SomeModel-AWQ --quantization awq --max-model-len 16384Common mistakes
- Forgetting the KV cache, then running out of memory with long contexts.
- Dropping to 2-3 bits and accepting large quality losses unknowingly.
- Comparing models across different quantizations unfairly.
- Assuming every format runs on every engine.
Key takeaways
- Quantization trades a little quality for big memory savings.
- Weights ≈ parameters × bits / 8; add KV cache.
- GGUF for llama.cpp/Ollama; GPTQ/AWQ for GPU serving.
- Q4_K_M or Q5_K_M are common sweet spots; validate on your tasks.
FAQ
Does quantization make models faster?
Often yes, because inference is frequently memory-bandwidth bound; fewer bytes per weight means more tokens per second.
Can I fine-tune a quantized model?
Yes, with techniques like QLoRA, which trains small adapters on top of a 4-bit base model.
What is the KV cache?
Stored attention keys and values for previous tokens so the model does not recompute them; its size grows with context length.