Abstract
Data-free quantization (DFQ) enables the compression of deep neural networks without requiring access to original training data, which is often restricted due to privacy or security concerns. However, existing DFQ methods frequently struggle with "mode collapse," where synthetic calibration data lacks the diversity necessary to maintain model accuracy. This paper introduces EnhancingDFQ, a framework that leverages internal features of full-precision models and normalization flows to generate highly diverse synthetic data. By improving both inter-class and intra-class diversity, EnhancingDFQ achieves state-of-the-art accuracy across various architectures, including CNNs and Transformers.
Introduction
Deep Neural Networks (DNNs) have become essential for modern AI, but their high computational and memory requirements often hinder deployment on edge devices. Quantization—the process of converting high-precision weights (e.g., 32-bit floats) into low-precision integers (e.g., 4-bit)—is a primary solution for model compression. Standard quantization requires a calibration dataset to minimize accuracy loss. In sensitive domains like healthcare or facial recognition, this data is often unavailable.
Data-free quantization (DFQ) addresses this by using a generator to synthesize data that mimics the original distribution. The core challenge in DFQ is the quality of this synthetic data. Most generators suffer from mode collapse, producing repetitive, low-entropy patterns. If the calibration data is not representative of the real-world input space, the quantized model's performance drops significantly. EnhancingDFQ aims to break this bottleneck by injecting structural and distributional diversity into the generation process.
Methodology
The EnhancingDFQ framework introduces three innovative components to ensure the synthetic data is both diverse and effective for calibration:
1. Multi-layer Features Mixer (Inter-class Diversity)
Rather than relying on static class labels, the system extracts rich structural information from multiple layers of the original full-precision (FP) model. It employs an attention-based "Mixup" strategy on these internal features. This allows the generator to capture complex relationships between classes—for example, creating a synthetic image that shares features of both a "cat" and a "dog"—preventing the generator from converging on a single, simplistic representation of a class.
2. Normalization Flow Based Attention (Intra-class Diversity)
Traditional generators often use simple Gaussian noise, which limits the variety of outputs. EnhancingDFQ utilizes Normalization Flows to transform simple noise into complex, non-Gaussian distributions. Combined with a cross-layer attention mechanism, this forces the generator to focus on different fine-grained details across different layers, ensuring that images within the same class remain distinct from one another.
3. Novel Regulation Losses
To further refine the process, the authors introduce two specific loss functions:
- Similarity-based Loss ($SimLoss_1$): This penalizes the generator for producing patterns similar to those generated in previous iterations, explicitly pushing for temporal diversity.
- Distillation Regulation Loss ($SimLoss_2$): This aligns the activations of the FP model and the quantized model. Crucially, it helps the quantized model learn adaptive clip ranges, allowing the numerical scales of the compressed model to adjust dynamically to the wide range of diverse synthetic inputs.
Experimental Results
The authors evaluated EnhancingDFQ on major benchmarks, including CIFAR-100 and ImageNet, testing both traditional Convolutional Neural Networks (CNNs) and modern Vision Transformers (ViTs).
Quantitative Performance
EnhancingDFQ consistently outperformed previous state-of-the-art (SOTA) methods such as Qimera and GDFQ:
- CNNs: On ImageNet with 4-bit weights and activations, it achieved 71.20% accuracy on ResNet-50, a nearly 1% improvement over previous bests. On the challenging MobileNetV2, it reached 67.10%, marking a significant leap in performance for compact models.
- Transformers: For ViT-B (4-bit weights/8-bit activations), the method reached 83.63% accuracy, remarkably close to the original full-precision model's 84.53%.
Qualitative Diversity
Visual analysis confirms the effectiveness of the diversity-enhancing components. Similarity matrices and synthetic image samples demonstrate that while baseline methods like Qimera produce highly repetitive patterns, EnhancingDFQ generates a broad spectrum of visual features.
Conclusion
EnhancingDFQ demonstrates that the key to successful data-free quantization lies in the diversity of the synthetic calibration data. By treating the full-precision model as a source of structural guidance rather than just a discriminator, and by utilizing normalization flows for complex distribution modeling, the framework effectively overcomes mode collapse. Future work may extend these principles to more complex spatial tasks like object detection and semantic segmentation, where input diversity is even more critical.
Summary updated