GenQ: Quantization in Low Data Regimes with Generative Synthetic Data

Yuhang Li, Youngeun Kim, Donghyun Lee, Priyadarshini Panda, Panda, Priyadarshini · DOI

Abstract

In the realm of deep neural network deployment, low-bit quantization presents a promising avenue for enhancing computational efficiency. However, it often hinges on the availability of training data to mitigate quantization errors, a significant challenge when data availability is scarce or restricted due to privacy or copyright concerns. Addressing this, we introduce GenQ, a novel approach employing an advanced Generative AI model to generate photorealistic, high-resolution synthetic data, overcoming the limitations of traditional methods that struggle to accurately mimic complex objects in extensive datasets like ImageNet. Our methodology is underscored by two robust filtering mechanisms designed to ensure the synthetic data closely aligns with the intrinsic characteristics of the actual training data. In case of limited data availability, the actual data is used to guide the synthetic data generation process, enhancing fidelity through the inversion of learnable token embeddings. Through rigorous experimentation, GenQ establishes new benchmarks in data-free and data-scarce quantization, significantly outperforming existing methods in accuracy and efficiency, thereby setting a new standard for quantization in low data regimes. Code is released at https://github.com/Intelligent-Computing-Lab-Yale/GenQ.

Introduction

Quantization—the process of converting 32-bit floating-point weights into low-bit integers (e.g., 4-bit or 2-bit)—is essential for deploying large deep learning models on resource-constrained edge devices. While effective at reducing memory and latency, quantization introduces significant errors that typically require the original training data for recalibration or fine-tuning. However, access to such data is frequently restricted by privacy regulations (GDPR), copyright, or proprietary concerns.

Previous "data-free" quantization (DFQ) methods attempted to synthesize data by inverting model weights or using GANs. These approaches often resulted in abstract, unrealistic textures that failed to capture the semantic complexity of datasets like ImageNet, leading to substantial performance degradation in low-bit regimes. GenQ addresses this by leveraging the high-fidelity generative capabilities of Stable Diffusion to produce realistic synthetic data.

Methodology: The GenQ Pipeline

GenQ utilizes a pre-trained Stable Diffusion model to generate high-quality synthetic images tailored for two primary scenarios:

  1. Data-Free Quantization (DFQ): When no real data is available, GenQ uses structured label prompts (e.g., "A photo of a [class name]") to synthesize a representative training set.
  2. Data-Scarce Quantization (DSQ): When minimal data is available (e.g., 1 image per class), GenQ employs Textual Inversion. This process learns a specific token embedding that captures the unique style and features of the available real data, guiding the generator toward higher fidelity.
The GenQ pipeline for data synthesis and filtering.

Advanced Filtering Mechanisms

To ensure the synthetic data is "in-distribution" for the target model, GenQ incorporates a two-stage filtering process:

  • Energy Filtering: Uses the model’s output logits to calculate an energy score; images with low energy (indicating high familiarity to the model) are retained.
  • Architecture-Specific Filtering:
    • CNNs: Employs BatchNorm Distribution Filtering to align synthetic batch statistics with the model's internal running statistics.
  • Vision Transformers (ViTs): Uses Patch Similarity Filtering to ensure internal diversity within generated images.

Results and Analysis

GenQ was evaluated on ImageNet-1k across various architectures, including ResNet, MobileNetV2, and Vision Transformers (ViT, Swin).

Performance comparison of GenQ against existing methods in PTQ, QAT, and generation speed.

Key Performance Benchmarks

  • Accuracy Recovery: In 4-bit Post-Training Quantization (PTQ) on ResNet-50, GenQ achieved 75.47% accuracy, nearly matching the 75.45% baseline of the real dataset. In the more aggressive W2A4 regime, it significantly outperformed prior methods like ZeroQ and MixMix.
  • Quantization-Aware Training (QAT): GenQ outperformed the previous state-of-the-art (TexQ) by 5.4% on 4-bit ResNet-50.
  • Vision Transformers: On Swin-B, GenQ improved accuracy by 15% compared to previous specialized methods like PSAQ-ViT.
  • Efficiency: GenQ is approximately 15x faster than traditional image inversion techniques, making large-scale synthetic data generation practical.

Transferability and Data Scarcity

A notable finding is the high transferability of GenQ-generated data; synthetic images filtered for one architecture (e.g., ResNet-18) can effectively quantize others (e.g., MobileNetV2). Furthermore, in data-scarce settings, using just one real image per class allows GenQ to reach accuracy levels typically requiring hundreds of times more real data.

Conclusion

GenQ demonstrates that "objectness"—the presence of realistic, coherent objects rather than abstract textures—is critical for recovering accuracy in low-bit quantized models. By bridging the gap between generative AI and model compression, GenQ sets a new standard for quantization in data-restricted environments. Future work will focus on reducing the computational overhead of full-scale generation and extending the method to specialized domains such as medical or satellite imagery.

Summary updated

BibTeX
@inproceedings{li2024genq,
  author = {Yuhang Li and Youngeun Kim and Donghyun Lee and Priyadarshini Panda and Panda, Priyadarshini},
  title = {{GenQ: Quantization in Low Data Regimes with Generative Synthetic Data}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-72624-8\_13},
}
Figure