AWQ's Output-Preserving Algebraic Scaling

AWQ 'protects' critical weights by scaling them down per-channel before quantization, reducing their dynamic range for lower error. To maintain the original output, activations are inversely scaled during inference, often fused into preceding operations, leveraging an algebraic identity.

The top 3

  1. AWQ's Output Preservation: The Clever Algebraic Flip: AWQ maintains output fidelity by algebraically scaling weights up *before* quantization and inversely scaling corresponding input activations down *during* inference, ensuring the product of weights and activations remains mathematically unchanged. This method allows salient weights to effectively gain more precision within low-bit formats like INT4.
  2. AWQ vs. GPTQ: Superior Low-Bit Accuracy with Simpler Math: AWQ often achieves better accuracy, including consistently lower perplexity at 3- or 4-bit precision on LLaMA and Llama-2 models, compared to GPTQ. It does so by strategically protecting salient weights based on activation patterns, avoiding the computationally intensive Hessian matrix approximations that GPTQ relies on.
  3. Calibrating AWQ: Fast Activation-Aware Scaling Factor Search: AWQ efficiently determines its per-channel scaling factors by analyzing the average magnitudes of input activations from a small calibration dataset, typically around 128 samples. It then performs a fast grid search for a single hyperparameter, 'alpha', within the range to minimize reconstruction error, significantly reducing computational overhead compared to methods requiring full retraining.

Sources

Open the full topic