Algebraic Identity for Error-Free Scaling
AWQ employs an algebraic identity where scaling factors are applied to weights before quantization and inverse-scaled into activations during inference, preserving the original floating-point output product and minimizing quantization error without requiring mixed-precision hardware.
The top 3
- AWQ's Core Identity: XW = (XS)(S⁻¹W): AWQ's foundation is an algebraic identity that allows a linear layer's output (XW) to remain mathematically unchanged when weights (W) are scaled by S⁻¹ and activations (X) are inversely scaled by S. This transformation, XW = (XS)(S⁻¹W), ensures the floating-point product is preserved while enabling strategic manipulation for quantization.
- Protecting Critical 1% Weights via Scaling: This identity enables AWQ to protect a small fraction (typically 0.1%-1%) of salient weight channels by scaling them down before quantization, effectively giving them more 'bits of precision' when rounded to INT4. The inverse scaling is then applied to activations at runtime, ensuring the layer output remains accurate without needing mixed-precision storage.
- Simpler Math, GPTQ-Level Accuracy: This 'equivalent transformation' allows AWQ to achieve accuracy comparable to more complex methods like GPTQ, which uses Hessian-weighted compensation, but with a simpler approach. AWQ avoids backpropagation or reconstruction, relying instead on offline activation statistics and a grid search to find optimal scaling factors.
Sources
Open the full topic