Enhancing Generalization in Data-free Quantization via Mixup-class Prompting

Jiwoong Park, Chaeun Lee, Yongseok Choi, Sein Park, Deokki Hong, Jungwook ChoiarXiv 2025 · DOI

Abstract

Data-free quantization (DFQ) is a vital technique for deploying deep learning models on resource-constrained devices when original training data is inaccessible. However, synthetic data generated for calibration often suffers from semantic ambiguity—the "polysemy" problem—where a single prompt can lead to diverse, unintended visual representations. This inconsistency causes low-bit models to overfit to poor-quality synthetic distributions. We introduce mixup-class prompting, a simple yet effective strategy that blends multiple class labels within a single text prompt. This approach generates diverse synthetic data that acts as a powerful regularizer, significantly narrowing the generalization gap. Our method sets new state-of-the-art benchmarks for extremely low-bit models, including 2-bit weights, across various architectures.

Introduction

Quantization reduces the precision of model weights and activations (e.g., from 32-bit to 4-bit), saving memory and power. Standard Post-Training Quantization (PTQ) requires a small "calibration" dataset to determine optimal scaling factors. In privacy-sensitive domains like healthcare, this data is often unavailable, leading to the rise of Data-free Quantization (DFQ).

DFQ typically employs generative models, such as Stable Diffusion, to create synthetic calibration sets. However, the authors identify a fundamental limitation: The "Kite" Conundrum. A prompt for "kite" might generate a toy or a predatory bird. This semantic ambiguity creates "out-of-distribution" data that skews the statistical parameters (min/max values) essential for low-bit calibration, often resulting in catastrophic accuracy loss.

Methodology: Mixup-class Prompting

To address label ambiguity, the researchers proposed a two-pronged strategy:

  1. RPC-FID (Relative Per-Class Frechet Inception Score): A novel metric designed to quantify how much a synthetic class deviates from the real distribution due to semantic confusion.
  2. Mixup-class Prompting: Instead of standard single-class prompts (e.g., "[template] [C1]"), the method uses a conjunction-based prompt (e.g., "[template] [C1] and [C2]").

By instructing a Latent Diffusion Model (LDM) to generate images containing features of two distinct classes, the resulting data "softens" decision boundaries. This text-level mixup requires no architectural changes or hyperparameter tuning.

Overview of the mixup-class prompting pipeline (left) and examples of generated synthetic images combining disparate classes like soccer balls and wombats (right).

Theoretical Insights: Gradient Norm as a Compass

The effectiveness of mixup-class prompting is rooted in its ability to prevent overfitting. The authors demonstrate that a higher gradient norm during calibration correlates with a higher risk of overfitting to synthetic data.

Empirical evidence shows that mixup-class prompts consistently maintain lower gradient norms compared to single-class prompts or standard image-space Mixup (ResizeMix). This stability allows the model to capture more robust features that generalize better to real-world data.

Comparison of gradient norms over calibration steps. Mixup-class prompting maintains a lower, more stable gradient norm than single-class or real-data baselines, indicating superior regularization.

Furthermore, the study found that:

  • Diversity is Key: Pairing two random, dissimilar classes provides better regularization than pairing similar ones.
  • The Two-Class Limit: Using more than two classes per prompt (e.g., 3 or 4) dilutes semantic clarity too much, leading to "mushy" images that degrade performance.

Experimental Results

The method was evaluated on ImageNet and CIFAR-100 across various architectures, including CNNs and Vision Transformers (ViTs).

  • Extreme Quantization (W2A4): On ResNet50, the method achieved 70.78% accuracy, nearly matching the performance of models calibrated with real data (70.88%) and significantly outperforming prior DFQ methods.
  • Vision Transformers: ViTs, which are notoriously sensitive to quantization, saw massive gains. For instance, on ViT-S (W5A5), the method outperformed the MimiQ baseline by 8.34%.
  • Generative Robustness: The strategy proved effective across multiple versions of Stable Diffusion (v1.5, v2, and v3), highlighting its general applicability.

Conclusion

Mixup-class prompting provides a robust, plug-and-play solution for the semantic ambiguity inherent in data-free quantization. By leveraging the inherent flexibility of text-to-image models, it creates high-quality calibration data that rivals real-world datasets in effectiveness. Future research may explore more complex prompt engineering or extending this logic to non-classification tasks like object detection.

Summary updated

BibTeX
@misc{park2025enhancing,
  author = {Jiwoong Park and Chaeun Lee and Yongseok Choi and Sein Park and Deokki Hong and Jungwook Choi},
  title = {{Enhancing Generalization in Data-free Quantization via Mixup-class Prompting}},
  year = {2025},
  eprint = {2507.21947},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.21947},
}
Figure