Quantization (LLM)

Category: Generative AI / LLM

The technique of reducing the numerical precision of model weights from higher bit representations (like FP16) to lower ones (like INT8 or INT4) to decrease memory usage and increase inference speed.

Full Explanation

Quantization compresses language model weights by reducing their numerical precision, enabling larger models to run on less expensive hardware with faster inference. A model trained in FP16 (16-bit floating point) can be quantized to INT8 (8-bit integer) or INT4 (4-bit integer), reducing memory by 2-4x with minimal quality loss. Post-training quantization (PTQ) compresses a pre-trained model without retraining, while quantization-aware training (QAT) incorporates quantization during training for better quality. Popular quantization formats include GPTQ (GPU-optimized), GGUF (CPU/GPU flexible), and AWQ (activation-aware). Quantization has been instrumental in democratizing access to large language models, enabling 7B-70B parameter models to run on consumer hardware. The quality-efficiency trade-off depends on the model, quantization method, and target precision. INT8 quantization typically preserves nearly all quality, while INT4 introduces more noticeable but often acceptable degradation.

Related Terms

More in Generative AI / LLM

Explore More