Soft Prompt Generation for Domain Generalization

Shuanghao Bai, Yuedi Zhang, Wanqi Zhou, Zhirong Luan, Badong Chen
2/14/2026

No official code found. Best implementation: renytek13/Soft-Prompt-Generation (33 stars, MIT, last commit 2024-10-01).

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.

View on arXivView PDF

Code Implementations(1)

MIT

[ECCV 2024] Soft Prompt Generation for Domain Generalization

332Shell, PythonMar 13, 20242 years agoMIT
cgandomain-generalizationprompt-generationprompt-tuningsoft-prompt-tuning

Similar Papers

Cite this paper

@article{bai2026soft,
  title  = {Soft Prompt Generation for Domain Generalization},
  author = {Shuanghao Bai and Yuedi Zhang and Wanqi Zhou and Zhirong Luan and Badong Chen},
  year   = {2026},
  eprint = {2404.19286},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2404.19286},
  journal = {ECCV 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2404.19286.svg)](https://codeofpaper.com/paper/2404.19286)

Discussion