Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Bayesian Prompt Learning for Image-Language Model Generalization

About

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

Mohammad Mahdi Derakhshani, Enrique Sanchez, Adrian Bulat, Victor Guilherme Turrisi da Costa, Cees G. M. Snoek, Georgios Tzimiropoulos, Brais Martinez• 2022

Related benchmarks

TaskDatasetResultRank
Image ClassificationImageNet A
Top-1 Acc51.33
553
Image ClassificationEuroSAT
Accuracy45.87
497
Image ClassificationFood-101
Accuracy86.3
494
Image ClassificationImageNet V2
Top-1 Acc64.23
487
Image ClassificationDTD
Accuracy46.1
487
Image ClassificationFlowers102
Accuracy70.9
478
Image ClassificationImageNet-R
Top-1 Acc77
474
Image ClassificationImageNet--
429
Image ClassificationSUN397
Accuracy67.47
425
Image ClassificationUCF101
Top-1 Acc68.67
404
Showing 10 of 67 rows

Other info

Code

Follow for update