Make Prompts Adaptable: Bayesian Modeling for Vision-Language Prompt Learning with Data-Dependent Prior

Youngjae Cho, HeeSun Bae, Seungjae Shin, Yeo Dong Youn, Weonyoung Joo, Il-Chul Moon

Abstract

Vision-Language Pretrained (VLP) models like CLIP have revolutionized downstream tasks but often struggle with overfitting and generalization when fine-tuned on limited data. This paper introduces Adaptive Particle-based Prompt Learning (APP), a Bayesian framework that replaces static context vectors with a distribution of adaptive particles. By employing a data-dependent prior and Wasserstein Gradient Flow, APP captures the complex, multi-modal nature of image features, significantly improving performance on both seen and unseen instances without the typical trade-offs.

The Challenge of Static Prompts

VLP models are typically used as frozen backbones. To adapt them to specific tasks, researchers use prompt learning (e.g., CoOp), which adds learnable "context vectors" to the text input. However, this standard approach faces three critical hurdles:

  1. Few-Shot Overfitting: In data-scarce scenarios, Maximum Likelihood Estimation (MLE) causes prompts to overfit dominant image features in the training set, harming generalization to new data.
  2. The Multi-modal Gap: Visual categories are inherently diverse (e.g., the category "dog" includes many breeds and environments). A single static prompt often fails to represent these multiple "modes," focusing instead on a narrow average.
  3. Distribution Shifts: Static prompts lack the flexibility to adapt to domain shifts or entirely new classes encountered at inference time.

The APP Framework: Bayesian Adaptation

APP shifts the paradigm from point estimation to Bayesian inference, modeling prompts as a distribution rather than a single vector.

Overview of the APP framework showing the Learnable Context Vectors and the Prior Network.

Data-Dependent Prior

Unlike traditional methods that use a fixed starting point, APP utilizes a Prior Network ($\phi$). This network maps image features directly to the prompt space, providing a data-informed "starting guess" that enhances adaptability to specific visual content. This ensures the prompt is already grounded in the visual context before optimization.

Particle-based Optimization

To approximate the complex posterior distribution of prompts, APP employs Stein Variational Gradient Descent (SVGD). Multiple context vectors, or "particles," are optimized via two competing forces:

  • Force #1 (Prior-based Regularization): Pulls particles toward regions of high probability based on the accuracy of the task and the data-dependent prior.
  • Force #2 (Repulsive Force): Prevents particles from collapsing into a single redundant point, ensuring they spread out to cover different modes of the image feature distribution.

Experimental Evaluation

The authors evaluated APP across a massive battery of 11 benchmark datasets, including ImageNet, OxfordPets, and EuroSAT, focusing on few-shot learning and domain generalization.

Performance comparison of APP against state-of-the-art baselines across 11 benchmark datasets.

Key Results

  • Superior Few-Shot Performance: APP outperformed state-of-the-art baselines like CoOp, CoCoOp, and ProDA in 45 out of 55 experimental settings (across 1, 2, 4, 8, and 16-shot scenarios).
  • Generalization without Trade-offs: In base-to-new generalization tests, APP consistently improved accuracy for both seen (Base) and unseen (New) classes, achieving significantly higher Harmonic Mean scores. This effectively ends the common trade-off where improving generalization degrades base performance.
  • Robustness to Domain Shift: On ImageNet variants (V2, Sketch, Adversarial, Renditions), APP's Bayesian adaptation proved more resilient to stylistic and environmental changes than static methods.

Conclusion

Adaptive Particle-based Prompt Learning (APP) addresses the fundamental limitations of static prompt learning by embracing the diversity of visual data. Through its Bayesian framework and data-dependent prior, APP enables VLP models to generalize better and adapt more fluidly to the complexities of real-world vision tasks. Future work may extend this particle-based approach to broader multi-modal applications like image captioning and visual reasoning.

Code available at: https://github.com/youngjae-cho/APP

Summary updated

BibTeX
@inproceedings{cho2024make,
  author = {Youngjae Cho and HeeSun Bae and Seungjae Shin and Yeo Dong Youn and Weonyoung Joo and Il-Chul Moon},
  title = {{Make Prompts Adaptable: Bayesian Modeling for Vision-Language Prompt Learning with Data-Dependent Prior}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  url = {https://openreview.net/forum?id=zaIOtGVhj5},
}
Figure