Bayesian Prompt Learning for Image-Language Model Generalization

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

PDF Abstract ICCV 2023 PDF ICCV 2023 Abstract

Results from the Paper


Task Dataset Model Metric Name Metric Value Global Rank Result Benchmark
Few-Shot Learning Caltech101 Variational Prompt Tuning Harmonic mean 96.44 # 1
Few-Shot Learning DTD Variational Prompt Tuning Harmonic mean 67.27 # 1
Few-Shot Learning EuroSAT Variational Prompt Tuning Harmonic mean 77.71 # 1
Few-Shot Learning FGVC Aircraft Variational Prompt Tuning Harmonic mean 34.69 # 1
Few-Shot Learning Flowers-102 Variational Prompt Tuning Harmonic mean 81.12 # 1
Few-Shot Learning food101 Variational Prompt Tuning Harmonic mean 91.57 # 1
Few-Shot Learning OxfordPets Variational Prompt Tuning Harmonic mean 96.82 # 1
Few-Shot Learning StanforCars Variational Prompt Tuning Harmonic mean 73.07 # 1
Few-Shot Learning SUN397 Variational Prompt Tuning Harmonic mean 78.51 # 1
Few-Shot Learning UCF101 Variational Prompt Tuning Harmonic mean 79 # 1

Methods