Core Scaling Formula: Activation Magnitude & Alpha
AWQ computes per-channel scaling factors `s_j` using the formula `s_j = a_j^alpha`, where `a_j` represents the average per-channel magnitude of activations observed during calibration, and `alpha` is the hyperparameter optimized to protect salient weights.
The top 3
- AWQ's Core: The WX=W'X' Algebraic Identity: AWQ's scaling formula leverages the algebraic identity WX = (W/s) * (sX), where 's' is a per-channel scaling factor. This allows weights (W) to be scaled down (W/s) for better low-bit quantization, while activations (X) are inversely scaled up (sX) in floating-point, preserving the layer's output value without accuracy loss in the FP domain.
- Alpha's Critical Role in Scaling Factor s = a^α: The scaling factor 's' for each channel is defined as the activation magnitude 'a' raised to the power of 'alpha' (s = a^α). The hyperparameter 'alpha', typically between 0 and 1, balances protection between salient and non-salient channels. An α=0 results in no scaling (like RTN), while α=1 scales directly by activation magnitude, which can over-protect outliers.
- AWQ's Fast Grid Search for Optimal Alpha: Instead of complex analytical derivations, AWQ efficiently determines the optimal 'alpha' through a fast grid search. It tests a small number of 'alpha' values (e.g., 20) in the range [0, 1] on a small calibration dataset (16-128 samples), selecting the 'alpha' that minimizes layer-output reconstruction error. This process is significantly faster (minutes vs. hours) than methods like GPTQ.
Sources
Open the full topic