Soft Prompt Generation for Domain Generalization
Shuanghao Bai, Yuedi Zhang, Wanqi Zhou, Zhirong Luan, Badong Chen
TL;DR
This paper tackles domain generalization for vision–language models by replacing fixed prompts with a generative prompt generator. It introduces Soft Prompt Generation (SPG), a two-stage training framework using domain prompt labels and a conditional GAN to produce instance-specific, domain-aware prompts for unseen domains. The approach yields state-of-the-art results across five DG benchmarks and three tasks, outperforming traditional DG methods and CLIP-based prompt-tuning baselines, with extensive ablations and visualizations supporting the method. The work highlights the potential of generative prompt generation to enhance cross-domain transfer and encourages further integration of generative models into prompt learning for VLMs.
Abstract
Large pre-trained vision language models (VLMs) have shown impressive zero-shot ability on downstream tasks with manually designed prompt. To further adapt VLMs to downstream tasks, soft prompt is proposed to replace manually designed prompt, which undergoes fine-tuning based on specific domain data. Prior prompt learning methods primarily learn a fixed prompt or residuled prompt from training samples. However, the learned prompts lack diversity and ignore information about unseen domains. In this paper, we reframe the prompt learning framework from a generative perspective and propose a simple yet efficient method for the Domain Generalization (DG) task, namely Soft Prompt Generation (SPG). Specifically, SPG consists of a two-stage training phase and an inference phase. During the training phase, we introduce soft prompt label for each domain, aiming to incorporate the generative model domain knowledge. During the inference phase, the generator of the generative model is employed to obtain instance-specific soft prompts for the unseen target domain. Extensive experiments on five domain generalization benchmarks of three DG tasks demonstrate that SPG achieves state-of-the-art performance. The code is available at https://github.com/renytek13/Soft-Prompt-Generation-with-CGAN.
