Skip to main content
QUICK REVIEW

[Paper Review] Diversifying Sample Generation for Accurate Data-Free Quantization

Xiangguo Zhang, Haotong Qin|arXiv (Cornell University)|Mar 1, 2021
Advanced Neural Network ApplicationsComputer Science37 references9 citations
TL;DR

This paper proposes Diverse Sample Generation (DSG), a novel data generation method for data-free quantization that mitigates performance degradation caused by homogenization in synthetic data. By slackening batch normalization statistics alignment and applying layerwise sample enhancement, DSG significantly improves quantized model accuracy, achieving up to 22% accuracy gain on W4A4 quantization and outperforming both real-data calibration and prior state-of-the-art methods.

ABSTRACT

Quantization has emerged as one of the most prevalent approaches to compress and accelerate neural networks. Recently, data-free quantization has been widely studied as a practical and promising solution. It synthesizes data for calibrating the quantized model according to the batch normalization (BN) statistics of FP32 ones and significantly relieves the heavy dependency on real training data in traditional quantization methods. Unfortunately, we find that in practice, the synthetic data identically constrained by BN statistics suffers serious homogenization at both distribution level and sample level and further causes a significant performance drop of the quantized model. We propose Diverse Sample Generation (DSG) scheme to mitigate the adverse effects caused by homogenization. Specifically, we slack the alignment of feature statistics in the BN layer to relax the constraint at the distribution level and design a layerwise enhancement to reinforce specific layers for different data samples. Our DSG scheme is versatile and even able to be applied to the state-of-the-art post-training quantization method like AdaRound. We evaluate the DSG scheme on the large-scale image classification task and consistently obtain significant improvements over various network architectures and quantization methods, especially when quantized to lower bits (e.g., up to 22% improvement on W4A4). Moreover, benefiting from the enhanced diversity, models calibrated by synthetic data perform close to those calibrated by real data and even outperform them on W4A4.

Motivation & Objective

  • To address the performance drop in data-free quantization caused by synthetic data homogenization at both distribution and sample levels.
  • To improve the diversity of generated synthetic data without requiring real training data.
  • To develop a versatile method compatible with various post-training quantization techniques, including AdaRound.
  • To achieve higher accuracy in low-bit quantization (e.g., W4A4) using only synthetic data.
  • To demonstrate that diverse synthetic data can surpass models calibrated with real data in accuracy.

Proposed method

  • Introduces Slack Distribution Alignment (SDA) to relax the constraint of matching batch normalization statistics, reducing distribution-level homogenization.
  • Proposes Layerwise Sample Enhancement (LSE) to reinforce specific network layers for different data samples, reducing sample-level homogenization.
  • Generates synthetic data by optimizing a loss function that incorporates SDA and LSE, enabling diverse feature distributions across samples.
  • Applies the DSG-generated data to calibrate quantized models without retraining, using standard post-training quantization pipelines.
  • Supports integration with advanced quantization methods like AdaRound by providing diverse, high-quality synthetic data for weight quantization.
  • Employs image priors and label guidance in conjunction with DSG to improve sample realism and performance.

Experimental results

Research questions

  • RQ1Does synthetic data generated via data-free quantization suffer from distribution-level homogenization that harms model accuracy?
  • RQ2Can sample-level homogenization in synthetic data limit the performance of quantized models?
  • RQ3Can improving the diversity of synthetic data lead to better quantized model accuracy, even surpassing real-data calibration?
  • RQ4Is the DSG scheme effective across different network architectures and low-bit quantization settings?
  • RQ5Can DSG be seamlessly integrated with state-of-the-art post-training quantization methods like AdaRound?

Key findings

  • On W4A4 quantization of ResNet-18, DSG achieves 34.53% top-1 accuracy, a 22.89% improvement over ZeroQ and a 2.67% gain over real-data calibration.
  • On InceptionV3 with W4A4, DSG achieves 34.89% accuracy, surpassing ZeroQ by 22.89% and real data by 11.66%.
  • When combined with AdaRound, DSG achieves 61.32% top-1 accuracy on ResNet-18 with 3-bit weights, outperforming ZeroQ by 11.43% under the same conditions.
  • DSG consistently improves performance across multiple architectures (ResNet-18, ResNet-50, ShuffleNet, SqueezeNet, InceptionV3) and quantization methods (Percentile, EMA, MSE, AdaRound).
  • The performance gain of DSG is most pronounced in ultra-low bit-width settings, confirming the critical role of data diversity in low-precision quantization.
  • DSG-generated data achieves higher accuracy than real-data-calibrated models on W4A4, demonstrating the superiority of diversity over data fidelity in this regime.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.