Skip to main content
QUICK REVIEW

[論文レビュー] Prompt-aligned Gradient for Prompt Tuning

Beier Zhu, Yulei Niu|arXiv (Cornell University)|May 30, 2022
Multimodal Machine Learning ApplicationsComputer Science被引用数 17
ひとこと要約

本稿では、CLIPのようなビジョン・ランゲージモデルが少サンプル微調整中に一般知識を忘れないようにするため、ゼロショット予測から導出される一般知識方向に最適化更新を整合させる、Prompt-aligned Gradient (ProGrad) と呼ばれる新しいプロンプトチューニング手法を提案する。ProGradは、複数のベンチマークで少サンプル一般化性能を向上させ、ベース・トゥ・ニューグループ化タスクにおける調和平均精度で、最先端手法を最大4.5%上回る。

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.

研究の動機と目的

  • 少数のサンプルでの微調整によってゼロショットベースラインを下回る性能低下が生じるプロンプトチューニングの失敗モードに対処すること。
  • 早期停止やデータオーグメンテーションのような従来の正則化手法には、プロンプトチューニングのダイナミクスに基づく明確な根拠が欠けているという制限を克服すること。
  • プロンプトチューニング中に事前学習済みビジョン・ランゲージモデル(例:CLIP)に埋め込まれた一般知識を保持し、壊滅的忘却を防ぐこと。
  • 更新方向が一般知識方向と整合する場合にのみ、プロンプトを更新する勾配ベースの正則化機構を開発すること。
  • ドメイン固有の知識と一般知識の方向の整合性を強制することで、低データ環境、ドメイン一般化、クロスデータセット転送におけるモデルの頑健性を向上させること。

提案手法

  • ゼロショットCLIP予測と少サンプル微調整済みモデルの予測の間のKLダイバージェンスの勾配として、一般知識方向 $\bm{G}_{\text{g}}$ を定義する。
  • 正解ラベルと微調整済みモデルの予測の間の交差エントロピー損失の勾配として、ドメイン固有の方向 $\bm{G}_{\text{d}}$ を計算する。
  • $\bm{G}_{\text{g}}$ に平行な成分 $\bm{G}_{\parallel}$(整合する知識)と、垂直な成分 $\bm{G}_{\perp}$(衝突しない知識)に $\bm{G}_{\text{d}}$ を直交分解する。
  • $\bm{G}_{\parallel}$ が $\bm{G}_{\text{g}}$ と反対方向を向いている場合、一般知識と衝突するため、その更新を破棄する。
  • $\bm{G}_{\parallel}$ が $\bm{G}_{\text{g}}$ と整合する場合、プロンプトパラメータを $\bm{G}_{\parallel}$ の方向に、$\bm{G}_{\perp}$ の方向に更新することで、一般知識と衝突しないように保証する。
  • 各訓練ステップでこの手法を適用し、フォアグラウンドオブジェクトに注目を保ち、バックグラウンドパターンへの過学習を防ぐ。
Figure 1 : Comparison of Zero-shot CLIP, CoOp, and our ProGrad on Stanford Cars and OxfordPets datasets. (a)&(b): Given 1 shot training sample, CoOp’s performance severely drops and under-performs zero-shot CLIP by large margins when the training continues. (c)&(d): CoOp may fail to improve CLIP wit
Figure 1 : Comparison of Zero-shot CLIP, CoOp, and our ProGrad on Stanford Cars and OxfordPets datasets. (a)&(b): Given 1 shot training sample, CoOp’s performance severely drops and under-performs zero-shot CLIP by large margins when the training continues. (c)&(d): CoOp may fail to improve CLIP wit

実験結果

リサーチクエスチョン

  • RQ1訓練サンプル数が極めて限られた状況下で、勾配ベースの正則化が少サンプルプロンプトチューニング性能を向上させられるか。
  • RQ2ゼロショット予測からの一般知識方向とプロンプト更新を整合させることで、ゼロショットベースラインを下回る性能低下を防げるか。
  • RQ3少サンプル、ドメイン一般化、ベース・トゥ・ニューマッピングの設定において、ProGradは既存のプロンプトチューニング手法(例:CoOp, CoCoOp)と比較してどのように一般化性能を発揮するか。
  • RQ4Grad-CAMの可視化によって示されるように、ProGradはフォアグラウンドオブジェクトへの注目をどの程度維持しているか。
  • RQ5追加のデータオーグメンテーションを必要とせず、低データ環境下で、ProGradが既存の知識蒸留法や勾配マスキング法を上回る性能を発揮できるか。

主な発見

  • ProGradは11のデータセットにおけるベース・トゥ・ニューグループ化タスクで、調和平均精度69.06%を達成し、CoOp(65.58%)とCoCoOp(65.35%)を3.5ポイント以上上回った。
  • スタンフォード・カーズデータセットでは、4ショット少サンプル学習下でProGradが調和平均精度63.66%を達成し、CoOp(62.14%)とCoCoOp(60.82%)を上回った。
  • ドメイン一般化設定では、ResNet50およびViT-B/16モデルにおいてCoOpと比較して1.0~1.5%の精度向上を達成し、ImageNetのバリエーションすべてで一貫した向上が見られた。
  • Grad-CAMの可視化結果から、ProGradはフォアグラウンドオブジェクトに注目を維持しているのに対し、CoOpは矛盾する更新のためバックグラウンド領域に注目が移る傾向にあった。
  • ProGradはCoOp + KDおよびCoOp + GMを上回り、知識蒸留や勾配マスキングに比べて、一般知識の保持に優れた勾配整合メカニズムを有していることが示された。
  • Caltech101データセットでは、4ショット設定下でProGradが調和平均精度92.46%を達成し、CoOp(90.80%)とCoCoOp(91.00%)を顕著に上回った。
Figure 2 : Comparisons of Grad-CAM [ 43 ] visualization for prompt tuning methods using different gradient strategies on Stanford Cars Datasets.
Figure 2 : Comparisons of Grad-CAM [ 43 ] visualization for prompt tuning methods using different gradient strategies on Stanford Cars Datasets.

この論文を読む

Nubintのビューアで原文を開き、読みながら気になる箇所をすぐに質問できます。

Nubintでこの論文を読む

このレビューはAIが論文の原文をもとに作成しました。引用する前に原文をご確認ください。