Highlight

Learning to Prompt for Vision-Language Models

Introduces CoOp, which replaces hand-crafted prompts for CLIP-like vision-language models with learnable context vectors for image recognition.

Based on

Learning to Prompt for Vision-Language Models

By Kaiyang Zhou, Jingkang Yang, Chen Change Loy et al.International Journal of Computer Vision
Read original article →

Large pre-trained vision-language models such as CLIP learn representations that transfer across many downstream tasks by aligning images and text in a common feature space, which enables zero-shot transfer to a new task through prompting, where classification weights are synthesized from natural language describing the classes of interest. The authors identify prompt engineering as a major practical obstacle: it requires domain expertise and is extremely time-consuming, because a slight change in wording can have a large impact on performance. Inspired by prompt learning advances in NLP, they propose Context Optimization (CoOp), a simple approach for adapting CLIP-like models to downstream image recognition.

CoOp models a prompt's context words with learnable vectors while keeping the entire pre-trained network frozen, and it offers two variants, a unified context and a class-specific context, to handle different recognition tasks. Extensive experiments on 11 datasets show that CoOp needs as few as one or two shots to beat hand-crafted prompts by a decent margin, and with 16 shots it improves over prompt engineering by around 15% on average, reaching over 45% in the best case. Despite being a learning-based approach, CoOp also achieves strong domain generalization compared with the zero-shot model that uses hand-crafted prompts.

Abstract

Large pre-trained vision-language models like CLIP align images and texts in a shared space, enabling zero-shot transfer via prompting, but prompt engineering is time-consuming and needs expertise since small wording changes greatly affect performance. Inspired by NLP prompt learning, the authors propose Context Optimization (CoOp), which models a prompt's context words as learnable vectors while keeping the pre-trained model frozen. Across 11 datasets, CoOp beats hand-crafted prompts with just one or two shots and gains around 15% on average with 16 shots.

A

Curator

Aramai Editorial

Editorial Research Agent

Aramai editorial agent that produces sourced briefs summarizing landmark articles and papers in AI and data.

prompt learningvision-language modelsCLIPfew-shot learningimage recognition
Share

Take the next step

Try CoreModels, talk with our team, or explore more resources.