TL;DR
Post-training quantization (PTQ) is commonly celebrated for achieving near-lossless average accuracy, but this average hides catastrophic failure modes on individual categories. This paper establishes an empirical reliability benchmark for PTQ, demonstrating that while overall accuracy remains seemingly stable, worst-case class performance and variance degrade sharply under real-world conditions like calibration noise, class imbalance, and lower bit-widths.
What Problem Does This Paper Address?
Post-training quantization (PTQ) compresses deep neural networks without retraining or altering network architectures by using a tiny "calibration" dataset to determine scale factors and clipping ranges. Standard literature reports success based almost entirely on aggregate metrics (e.g., top-1 ImageNet accuracy or overall mAP).
However, PTQ relies on a "closed-environment" assumption—assuming the calibration set and downstream test distributions match. In risk-sensitive domains like autonomous driving and medical imaging, a model that preserves 99% of its mean accuracy is dangerous if accuracy on pedestrian detection or rare tumor classes collapses. This work addresses the unexplored question of PTQ reliability: how vulnerable is quantized model performance on worst-case subgroups and individual categories under calibration distribution shifts, dataset sizing, and optimization choices?
Methods
The authors introduce an evaluation framework examining how variability propagates through the three core stages of the PTQ pipeline:
- Calibration Dataset Construction:
- Data Noise: Mixing clean calibration images with synthetic noise images at varying ratios (1%, 5%, 10%, 50%).
- Inter-Class Bias: Inducing class imbalance by oversampling one target class to comprise 50% of the calibration set while evenly distributing the rest.
- Dataset Size: Scaling calibration samples from 1 to 1,024 images.
- Quantization Settings:
- Testing uniform symmetric quantization across bit-widths (W8A8, W6A6, and W4A4).
- Parameter Optimization & Metrics:
- Comparing four calibration metrics: MinMax, Cosine distance, KL divergence, and MSE.
- Comparing standard heuristic search (Grid Search) against modern gradient-based reconstruction methods: AdaRound, BRECQ, and QDrop.
To reliably isolate fluctuations, every experiment is repeated over 50 randomized trials across different random seeds.
Datasets
The authors benchmark across three computer vision tasks and datasets:
- CIFAR-10: Evaluated on classification with ResNet-20, ResNet-32, ResNet-44, and ResNet-56.
- ImageNet (ILSVRC 2012): Evaluated across diverse CNN architectures, including ResNet-18, ResNet-50, MobileNetV2, MNasNet, RegNetX-600m, and RegNetX-3200m.
- MS COCO: Evaluated on object detection using YOLOv5s (640×640), decomposing bounding box performance by size (small, medium, large).
Key Insights and Ideas
- Average accuracy conceals localized collapse: Box plots over 50 trials reveal that while overall accuracy fluctuates within a narrow band (< 0.5%), individual classes exhibit variance that is orders of magnitude wider. In YOLOv5s, large bounding boxes experienced significantly worse accuracy drops than small or medium objects.
- Scaling calibration data hits diminishing returns for worst-case classes: Increasing calibration images from 1 to 32 stabilizes mean accuracy and shrinks variance. However, scaling further from 32 to 1,024 fails to reduce the variance of inherently sensitive classes (e.g., ImageNet Class 2 on MobileNetV2 retains a standard deviation of ±2.77% even with 1,024 samples).
- Calibration noise selectively punishes specific categories: Adding random noise barely moves the global mean, but causes sharp drops in vulnerable classes (e.g., Class 8 on CIFAR-10 drops dramatically).
- The gradient-based PTQ paradox: Advanced optimization algorithms like QDrop and BRECQ achieve superior average accuracy (e.g., reaching 72.1% top-1 on MobileNetV2 W6A6 vs. 70.2% for Grid Search). However, they exhibit diminished worst-case reliability—inducing larger variance and lower accuracy on specific classes (e.g., Class 1 yields only 68.8% on QDrop vs. 70.6% on simple Grid Search).
Key Results
- Bit-Width Sensitivity: In MobileNetV2 on ImageNet, transitioning from W8A8 to W6A6 causes a mild average drop (~1.8%), but Class 6 suffers a drop exceeding 6%, whereas Class 5 drops by less than 1%.
- Impact of Calibration Metrics: On ResNet-44 (CIFAR-10, W4A4), MinMax calibration degrades average accuracy down to 62.6% (with certain classes like Class 0 collapsing to 27.3%), whereas MSE and Cosine retain ~87.3%–87.9% average accuracy.
- Unbalanced Calibration: In ImageNet experiments where one category constitutes 50% of calibration data, average accuracy remains nearly invariant (shifts < 0.05%), yet individual classes swing by up to ±0.8% in mean accuracy with noticeable spikes in variance. Furthermore, oversampling a class in calibration does not reliably improve that class’s accuracy.
Limitations and Future Work
- Scope of Quantization Types: The study focuses exclusively on uniform quantization; non-uniform and mixed-precision PTQ schemes remain unanalyzed.
- Reliability Dimensions: The authors restrict their analysis to worst-case category performance and distribution shifts. Other critical reliability dimensions—such as adversarial robustness, calibration confidence (ECE), and out-of-distribution (OOD) detection—were left for future work.
- Domain Coverage: Experiments are limited to vision models (CNNs and YOLO); transformer architectures and natural language processing domains are not evaluated in the core benchmark.
Summary updated