Conditional Prompt Learning for Vision-Language Models

By Kaiyang Zhou, Jingkang Yang, Chen Change Loy, Ziwei Liu. 2022

2,313 citations recorded by the source corpus.

With the rise of powerful pre-trained vision-language models like CLIP, it becomes essential to investigate ways to adapt these models to downstream datasets. A recently proposed method named Context Optimization (CoOp) introduces the concept of prompt learning—a recent trend in NLP—to the vision domain for adapting pre-trained vision-language models. Specifically, CoOp turns context words in a prompt into a set of learnable vectors and, with only a few labeled images for learning, can achieve huge improvements over intensively-tuned manual prompts. In our study we identify a critical problem of CoOp: the learned context is not generalizable to wider unseen classes within the same dataset, suggesting that CoOp overfits base classes observed during training. To address the problem, we propose Conditional Context Optimization (CoCoOp), which extends CoOp by further learning a lightweight neural network to generate for each image an input-conditional token (vector). Compared to CoOp's static prompts, our dynamic prompts adapt to each instance and are thus less sensitive to class shift. Extensive experiments show that CoCoOp generalizes much better than CoOp to unseen classes, even showing promising transferability beyond a single dataset; and yields stronger domain generalization performance as well. Code is available at https://github.com/KaiyangZhou/CoOp.

Subfields: Artificial Intelligence, Computer Vision and Pattern Recognition, Prompting & Reasoning, Multimodal Learning

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Ziwei Liu
  2. Chen Change Loy
  3. Yu Qiao
  4. Hongsheng Li
  5. Peng Gao
  6. Tao A. Xiang
  7. Fahad Shahbaz Khan
  8. Ming-Hsuan Yang

In Computer Vision and Pattern Recognition

  1. Luc Van Gool
  2. Ming-Hsuan Yang
  3. Xiaogang Wang
  4. Dacheng Tao
  5. Chen Change Loy
  6. Yi Yang
  7. Yu Qiao
  8. Trevor Darrell

In Prompting & Reasoning

  1. Hongsheng Li
  2. Ziwei Liu
  3. Chen Change Loy
  4. Peng Gao
  5. Renrui Zhang
  6. Kaiyang Zhou
  7. Yu Qiao
  8. Li Sun

In Multimodal Learning

  1. Hongsheng Li
  2. Yu Qiao
  3. Peng Gao
  4. Chen Change Loy
  5. Renrui Zhang
  6. Ziwei Liu
  7. Kaiyang Zhou
  8. Eric P. Xing

Citations in the corpus