Command Palette
Search for a command to run...
Mohammad Mahdi Derakhshani Enrique Sanchez Adrian Bulat Victor Guilherme Turrisi da Costa Cees G. M. Snoek Georgios Tzimiropoulos Brais Martinez

Abstract
Foundational image-language models have generated considerable interest due to their efficient adaptation to downstream tasks by prompt learning. Prompt learning treats part of the language model input as trainable while freezing the rest, and optimizes an Empirical Risk Minimization objective. However, Empirical Risk Minimization is known to suffer from distributional shifts which hurt generalizability to prompts unseen during training. By leveraging the regularization ability of Bayesian methods, we frame prompt learning from the Bayesian perspective and formulate it as a variational inference problem. Our approach regularizes the prompt space, reduces overfitting to the seen prompts and improves the prompt generalization on unseen prompts. Our framework is implemented by modeling the input prompt space in a probabilistic manner, as an a priori distribution which makes our proposal compatible with prompt learning approaches that are unconditional or conditional on the image. We demonstrate empirically on 15 benchmarks that Bayesian prompt learning provides an appropriate coverage of the prompt space, prevents learning spurious features, and exploits transferable invariant features. This results in better generalization of unseen prompts, even across different datasets and domains. Code available at: https://github.com/saic-fi/Bayesian-Prompt-Learning
Code Repositories
Benchmarks
| Benchmark | Methodology | Metrics |
|---|---|---|
| few-shot-learning-on-caltech101 | Variational Prompt Tuning | Harmonic mean: 96.44 |
| few-shot-learning-on-dtd | Variational Prompt Tuning | Harmonic mean: 67.27 |
| few-shot-learning-on-eurosat | Variational Prompt Tuning | Harmonic mean: 77.71 |
| few-shot-learning-on-fgvc-aircraft-1 | Variational Prompt Tuning | Harmonic mean: 34.69 |
| few-shot-learning-on-flowers-102 | Variational Prompt Tuning | Harmonic mean: 81.12 |
| few-shot-learning-on-food101 | Variational Prompt Tuning | Harmonic mean: 91.57 |
| few-shot-learning-on-oxfordpets | Variational Prompt Tuning | Harmonic mean: 96.82 |
| few-shot-learning-on-stanforcars | Variational Prompt Tuning | Harmonic mean: 73.07 |
| few-shot-learning-on-sun397 | Variational Prompt Tuning | Harmonic mean: 78.51 |
| few-shot-learning-on-ucf101 | Variational Prompt Tuning | Harmonic mean: 79 |
Build AI with AI
From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.