Prompt Tuning with Soft Context Sharing for Vision-Language Models

Kun Ding, Ying Wang, Pengzhang Liu, Qiang Yu, Haojian Zhang +2 more
8/29/2022
cs.CVcs.AI
lora-peft-merging

Official code: kding1225/softcpt (8 stars, Python, MIT, last commit 2025-08-03).

Abstract

Vision-language models have recently shown great potential on many tasks in computer vision. Meanwhile, prior work demonstrates prompt tuning designed for vision-language models could acquire superior performance on few-shot image recognition compared to linear probe, a strong baseline.

Show full abstract

In practice, many few-shot tasks are inherently correlated, particularly within specialized domains. However, such information is overlooked previously. Inspired by the fact that modeling task relationship by multi-task learning can usually boost performance, we propose a novel method SoftCPT (Soft Context Sharing for Prompt Tuning) to tune pre-trained vision-language models on multiple target few-shot tasks jointly. Specifically, we design a task-shared meta network to generate prompt context for each task using task name together with a learnable task context as input. The parameters of this meta network as well as the task context are tuned on the joint training set of all tasks. As such, the prompt context of all tasks will be shared in a soft manner. Extensive experiments across four multi-task few-shot datasets covering 44 tasks and 1593 categories demonstrate that SoftCPT significantly outperforms single-task prompt tuning methods, highlighting the effectiveness of multi-task learning for vision-language prompt tuning. Code is available at https://github.com/kding1225/softcpt.

View on arXivView PDF

Code Implementations(1)

kding1225/softcptOfficial100%
MIT

Prompt Tuning with Soft Context Sharing for Vision-Language Models

80Python, ShellMar 9, 20231 years agoMIT

Similar Papers

Cite this paper

@article{ding2022prompt,
  title  = {Prompt Tuning with Soft Context Sharing for Vision-Language Models},
  author = {Kun Ding and Ying Wang and Pengzhang Liu and Qiang Yu and Haojian Zhang and Shiming Xiang and Chunhong Pan},
  year   = {2022},
  eprint = {2208.13474},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2208.13474}
}

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/2208.13474.svg)](https://codeofpaper.com/paper/2208.13474)

Discussion