Core Quantization Techniques for LLMs

Key quantization methods for LLMs include Post-Training Quantization (PTQ) and Quantization-Aware Training (QAT). Specific techniques like GPTQ, AWQ, SpQR, and GGML/GGUF (used by llama.cpp) reduce precision from FP16/FP32 to lower bits like INT8 or INT4, enabling efficient local inference.

The top 3

  1. Leading LLM Quantization Algorithms: GPTQ, AWQ, QLoRA: GPTQ pioneered 4-bit post-training quantization for models up to 175B, minimizing error with Hessian matrices [9]. AWQ (Activation-aware Weight Quantization) protects critical weights based on activation magnitudes [6, 9]. QLoRA combines 4-bit quantization with LoRA for efficient fine-tuning of large models on consumer GPUs [2, 23].
  2. 4-bit vs. 8-bit Quantization: Memory, Speed & Accuracy Trade-offs: 8-bit quantization halves memory footprint (e.g., 16GB to 8GB) with minimal accuracy loss (often <1%) and offers ~1.8x inference speedup [2, 4, 1]. 4-bit quantization reduces memory by 75% (e.g., 16GB to 4GB) but requires advanced techniques like AWQ or GPTQ to maintain ~98.9% accuracy on benchmarks like HumanEval+ [2, 4]. Sub-4-bit precision often leads to sharp accuracy regressions [4, 5].
  3. Mitigating Quantization Challenges: Spikes, Calibration, and Accuracy: Key challenges include numerical sensitivity and activation spikes (excessive magnitudes in activations), which can significantly degrade performance [10, 12]. Techniques like SmoothQuant, Quantization-free Module (QFeM), and Quantization-free Prefix (QFeP) are used to mitigate these issues [12, 14, 15]. Proper calibration with 128-512 representative prompts is crucial to prevent accuracy loss [6].

Sources

Open the full topic