About

What Is Quantization? Shrinking Models with Lower-Precision Weights

From FP32/FP16 to INT8/INT4 to cut memory use

Quantization is a technique for lightening models by representing neural network weights and activations with fewer bits. Typical LLMs stored in FP16 (16-bit floating point) — a 70B model uses ~140GB memory. Quantizing to INT4 (4-bit) reduces this to ~35GB, making it runnable on consumer GPUs. Post-Training Quantization (PTQ) converts without training, while Quantization-Aware Training (QAT) considers quantization during training. Various formats exist — GPTQ, AWQ, GGUF — with llama.cpp's GGUF being the most widely used for local execution.

Key Concepts

1

Analyze weight distribution of the original model (outliers, ranges, etc.)

2

Determine quantization range — set intervals for mapping weight values to lower bits

3

Convert weights to specified bit count (FP16 → INT4: scale each value to 0-15 range)

4

Store scale factor and zero point separately (used for dequantization)

5

Inference: restore approximate values with quantized weights × scale factor → compute

6

Accuracy verification: compare pre/post-quantization performance (perplexity, benchmarks, etc.)

Pros

  • ✓ Model size reduced by 1/2 to 1/8
  • ✓ Improved inference speed (resolves memory bandwidth bottleneck)
  • ✓ Run large models on consumer GPUs
  • ✓ Cost reduction (serving infrastructure)

Cons

  • ✗ Accuracy loss (especially below 4-bit)
  • ✗ Difficulty handling outliers
  • ✗ Compatibility issues between quantization formats
  • ✗ Severe performance degradation on some tasks

Use Cases

llama.cpp + GGUF (run LLMs on CPU/Apple Silicon) GPTQ (GPU quantization) AWQ (Activation-aware Quantization) Ollama / LM Studio local LLMs Edge AI / mobile device deployment
← What Is Function Calling? How LLMs Call Tools with JSON What Is Knowledge Distillation? Teaching a Small Model from a Big One →