[Paper Review] ZeroQ: A Novel Zero Shot Quantization Framework
ZeroQ is a novel zero-shot quantization framework that enables mixed-precision quantization of deep neural networks without access to any training or validation data. It generates synthetic 'Distilled Data' to match batch normalization statistics for sensitivity analysis and uses a Pareto frontier-based method to automatically select optimal bit-widths, achieving state-of-the-art accuracy with under 30 seconds of computational overhead on ResNet50.
Quantization is a promising approach for reducing the inference time and memory footprint of neural networks. However, most existing quantization methods require access to the original training dataset for retraining during quantization. This is often not possible for applications with sensitive or proprietary data, e.g., due to privacy and security concerns. Existing zero-shot quantization methods use different heuristics to address this, but they result in poor performance, especially when quantizing to ultra-low precision. Here, we propose ZeroQ , a novel zero-shot quantization framework to address this. ZeroQ enables mixed-precision quantization without any access to the training or validation data. This is achieved by optimizing for a Distilled Dataset, which is engineered to match the statistics of batch normalization across different layers of the network. ZeroQ supports both uniform and mixed-precision quantization. For the latter, we introduce a novel Pareto frontier based method to automatically determine the mixed-precision bit setting for all layers, with no manual search involved. We extensively test our proposed method on a diverse set of models, including ResNet18/50/152, MobileNetV2, ShuffleNet, SqueezeNext, and InceptionV3 on ImageNet, as well as RetinaNet-ResNet50 on the Microsoft COCO dataset. In particular, we show that ZeroQ can achieve 1.71\% higher accuracy on MobileNetV2, as compared to the recently proposed DFQ method. Importantly, ZeroQ has a very low computational overhead, and it can finish the entire quantization process in less than 30s (0.5\% of one epoch training time of ResNet50 on ImageNet). We have open-sourced the ZeroQ framework\footnote{https://github.com/amirgholami/ZeroQ}.
Motivation & Objective
- To address the challenge of deploying quantized models in privacy-sensitive environments where training data is inaccessible.
- To eliminate the need for retraining or access to real data in post-training quantization.
- To enable automatic, optimal mixed-precision bit allocation without manual hyperparameter tuning.
- To minimize computational overhead while maintaining high model accuracy after quantization.
- To support diverse models and tasks, including image classification and object detection, under strict data privacy constraints.
Proposed method
- Generate a Distilled Dataset by optimizing synthetic inputs to match the batch normalization statistics across all layers of a pre-trained model.
- Use the Distilled Dataset to compute layer-wise quantization sensitivity via KL-divergence between full-precision and quantized model outputs.
- Formulate mixed-precision quantization as a Pareto frontier optimization problem to identify the best trade-off between model size and accuracy.
- Automatically determine optimal bit-width configurations for weights and activations using sensitivity-based ranking and Pareto efficiency.
- Perform post-training quantization using the selected bit configurations, with no fine-tuning or real data access.
- Ensure low computational cost by limiting the number of forward passes and using efficient optimization for data distillation.
Experimental results
Research questions
- RQ1Can a synthetic data distribution be constructed to accurately reflect the statistical behavior of real training data for quantization sensitivity analysis?
- RQ2Can mixed-precision quantization be automatically optimized without manual search or access to real data?
- RQ3How does the performance of a zero-shot quantization method compare to existing post-training methods when no training data is available?
- RQ4What is the computational overhead of generating sensitivity metrics and selecting bit configurations in a data-free setting?
- RQ5Can the proposed method generalize across diverse architectures and tasks, including object detection?
Key findings
- ZeroQ achieves 75.80% top-1 accuracy on ImageNet using ResNet50 with 4-bit weights and 8-bit activations, outperforming the baseline 77.72% by 1.92% when using real data.
- On MobileNetV2, ZeroQ achieves 68.83% accuracy with 4-bit weights and 8-bit activations, which is only 0.23% lower than the 69.06% accuracy when using real training data.
- ZeroQ reduces the accuracy gap between Gaussian data and real data by 80% on ResNet50 and 90% on MobileNetV2, demonstrating the effectiveness of the Distilled Data.
- The entire end-to-end quantization process for ResNet50 takes less than 30 seconds on an 8-V100 GPU system, equivalent to 0.5% of one training epoch.
- The Pareto frontier-based bit selection method yields a mean accuracy of 75.73% with a variance of 2.4×10⁻³ across 20 runs, showing high stability and superiority over random or inverse selection.
- ZeroQ achieves 1.71% higher accuracy than the recently proposed DFQ method on MobileNetV2 under the same 4-bit weight and 8-bit activation setting.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.