Abstract: In this paper we study the effects of quantization in DNN training. We hypothesize that weight quantization is a form of regularization and the amount of regularization is correlated with the quantization level (precision). We confirm our hypothesis by providing analytical study and empirical results. By modeling weight quantization as a form of additive noise to weights, we explore how this noise propagates through the network at training time. We then show that the magnitude of this noise is correlated with the level of quantization. To confirm our analytical study, we performed an extensive list of experiments summarized in this paper in which we show that the regularization effects of quantization can be seen in various vision tasks and models, over various datasets. Based on our study, we propose that 8-bit quantization provides a reliable form of regularization in different vision tasks and models.
Introduction
Traditionally, quantization in Deep Neural Networks (DNNs) has been viewed as a compression technique used to reduce the memory footprint and computational cost of models, often at the expense of a small drop in accuracy. However, recent observations suggest that quantized models sometimes outperform their full-precision (FP32) counterparts. This paper investigates the hypothesis that quantization acts as a form of regularization during training, helping models generalize better to unseen data.
Methodology
The authors approach the problem through both analytical modeling and empirical validation:
- Analytical Modeling: Weight quantization is modeled as additive noise injected into the network during training. Using a first-order Taylor expansion of the loss function, the authors demonstrate that training with this noise is mathematically equivalent to adding a gradient norm regularization term. This forces the model toward "flat minima," where small weight perturbations do not significantly impact output, leading to better generalization.
- Empirical Validation: The study utilizes Quantization-Aware Training (QAT) across various bit-widths (2, 4, and 8 bits) and algorithms, including Learned Step size Quantization (LSQ) and Parameterized Clipping Activation (PACT).
Experimental Setup
The research evaluates performance across standard computer vision benchmarks:
- Classification: CIFAR-10 and CIFAR-100.
- Object Detection: Pascal VOC using YOLOv5n.
- Robustness: To measure true generalization, models were tested against a suite of 19 different data augmentations (e.g., frost, motion blur, pixelation) representing real-world corruptions.
Key Insights: Quantization as Noise Injection
The core finding is that rounding errors in quantization function as controlled noise. Much like Dropout or Weight Decay, this noise prevents the model from over-relying on specific parameters or "memorizing" training data.
As seen in the training curves for YOLOv5n, the full-precision model's validation loss eventually begins to rise—a classic indicator of overfitting. In contrast, the 4-bit and 8-bit models maintain a lower and more stable validation loss, demonstrating the regularization benefit of reduced precision.
Key Results
The experiments reveal that 8-bit quantization is the "sweet spot" for regularization. While 2-bit and 4-bit levels can sometimes introduce excessive noise that leads to underfitting, 8-bit precision consistently improves robustness without sacrificing learning capacity.
Across multiple architectures (ResNet20, ResNet18, and YOLOv5n), 8-bit models showed a positive Relative Error Improvement over FP32 when evaluated on augmented data. Notably, on the VOC dataset, the 8-bit YOLOv5n model achieved an average accuracy of 30.34%, significantly higher than the 28.78% achieved by the full-precision version.
Conclusion and Future Work
This study confirms that quantization is a powerful regularizer, with 8-bit precision offering a reliable performance boost across various vision tasks. While these effects are clear in computer vision, future research is needed to determine if these benefits extend to Natural Language Processing and Transformer-based architectures. Additionally, exploring dynamic quantization schedules—gradually decreasing precision during training—could further optimize the balance between regularization and model capacity.
Summary updated