NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

The Knowledge Within: Methods for Data-Free Model Compression

Matan Haroush, Itay Hubara, Elad Hoffer, Daniel Soudry · DOI

Abstract

Deep Neural Network (DNN) quantization is a cornerstone of efficient edge AI, yet it traditionally relies on access to original training datasets for post-training calibration and fine-tuning. This paper introduces a novel framework for data-free model compression that leverages the "internal knowledge" of a pre-trained model. By utilizing the running statistics stored in Batch Normalization (BN) layers, the authors generate high-quality synthetic samples that mirror the original training distribution. Combined with a new Intermediate Quantization (IQ) loss, this method allows for aggressive quantization (down to 4-bit or 2-bit) with minimal performance degradation, even when the original data is entirely unavailable.

Introduction: The Data Bottleneck in Quantization

To deploy modern DNNs on resource-constrained devices like smartphones or IoT sensors, quantization—the process of reducing the precision of weights and activations—is indispensable. However, aggressive quantization often introduces significant noise, leading to a drop in accuracy. Standard mitigation strategies, such as Quantization-Aware Training (QAT) or post-training calibration, require a representative subset of the original training data.

In many sensitive domains—including healthcare, finance, and biometric security—the original data may be inaccessible due to privacy regulations (e.g., GDPR) or may have been discarded after the initial training phase. This creates a critical need for "data-free" compression methods that can optimize a model using only its own parameters.

Methodology: Reconstructing Data from Statistics

The core innovation of this work lies in the BN-Statistics (BNS) Scheme. Most modern architectures incorporate Batch Normalization layers to stabilize training. These layers store "running" means and variances that represent the distribution of the training data at various depths of the network.

The authors treat these stored values as a decentralized prior of the training set. To generate synthetic data, they initialize a batch of random pixels and use backpropagation to optimize these pixels until the resulting internal activations in the "teacher" model match the stored BN statistics. This optimization is guided by minimizing the Kullback-Leibler (KL) divergence between the synthetic and original distributions.

Synthetic samples generated using the BNS scheme show recognizable features and textures that mirror the original training classes.

Beyond data generation, the authors propose Intermediate Quantization (IQ) loss to improve the fine-tuning of the quantized "student" model. Unlike standard distillation which only looks at the final output (logits), IQ loss encourages the student to mimic the intermediate feature maps of the teacher. This provides a denser supervision signal, leading to more stable convergence during the data-free fine-tuning process.

Algorithm 2: The Quantized Distillation with IQ process, showing how synthetic data and intermediate feature matching are used to fine-tune the student model.

Key Insights: BN Layers as Decentralized Memory

A significant takeaway from this research is the realization that BN layers act as a form of memory. While they do not store individual images, they capture the aggregate "feel" of the data. Interestingly, optimizing for these statistics naturally encourages spatial structure in the generated images. While the authors still employ a Gaussian smoothing prior to refine the visual quality, the BNS loss performs the majority of the heavy lifting in making synthetic data "look" like real data to the network.

Furthermore, the BNS loss can be repurposed as a similarity score. By measuring the discrepancy between a new dataset's activations and the stored BN statistics, researchers can quantify how "out-of-distribution" a sample is, offering potential applications in anomaly detection or adversarial defense.

Experimental Results

The researchers evaluated the BNS method across standard benchmarks including CIFAR-10, CIFAR-100, and ImageNet, using architectures like ResNet, MobileNet-V2, and DenseNet.

  • ImageNet Performance: On ResNet-18, a 4-bit quantized model (4-bit weights, 4-bit activations) fine-tuned with BNS synthetic data achieved 68.14% accuracy. This is remarkably close to the 68.68% achieved when fine-tuning with the actual original training data, and significantly higher than naive data-free baselines.
  • Aggressive Quantization: In extreme scenarios, such as 2-bit weight quantization on CIFAR-10 (ResNet-44), the BNS method recovered accuracy to 89.6%. In contrast, using simple Gaussian noise for calibration resulted in a catastrophic drop to 71.0%.
  • Scalability: Unlike previous data-free approaches that were limited to small-scale datasets, the BNS scheme scales effectively to ImageNet, producing diverse and representative samples across 1,000 classes.

Conclusion and Future Work

This work demonstrates that the information required to compress a model is often already contained within the model itself. By "inverting" the knowledge stored in BN layers, we can bypass the need for original training data, solving a major hurdle for secure and private model deployment.

While highly effective, the method is computationally intensive due to the iterative optimization required for sample generation. Future research may focus on accelerating this process or extending these principles to non-convolutional architectures, such as Transformers, where Batch Normalization is less prevalent.

Summary updated

BibTeX
@inproceedings{haroush2019knowledge,
  author = {Matan Haroush and Itay Hubara and Elad Hoffer and Daniel Soudry},
  title = {{The Knowledge Within: Methods for Data-Free Model Compression}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2019},
  doi = {10.1109/cvpr42600.2020.00852},
}
Figure