AWQ's Per-Layer Calibration: Optimal Scale Factors
AWQ computes unique, optimal scaling factors for each individual layer's weights—and sometimes activations—by analyzing their specific distribution and impact, ensuring more precise quantization than a single global factor.
The top 3
- AWQ's Alpha: The Grid Search for Optimal Scales: AWQ determines optimal per-layer scaling factors through a fast grid search, typically evaluating 20 `alpha` values between 0 and 1. This process minimizes layer-output reconstruction error on a calibration dataset, avoiding computationally expensive gradient descent due to non-differentiable quantization.
- AWQ's Calibration Speed vs. GPTQ's Hessian: AWQ's layer-wise calibration is significantly faster, completing in seconds per layer, compared to GPTQ, which can take hours for large models. This efficiency stems from AWQ's simple grid search for scaling factors, avoiding computationally intensive Hessian matrix approximations used by GPTQ.
- Algebraic Identity: AWQ's Secret to Preserving Precision: AWQ's core insight relies on an algebraic identity: XW = (X * diag(s)) * (W * diag(1/s)). This allows scaling down salient weights for easier low-bit quantization, while inversely scaling activations, ensuring the mathematical product remains unchanged in floating-point precision, thus minimizing error.
Sources
Open the full topic