Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

Prompt-aligned Gradient for Prompt Tuning

About

Thanks to the large pre-trained vision-language models (VLMs) like CLIP, we can craft a zero-shot classifier by "prompt", e.g., the confidence score of an image being "[CLASS]" can be obtained by using the VLM provided similarity measure between the image and the prompt sentence "a photo of a [CLASS]". Therefore, prompt shows a great potential for fast adaptation of VLMs to downstream tasks if we fine-tune the prompt-based similarity measure. However, we find a common failure that improper fine-tuning may not only undermine the prompt's inherent prediction for the task-related classes, but also for other classes in the VLM vocabulary. Existing methods still address this problem by using traditional anti-overfitting techniques such as early stopping and data augmentation, which lack a principled solution specific to prompt. We present Prompt-aligned Gradient, dubbed ProGrad, to prevent prompt tuning from forgetting the the general knowledge learned from VLMs. In particular, ProGrad only updates the prompt whose gradient is aligned (or non-conflicting) to the "general direction", which is represented as the gradient of the KL loss of the pre-defined prompt prediction. Extensive experiments demonstrate the stronger few-shot generalization ability of ProGrad over state-of-the-art prompt tuning methods. Codes are available at https://github.com/BeierZhu/Prompt-align.

Beier Zhu, Yulei Niu, Yucheng Han, Yue Wu, Hanwang Zhang• 2022

Related benchmarks

TaskDatasetResultRank
Image ClassificationImageNet 1k (test)
Top-1 Accuracy72.1
880
Image ClassificationImageNet V2--
749
Image ClassificationImageNet A
Top-1 Acc23.05
698
Image ClassificationStanford Cars
Accuracy82.9
660
Image ClassificationDTD
Accuracy39.42
599
Image ClassificationImageNet-R
Top-1 Acc74.58
581
Image ClassificationFood-101
Accuracy85.4
570
Image ClassificationEuroSAT
Accuracy43.46
569
Image ClassificationFlowers102
Accuracy95.78
558
Image ClassificationUCF101
Top-1 Acc82.7
527
Showing 10 of 215 rows
...

Other info

Follow for update