AWQ's Dual Scaling: Weights Pre-Quantization, Activations During Inference

AWQ identifies salient weights by analyzing activation magnitudes and applies a pre-quantization scaling factor to these weights; this scaling is then inversely compensated by modifying activations during inference, forming a mathematically equivalent transformation.

The top 3

  1. AWQ's Unchanged Output: The Algebraic Identity: AWQ's dual scaling maintains mathematical equivalence via the algebraic identity (W × s) × (X ÷ s) = WX. Weights (W) are scaled up by factor 's' before quantization, while activations (X) are scaled down by '1/s' during inference, ensuring the floating-point product remains unchanged despite the low-bit representation.
  2. How AWQ Selects Optimal Scaling Factors: AWQ determines per-channel scaling factors by analyzing activation magnitudes from a small calibration dataset. It identifies approximately 1% of 'salient' channels with the largest average activation magnitudes, then calculates scaling factors to protect these critical weights from quantization error.
  3. AWQ's Calibration Speed & Accuracy Advantage: AWQ calibrates 5-10x faster than GPTQ by avoiding computationally expensive Hessian computations, achieving comparable or superior accuracy (0.1-0.3 perplexity improvement at INT4). Its hardware-friendly pure INT4 inference and better generalization have led to its adoption as the default INT4 format in production and by major frameworks like NVIDIA TensorRT-LLM and vLLM.

Sources

Open the full topic