arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2205.14865cs.CV
收藏

用于提示调优的提示对齐梯度

Prompt-aligned Gradient for Prompt Tuning

Nanyang Technological University(南洋理工大学);Columbia University(哥伦比亚大学);Damo Academy, Alibaba Group(阿里集团大模型学院)

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

AI总结:

本文提出ProGrad方法,通过仅更新与预定义提示预测KL损失梯度对齐的提示梯度,防止提示调优遗忘VLM通用知识,显著提升了少样本泛化能力。

摘要:

得益于像CLIP这样的大型预训练视觉语言模型(VLMs),我们可以通过“提示”构建一个零样本分类器,例如,一张图像属于“[CLASS]”的置信度得分,可以通过使用VLM提供的图像与提示句子“a photo of a [CLASS]”之间的相似度度量来获得。因此,如果我们对基于提示的相似度度量进行微调,提示就展现出了将VLM快速适应到下游任务的巨大潜力。然而,我们发现了一个常见的失败情况:不当的微调不仅可能破坏提示对任务相关类别的固有预测,还可能破坏对VLM词汇表中其他类别的预测。现有方法仍然通过使用传统的反过拟合技术(如早停和数据增强)来解决这个问题,这些方法缺乏针对提示的特定原则性解决方案。我们提出了Prompt-aligned Gradient(简称ProGrad),以防止提示调优遗忘从VLM中学到的通用知识。具体而言,ProGrad仅更新其梯度与“通用方向”对齐(或不冲突)的提示,该通用方向被表示为预定义提示预测的KL损失的梯度。大量实验表明,与最先进的提示调优方法相比,ProGrad具有更强的少样本泛化能力。代码可在https://github.com/BeierZhu/Prompt-align获取。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑