Introduction
Deep Neural Networks (DNNs) are increasingly deployed on resource-constrained edge devices, necessitating efficient compression techniques. Network quantization, which reduces the precision of weights and activations from 32-bit floating point to low-bit integers (e.g., 4-bit or 2-bit), is a primary strategy for achieving significant model size reduction and inference speedup. However, training low-precision models often results in a substantial drop in accuracy.
The fundamental difficulty lies in the discrete nature of quantization. Small weight updates may either result in no change to the quantized value or cause abrupt jumps. This behavior transforms the smooth loss landscape of full-precision models into a "jagged" and sharp terrain characterized by numerous local minima and steep valleys. Such landscapes lead to unstable gradients and poor generalization.
Sharpness-Aware Quantization (SAQ)
To address these challenges, we introduce Sharpness-Aware Quantization (SAQ), a training paradigm designed to smooth the loss landscape of quantized networks. SAQ builds upon the principles of Sharpness-Aware Minimization (SAM) but adapts them specifically for the unique constraints of quantization.
The authors identify that simply applying SAM to quantized models is ineffective due to two phenomena:
- Perturbation Mismatch: Standard SAM gradients do not account for the clipping and rounding operations inherent in quantization.
- Perturbation Diminishment: Small adversarial perturbations intended to find flatter regions are often "swallowed" by the rounding process of the quantizer.
SAQ overcomes these by performing the adversarial perturbation on the quantized weights rather than the full-precision weights. This ensures that the optimization process directly targets the sharpness of the landscape the model will actually encounter during inference.
Efficient Optimization
A significant hurdle for SAM-based methods is the computational cost, typically requiring two forward and backward passes per update. SAQ mitigates this through an efficient training strategy that decomposes the perturbed gradient. By reusing specific gradient components across iterations, SAQ achieves the benefits of sharpness-aware optimization with a negligible ~11% training overhead.
Experimental Results
SAQ was evaluated across diverse benchmarks, including ImageNet, CIFAR-10/100, and transfer learning tasks. It consistently achieves state-of-the-art (SOTA) performance for low-bit quantization.
Performance and Generalization
On ImageNet, a 4-bit Vision Transformer (ViT-B/16) trained with SAQ reached 79.2% Top-1 accuracy, a 1.2% improvement over standard AdamW. Similarly, a 4-bit ResNet-50 achieved 77.6% accuracy, outperforming previous SOTA methods by 0.9%.
The training dynamics illustrate that SAQ leads to more stable convergence and better generalization. While it may exhibit slightly higher training loss initially, it results in significantly lower and more stable validation loss compared to standard Stochastic Gradient Descent (SGD).
Robustness and Transferability
Beyond raw accuracy, SAQ-trained models demonstrate superior robustness. The "sharpness" of the landscape, measured by the largest Hessian eigenvalue, is reduced by orders of magnitude (e.g., from ~14,500 to ~670 for a 4-bit ViT). This flatness translates to better performance when models are fine-tuned on downstream tasks, indicating that SAQ learns more robust and transferable features.
Conclusion
Sharpness-Aware Quantization (SAQ) provides a robust solution to the instability of low-bit neural network training. By explicitly optimizing for flatter minima in the quantized weight space, SAQ bridges the accuracy gap between full-precision and quantized models with minimal computational cost. Future work will explore extending SAQ to non-uniform quantization and joint pruning-quantization strategies.
Summary updated