{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/prompt-aligned-gradient-for-prompt-tuning","title":"Prompt-aligned Gradient for Prompt Tuning","arxiv_id":"2205.14865","date":"2022-05-30","proceeding":"ICCV 2023 1","authors":["Beier Zhu","Yulei Niu","Yucheng Han","Yue Wu","Hanwang Zhang"],"abstract":"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.","url_abs":"https://arxiv.org/abs/2205.14865v3","url_pdf":"https://arxiv.org/pdf/2205.14865v3.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"prompt-aligned-gradient-for-prompt-tuning","repo_url":"https://github.com/beierzhu/prompt-align","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"domain-adaptation","task_name":"Domain Adaptation"},{"task_slug":"few-shot-learning","task_name":"Few-Shot Learning"},{"task_slug":"general-knowledge","task_name":"General Knowledge"},{"task_slug":"sentence","task_name":"Sentence"}],"methods":[{"method_slug":"clip","method_name":"CLIP"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2205.14865","mcp":null,"developers":"https://syntology.ai/developers"},"arxiv_metadata":null,"syntology_extracted_results":null}