Distilling Vision-Language Foundation Models: A Data-Free Approach via Prompt Diversification

Yunyi Xuan, Weijie Chen, Shicai Yang, Di Xie, Luojun Lin, Yueting Zhuang · DOI

Introduction

Foundation models like CLIP have redefined the landscape of computer vision, demonstrating remarkable "zero-shot" capabilities across diverse visual domains—from standard photography to abstract art and sketches. However, the sheer scale of these models presents a significant barrier to deployment on edge devices such as smartphones or IoT sensors.

Traditional Knowledge Distillation (KD), where a compact "student" model is trained to mimic a large "teacher" model, typically relies on the original training data. For models like CLIP, this data consists of billions of private image-text pairs, making standard KD impossible for most researchers and developers. Data-Free Knowledge Distillation (DFKD) offers a solution by synthesizing "surrogate" data directly from the teacher's weights. Yet, existing DFKD methods often suffer from "mode collapse," producing repetitive, low-diversity images that fail to capture the broad generalization power of vision-language foundation models (VLFMs).

The DFKD-VLFM Framework

In their paper, Xuan et al. introduce DFKD-VLFM, a novel approach designed to distill the rich internal priors of VLFMs into lightweight architectures without requiring any real-world training data. The core innovation lies in Prompt Diversification, a strategy that leverages the text encoder of the foundation model to drive the synthesis of highly varied visual data.

![Overview of the DFKD-VLFM pipeline:

  1. Synthesize surrogate data via prompt diversification, 2. Distill knowledge from teacher to student, 3. Generalize to agnostic domains.](/figures/art_47455e6dfa75429d8cfefd017180cd5a) Distilling Vision-Language Foundation Models: A Data-Free Approach via Prompt Diversification, page 1

Methodology: Prompt Diversification

The authors utilize VQGAN-CLIP as the underlying engine for image synthesis. To overcome the limitations of static prompts (e.g., "a photo of a dog"), they propose three distinct levels of diversification to explore the model's latent "style space":

  1. Mix-Prompt: By interpolating between the embeddings of 86 predefined style words (such as "origami" or "pop art"), the system generates images in hybrid, novel styles.
  2. Random-Prompt: This method treats the text embedding space as a continuous distribution. By sampling "pseudo-words" from a Gaussian distribution modeled on the text encoder’s codebook, the model explores abstract visual concepts that lack human-readable labels.
  3. Contrastive-Prompt: As the most effective variant, this method employs a memory bank and a contrastive loss function to ensure that each newly generated prompt is maximally different from previous ones. This "push" mechanism forces the synthesis process to cover the furthest reaches of the model's knowledge, effectively preventing mode collapse.

Experimental Results and Generalization

The distilled student models (e.g., ResNet18) were evaluated on four rigorous Domain Generalization (DG) benchmarks: PACS, VLCS, ImageCLEF-DA, and VisDA. These benchmarks test a model's ability to handle significant distribution shifts, such as recognizing a category across different artistic mediums.

An example of the "Art painting" domain from the PACS benchmark, illustrating the type of stylistic shift the distilled model must handle.

Key Findings:

  • Superior Performance: On the PACS dataset, the Contrastive-Prompt method achieved an average accuracy of 76.59% using a ResNet18 student, a massive leap from the 52.81% achieved by baseline DFKD approaches.
  • Outperforming ImageNet Pre-training: In few-shot learning scenarios (using 1-16 real images), the DFKD-VLFM student consistently outperformed standard models pre-trained on ImageNet. This indicates that the distilled student successfully inherited CLIP’s broad "world knowledge" rather than just learning to fit a specific dataset.
  • Diversity over Realism: Interestingly, the authors found that the synthetic images do not need to be photorealistic to be effective. Instead, the diversity of features and textures in the "surreal" synthetic data proved more valuable for training a robust, generalizable student.

Conclusion

DFKD-VLFM demonstrates that the bottleneck in data-free distillation is not the capacity of the image generator, but the diversity of the prompts used to query the teacher. By treating the text encoder as a bridge to the model's internal priors, Xuan et al. have provided a path toward deploying the power of massive foundation models on resource-constrained devices, all while maintaining privacy and robustness across agnostic domains.

Reference: Xuan, Y., Chen, W., Yang, S., Xie, D., Lin, L., & Zhuang, Y. (2024). Distilling Vision-Language Foundation Models: A Data-Free Approach via Prompt Diversification. arXiv:2407.15155v1.

Summary updated

BibTeX
@inproceedings{xuan2023distilling,
  author = {Yunyi Xuan and Weijie Chen and Shicai Yang and Di Xie and Luojun Lin and Yueting Zhuang},
  title = {{Distilling Vision-Language Foundation Models: A Data-Free Approach via Prompt Diversification}},
  booktitle = {ACM Multimedia},
  year = {2023},
  doi = {10.1145/3581783.3611911},
}
Figure