Improving Visual Prompt Tuning for Self-supervised Vision Transformers

Seungryong Yoo, Eunji Kim, Dahuin Jung, Jungbeom Lee, Sungroh Yoon

TL;DR

Visual Prompt Tuning (VPT) is a popular, parameter-efficient way to adapt Vision Transformers (ViTs) to new tasks. However, it often underperforms when the backbone model is self-supervised. This paper introduces Gated Prompt Tuning, a method that uses learnable gates to automatically determine which parts of a pretrained model should interact with prompts, significantly boosting performance across classification and segmentation tasks.

The Challenge with Self-Supervised Models

Adapting massive pretrained models to specific downstream tasks (like bird species classification or medical imaging) is computationally expensive. Visual Prompt Tuning (VPT) emerged as a solution: instead of updating the millions of parameters in a ViT, the model remains frozen, and only a few extra "prompt tokens" added to the input are trained.

While VPT works wonders for models trained with labels (supervised learning), it struggles with self-supervised models like MAE or MoCo v3. The authors discovered a fascinating reason why: supervised models discard "irrelevant" image information quickly as data moves through the layers, but self-supervised models retain rich, low-level information much longer.

Performance of prompt tuning varies drastically depending on the block index where prompts are inserted. Self-supervised models (MAE, MoCo v3) often prefer later blocks compared to supervised models.

In standard VPT, prompts interact with every single layer. For self-supervised models, this means prompts get "muddied" by interacting with too many irrelevant blocks. Manually searching for the "perfect" layer to insert prompts for every new task is a slow, trial-and-error nightmare.

The Solution: Gated Prompt Tuning

To solve this, the authors propose two main additions to the standard VPT framework:

  1. Gated Prompt Tuning: They introduce a learnable "gate" (a simple scalar value between 0 and 1) for every block in the ViT. This gate decides how much the current block’s features should influence the prompt tokens versus just passing the previous prompt information along. Effectively, the model learns to "skip" blocks that aren't helpful for the task and focus on the ones that are.
  2. Adaptive Attention Shaping: They add a learnable "temperature" parameter to the self-attention mechanism of each block. This allows the model to either "sharpen" the attention (focusing on specific patches) or "smooth" it out, helping the prompts better steer the frozen backbone.
Architecture of Gated Prompt Tuning. A learnable gate controls how much the current block updates the prompt tokens, allowing the model to selectively aggregate features.

Importantly, these additions are extremely lightweight, adding almost no overhead compared to the millions of parameters in the backbone.

Key Insights and Results

The researchers evaluated their method on a wide variety of computer vision benchmarks, including FGVC (Fine-Grained Visual Classification), VTAB-1K (19 diverse tasks), and ADE20K (semantic segmentation).

  • Information "Lifespan" Matters: Using Deep Image Prior (DIP) to visualize what different layers "see," the authors found that supervised models "forget" the original image much faster than self-supervised ones. This explains why self-supervised models need more precise control over where prompts are applied.
  • The "Optimal" Block is a Moving Target: The best layer to start prompting depends heavily on the task. For example, bird classification might need different layers than estimating distance in a driving scene. Gating automates this selection.
  • Massive Gains for MAE: On the FGVC benchmark, the method achieved an average accuracy of 73.39% with an MAE backbone, compared to just 57.84% for standard "shallow" VPT.
  • Superiority in Structure: On the VTAB "Structured" tasks (which involve understanding 3D layout), the method improved performance by over 10% compared to the strongest VPT baseline.
  • Efficiency: The authors showed that their gated approach with only 24 prompt tokens could outperform standard methods using 48 tokens, proving that how you use prompts is more important than how many you have.

Limitations and Future Work

While highly effective, the authors note a few areas for further exploration. The study primarily focused on the ViT-B/16 architecture, leaving room for extensive testing on "huge" models or different architectures like Swin Transformers. Additionally, the current gates are simple scalars; future work could investigate "input-dependent" gates that change their behavior based on the specific image being processed, potentially offering even finer control. Finally, the concept of gated prompting could potentially be translated back to Natural Language Processing (NLP), where prompt tuning originated.

Summary updated

BibTeX
@inproceedings{yoo2023improving,
  author = {Seungryong Yoo and Eunji Kim and Dahuin Jung and Jungbeom Lee and Sungroh Yoon},
  title = {{Improving Visual Prompt Tuning for Self-supervised Vision Transformers}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=1ZqavMwxxx},
}
Figure