Abstract
Quantization has become a predominant approach for model compression, enabling deployment of large models trained on GPUs onto smaller form-factor devices for inference. Quantization-aware training (QAT) optimizes model parameters with respect to the end task while simulating quantization error, leading to better performance than post-training quantization. Approximation of gradients through the non-differentiable quantization operator is typically achieved using the straight-through estimator (STE) or additive noise. However, STE-based methods suffer from instability due to biased gradients, whereas existing noise-based methods cannot reduce the resulting variance. In this work, we incorporate exponentially decaying quantization-error-aware noise together with a learnable scale of task loss gradient to approximate the effect of a quantization operator. We show this method combines gradient scale and quantization noise in a better optimized way, providing finer-grained estimation of gradients at each weight and activation layer's quantizer bin size. Our controlled noise also contains an implicit curvature term that could encourage flatter minima, which we show is indeed the case in our experiments. Experiments training ResNet architectures on the CIFAR-10, CIFAR-100 and ImageNet benchmarks show that our method obtains state-of-the-art top-1 classification accuracy for uniform (non mixed-precision) quantization, out-performing previous methods by 0.5-1.2% absolute.
Introduction
Deploying modern deep neural networks on edge devices like smartphones or IoT sensors necessitates significant model compression. Quantization is a primary technique for this, converting 32-bit floating-point weights into low-precision formats (e.g., 4-bit or 2-bit integers). Quantization-Aware Training (QAT) is the standard approach to mitigate the resulting accuracy loss by simulating quantization during training.
However, the quantization function is a non-differentiable step function with zero gradients almost everywhere. Traditional QAT relies on the Straight-Through Estimator (STE), which approximates the gradient as 1. While effective, STE introduces bias and instability. Alternative methods using additive noise to simulate quantization often struggle with high variance and fail to adapt to the changing error profile during the training process.
Methodology: Noise Tempering
This paper introduces Noise Tempering, a novel QAT framework that replaces or augments the STE with carefully controlled, error-aware additive noise. The method is built on three pillars:
- Error-Aware Noise: Noise magnitude is scaled proportionally to the instantaneous quantization error $|Q(w) - w|$.
- Exponential Tempering: An exponential decay term, $exp(-k|Q(w) - w|)$, is applied. This suppresses noise when errors are large (early training), allowing the model to settle into a general parameter region, and increases noise as the error decreases to provide fine-grained robustness.
- Learned Step Size: The method integrates with Learned Step Size Quantization (LSQ), making the quantizer's bin width a trainable parameter.
The mathematical formulation of this noise implicitly incorporates a second-order curvature term (the Hessian). This acts as a natural regularizer, steering the optimization toward "flatter" regions of the loss landscape. In these regions, small perturbations in weights (inherent to quantization) result in minimal changes to the loss, enhancing generalization.
Experimental Results
The researchers evaluated the proposed method on CIFAR-10, CIFAR-100, and ImageNet using various ResNet architectures.
Accuracy Gains
The method consistently outperformed existing state-of-the-art (SOTA) uniform quantization techniques. On ImageNet with ResNet-18, the approach achieved 68.4% top-1 accuracy at 2-bit precision, a 0.2% improvement over LSQ and a significant margin over other benchmarks. Across all datasets, absolute accuracy improvements ranged from 0.5% to 1.2%.
Sharpness and Flat Minima
A key insight of this work is the reduction in "sharpness" of the loss landscape. By measuring the loss sensitivity to weight perturbations, the authors demonstrated that noise tempering leads to significantly flatter minima. For instance, a 2-bit ResNet-18 trained with this method showed a sharpness score of 4.97, compared to 6.09 for standard training.
Conclusion and Future Work
Noise Tempering provides a robust mechanism for QAT without adding any inference-time overhead. By dynamically adjusting noise based on quantization error, it achieves superior accuracy and better generalization through flatter minima.
Future research directions include investigating the interaction of this method with adaptive optimizers like Adam or AdamW, which are prevalent in Transformer-based architectures. Additionally, extending the evaluation to Vision Transformers (ViTs) and Large Language Models (LLMs) would further validate the generalizability of the noise tempering approach.
Summary updated