Abstract
Post-training quantization (PTQ) is a neural network compression technique that converts a full-precision model into a quantized model using lower-precision data types. Although it can help reduce the size and computational cost of deep neural networks, it can also introduce quantization noise and reduce prediction accuracy, especially in extremely low-bit settings. Existing methods attempt to determine quantization parameters by minimizing the distance between features before and after quantization, but such an approach only considers local information and may not result in the most optimal parameters. We propose PD-Quant, a method that addresses this limitation by considering global information via the differences between network predictions before and after quantization. Additionally, PD-Quant alleviates overfitting caused by small calibration sets by adjusting activation distributions. Experiments show that PD-Quant improves prediction accuracy significantly, particularly in 2-bit settings.
Introduction
The deployment of deep neural networks on edge devices necessitates efficient compression techniques. Quantization, which maps 32-bit floating-point values to low-bit integers, is a primary strategy. While Quantization-Aware Training (QAT) yields high accuracy, its requirement for full datasets and high compute makes Post-Training Quantization (PTQ) a more practical alternative. PTQ typically relies on a small calibration set (e.g., 1024 images) to determine quantization parameters like scaling factors and rounding.
However, as bit-widths drop to 2-bit (W2A2), standard PTQ methods suffer from severe performance degradation. This paper identifies two core issues: the "local-global gap" in optimization metrics and the overfitting problem inherent in small-sample calibration.
Methodology: The PD-Quant Framework
PD-Quant introduces two primary innovations to bridge the performance gap in low-bit PTQ: the Prediction Difference (PD) Loss and Distribution Correction (DC).
Prediction Difference (PD) Loss
Traditional PTQ methods optimize parameters by minimizing local reconstruction error (e.g., MSE) at each layer. PD-Quant argues that local optimality does not guarantee global performance. Instead, it employs a "global" view by measuring the impact of a layer's quantization on the final network output. By using Kullback-Leibler (KL) divergence to quantify the difference between the predictions of the floating-point model and the quantized model, PD-Quant ensures that quantization parameters are chosen to preserve the model's ultimate decision logic.
Distribution Correction (DC)
Overfitting is a significant hurdle in PTQ because the tiny calibration set may not represent the true data distribution. PD-Quant addresses this by leveraging the statistics (mean and variance) stored in the model's pre-existing Batch Normalization (BN) layers. Since these statistics were calculated over the entire training set, they serve as a reliable global prior. The DC module fine-tunes input features so their distribution aligns with these BN statistics, effectively regularizing the model against the biases of the small calibration set.
Key Insights: The Local-Global Gap
A critical finding of this work is that the "optimal" scaling factor for a specific layer—when viewed through the lens of final task accuracy—often diverges significantly from the factor that minimizes local MSE. Local metrics are often too "greedy" and sensitive to noise in low-bit regimes.
As shown in the loss landscape analysis, traditional metrics like MSE and Cosine similarity exhibit extremely sharp and narrow minima. In contrast, the proposed PD metric (red) provides a much broader and more stable landscape, which is less prone to falling into poor local minima during the optimization of quantization parameters.
Experimental Results
PD-Quant was evaluated on the ImageNet dataset across various architectures, including CNNs (ResNet, MobileNetV2, RegNet) and Vision Transformers (ViT, DeiT).
The method achieves state-of-the-art results, particularly in the challenging 2-bit (W2A2) configuration:
- ResNet-18: Reached 53.14% top-1 accuracy, outperforming the previous state-of-the-art (QDrop) by nearly 2%.
- MobileNetV2: Improved accuracy to 13.76% from 10.28%. While MobileNet remains difficult to quantize at 2-bit, this represents a substantial relative gain.
- Vision Transformers: On ViT-S, PD-Quant achieved 48.13% accuracy, a significant improvement over the 45.16% baseline.
In terms of efficiency, PD-Quant remains highly practical. Quantizing a ResNet-18 model takes approximately one hour on a single GPU, maintaining the speed advantage of PTQ over the hundreds of hours required for QAT.
Conclusion
PD-Quant effectively addresses the limitations of local-only optimization in post-training quantization. By introducing a global prediction difference metric and a distribution correction mechanism based on BN statistics, it enables high-performance quantization even at the 2-bit frontier. This work highlights that global information and proper distribution alignment are essential for pushing the boundaries of neural network compression.
Summary updated