LLM quantization

LLM quantization is the process of converting the weights and activations of a large-language-model from high-precision floating-point formats (e.g., FP32, FP16) to lower-precision formats (e.g., INT8, INT4, FP8) to reduce memory footprint, increase inference speed, and lower hardware requirements.

Key Objectives

Common Techniques

  • Post-Training Quantization (PTQ): Quantizing a pre-trained model without retraining.
  • Quantization-Aware Training (QAT): Simulating quantization effects during training to minimize accuracy loss.
  • Mixed Precision: Using different precisions for different layers or components (e.g., FP16 for attention, INT8 for feed-forward).

Hardware Implications

Recent analysis of qwen-38-27b highlights the critical balance between model size and quantization level for consumer hardware.

References