Abstract
As Large Language Models (LLMs) scale, the hardware requirements for inference become increasingly prohibitive. Quantization—reducing weight and activation precision to 4 bits or lower—is a critical optimization. However, the field is currently characterized by a "bag of tricks" where the individual contributions of various techniques are often obscured. This paper provides a systematic evaluation by decoupling post-training quantization (PTQ) into two phases: pre-quantization transformation and error mitigation. We demonstrate that the synergy between optimized transformations and compensation methods can achieve near-lossless 4-bit performance. Furthermore, we evaluate NVIDIA’s Blackwell FP4 formats, revealing their inherent resilience to outliers compared to traditional INT4.
Introduction
The deployment of LLMs is often bottlenecked by memory bandwidth and capacity. While 4-bit quantization (W4A4) is highly desirable for hardware efficiency, it often leads to significant accuracy degradation due to the presence of extreme outliers in activation and weight distributions. Existing PTQ methods combine various strategies—such as scaling, rotation, and iterative weight adjustment—making it difficult to identify which components drive performance. This study aims to provide a "fair ground" evaluation by isolating these components and testing them across diverse model families, including Llama-3.1, Llama-3.2, and Qwen2.5.
Methodology: A Two-Step Framework
We categorize modern PTQ methods into a two-step taxonomy to better understand their individual and collective impacts.
1. Pre-quantization Transformation
This phase prepares the data distribution for quantization by smoothing out outliers that would otherwise dominate the quantization range.
- Shifting: Centering the data distribution.
- Scaling: Balancing the dynamic range between activations and weights (e.g., SmoothQuant).
- Rotation: Applying orthogonal transformations, such as Hadamard matrices, to distribute outlier energy across multiple channels.
2. Quantization Error Mitigation
After the initial quantization, error mitigation strategies are employed to recover lost accuracy.
- Self-compensation: Methods like GPTQ adjust the remaining high-precision weights based on the Hessian matrix to minimize the reconstruction error of layer outputs.
- Low-rank Decomposition: An auxiliary high-precision branch is added to compensate for the errors introduced by the 4-bit base weights.
Experimental Results and Key Insights
The framework was evaluated on a comprehensive suite of benchmarks, including WikiText-2 for perplexity and 9 zero-shot tasks (e.g., MMLU, ARC-C, GSM8K).
The Power of Synergy
The most significant performance gains were observed when combining techniques. The integration of optimized rotation and scaling with GPTQ and low-rank compensation yielded the best results. For instance, on Llama-3.2-1B, this pipeline achieved a perplexity of 11.73, a substantial improvement over naive quantization which often leads to model collapse.
FP4 vs. INT4
The study provides early insights into NVIDIA’s Blackwell FP4 formats (MXFP4 and NVFP4). FP4 formats naturally handle the "long-tail" distributions of LLMs better than INT4. Interestingly, while FP4 outperforms INT4 in basic setups, the gap narrows significantly when rotation is applied. This suggests that rotation acts as a "great equalizer," though FP4-native hardware may reduce the necessity for such complex pre-processing.
Implementation Trade-offs
- Asymmetry: Asymmetric quantization is essential for activations due to their skewed distributions, whereas symmetric quantization suffices for weights.
- Granularity: Moving to per-group quantization (e.g., group size 128) improves accuracy at the cost of approximately 0.25 extra bits per parameter for scaling factors.
- Overhead: Low-rank compensation (rank=32) introduces a manageable 2.3% memory and 3.1% computational overhead, making it a viable option for high-accuracy requirements.
Conclusion
By decoupling the "bag of tricks" in LLM quantization, this research clarifies the path toward efficient 4-bit deployment. The combination of outlier-smoothing transformations and robust error mitigation is key to maintaining model performance. Future work will focus on making these transformations more computationally efficient and exploring loss-aware optimization for low-rank compensation branches.
Summary updated