Abstract
Deploying Large Language Models (LLMs) is hindered by immense computational and storage costs. While various quantization methods have emerged, their accuracy often falls short of academic and industrial requirements. We propose ATQ, an INT8 weight-activation quantization method that achieves near-lossless performance. By employing a mathematically equivalent transformation and applying the triangle inequality, we constrain quantization error to the sum of independent weight and activation errors. Transformed activations are normalized into a range suitable for quantization, while weight errors are compensated via optimization. Our experiments on OPT and LLaMA families demonstrate that ATQ maintains perplexity increases within 1.0 and limits accuracy degradation to under 0.5%, even in worst-case scenarios.
Introduction
The primary bottleneck in LLM deployment is the precision of activations. Unlike weights, activations often contain "outliers"—specific channels with magnitudes significantly higher than the rest. Standard 8-bit quantization (W8A8) typically scales the entire range to fit into 256 levels; these outliers force the remaining "normal" values into a tiny fraction of the available bit-depth, leading to catastrophic precision loss.
Existing solutions like SmoothQuant attempt to migrate this difficulty from activations to weights, but they often require manual hyperparameter tuning and struggle with larger models. ATQ addresses this by mathematically transforming the activation distribution to eliminate the impact of outliers before quantization occurs.
Methodology
ATQ utilizes a two-pronged strategy to decouple and minimize quantization error:
- Error Decomposition: Using the triangle inequality, the authors prove that the total layer error is bounded by the sum of the weight quantization error and the activation quantization error. This allows for independent optimization of both components.
- Activation Transformation (AT): Instead of quantizing raw activations, ATQ applies a linear transformation consisting of a Shift (centering the activation range per channel at zero) and a Scale (normalizing outliers to a standard range, typically $[-1, 1]$).
- Mathematical Equivalence: To preserve model logic, the inverse of this transformation is integrated into the weights and biases of the linear layers. This makes the process transparent to the model's inference while providing hardware-friendly INT8 activations.
- Weight Compensation (EC): The weights, which now incorporate the complexity of the activation transformation, are quantized using an optimized version of the GPTQ algorithm. This compensates for the shift by adjusting the remaining unquantized weights within each layer.
Experimental Results
Language Modeling Performance
ATQ was evaluated across the OPT and LLaMA model families. As shown in the perplexity results for LLaMA models, ATQ consistently matches the FP16 baseline (W16A16) and outperforms existing W8A8 methods. Notably, ATQ avoids the "Out of Memory" (OOM) issues encountered by competitors like SmoothQuant and OmniQuant when scaling to 70B parameter models.
Zero-Shot Accuracy
To verify the "lossless" claim, the authors tested the models on a suite of zero-shot tasks, including PIQA, ARC, and HellaSwag. Across the OPT family, ATQ maintained accuracy within 0.5% of the original floating-point model. In many instances, ATQ's W8A8 performance was indistinguishable from the W8A16 (weight-only quantization) baseline, representing a significant step forward for full INT8 deployment.
Key Insights and Conclusion
ATQ demonstrates that activation outliers are primarily a range-management problem. By mathematically normalizing the activation range before quantization, the problem becomes significantly more tractable. Unlike gradient-based optimization methods (e.g., OmniQuant), ATQ relies on direct mathematical transformations, making it faster and more robust across different model architectures, including the recent Llama-3 family.
While current results are based on simulated quantization, the mathematical framework provides a clear path for hardware-level INT8 implementation. Future work will focus on developing optimized CUDA kernels to translate these accuracy gains into real-world inference speedups and exploring even lower bit-widths (e.g., W4A4).
Summary updated