DFQ-ViT: Data-Free Quantization for Vision Transformers without Fine-tuning

Yujia Tong, Jingling Yuan, Tian Zhang, Jianquan Liu, Chuang HuarXiv 2025

TL;DR

DFQ-ViT introduces a highly efficient, data-free quantization pipeline for Vision Transformers (ViTs) that completely eliminates the need for resource-heavy fine-tuning. By synthesizing calibration data via a curriculum-based "Easy to Hard" strategy and correcting intermediate layer activation drift with a lightweight correction matrix, it achieves quantization performance on par with—and sometimes better than—using real data.

What Problem Does This Paper Address?

Deploying Vision Transformers (ViTs) on resource-constrained edge devices is a massive challenge due to their huge parameter counts and computational demands. Quantization (reducing the bit-width of weights and activations) is the go-to solution, but traditional methods require access to the original training data to retrain the model and recover lost accuracy. When data is inaccessible due to strict privacy or security constraints (e.g., medical or financial data), Data-Free Quantization (DFQ) must rely on synthetic data instead.

However, existing DFQ methods suffer from two major flaws when applied to ViTs:

  1. Poor Synthetic Data Quality: They fail to properly balance global structures and local details during data generation.
  2. Activation Distribution Drift: Quantization errors accumulate across layers during inference, causing the intermediate layer activations of the quantized model to diverge significantly from the original full-precision model.

DFQ-ViT tackles both issues to enable accurate post-training quantization without needing a single real image or a single epoch of retraining.

Methods

The authors propose a two-pronged forward calibration pipeline:

1. Easy to Hard (E2H) Sample Synthesis

Instead of using a fixed crop size during data generation, the E2H strategy adopts a curriculum learning approach. It starts with large image crops to capture global object contours ("easy" tasks) and progressively reduces the crop size over synthesis iterations. This forces the generator to focus on fine, pixel-level local textures ("hard" tasks), resulting in much higher-quality synthetic images that better mimic real data distributions.

Fig. 1. Comparison of sample synthesis strategies. (a) Existing methods use fixed maximum crop size which primarily captures global features but lacks local details. (b) Our proposed Easy to Hard (E2H) strategy progressively reduces crop size during synthesis iterations. The dynamic cropping first establishes object contours through large crops (easy tasks) then refines local details via smaller crops (hard tasks). This curriculum learning approach better balances global-local feature learning compared to fixed-crop methods.

2. Activation Correction Matrix (ACM)

To prevent quantization errors from compounding layer by layer, the authors introduce a forward calibration step. By passing a small number of synthetic samples through both the full-precision and quantized models, they calculate the mean discrepancy between their intermediate activations. This discrepancy is stored as a lightweight, additive Activation Correction Matrix (ACM). During inference, the ACM is simply added to the quantized model's activations to realign them with the full-precision baseline.

Datasets

The method was validated across three widely used image classification benchmarks:

  • ImageNet-1k
  • CIFAR-10
  • CIFAR-100

Key Insights and Ideas

  • Curriculum Learning for Data Synthesis: Generating synthetic data isn't just about matching raw statistics; the order of feature complexity matters. Establishing global contours before refining local details yields significantly more effective calibration samples.
  • Correction Over Retraining: You don't need to spend massive compute retraining model weights to fix quantization drift. A simple, additive bias correction at intermediate layers can achieve the same alignment at a fraction of the cost.
  • Negligible Parameter Overhead: The ACM introduces almost zero storage overhead—accounting for as little as 0.002% to 0.020% of the original model parameters—and adds no noticeable latency during inference.

Key Results

DFQ-ViT was evaluated on several popular architectures, including DeiT (T/S/B) and Swin (T/S), consistently outperforming existing data-free methods:

  • Substantial Accuracy Gains: For ultra-low 3-bit weight quantization (W3/A8) on DeiT-T, DFQ-ViT achieved a Top-1 accuracy of 27.97%, outperforming the state-of-the-art data-free method (PSAQ-ViT) by 4.29%.
  • Beating Real-Data Calibration: Under 4-bit weight quantization (W4/A8) on DeiT-T, DFQ-ViT achieved 65.84% Top-1 accuracy, actually surpassing the accuracy of the model calibrated with real data (65.38%).
  • Green Learning Efficiency: Because it operates entirely via forward calibration and avoids backpropagation/fine-tuning, DFQ-ViT drastically reduces computational overhead and energy consumption during deployment.

Limitations and Future Work

Not explicitly discussed in the paper. The authors focus entirely on demonstrating the efficacy and efficiency of their pipeline across various bit-widths and architectures without detailing specific failure modes or explicit future directions.

Summary updated

BibTeX
@misc{tong2025dfq,
  author = {Yujia Tong and Jingling Yuan and Tian Zhang and Jianquan Liu and Chuang Hu},
  title = {{DFQ-ViT: Data-Free Quantization for Vision Transformers without Fine-tuning}},
  year = {2025},
  eprint = {2507.14481},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.14481},
}
Figure