A Simple Zero-shot Prompt Weighting Technique to Improve Prompt Ensembling in Text-Image Models
James Urquhart Allingham, Jie Ren, Michael W. Dusenberry, Xiuye Gu, Yin Cui, Dustin Tran, Jeremiah Zhe Liu, Balaji Lakshminarayanan
Abstract
Contrastively trained text-image models have the remarkable ability to perform zero-shot classification, that is, classifying previously unseen images into categories that the model has never been explicitly trained to identify. However, these zero-shot classifiers need prompt engineering to achieve high accuracy. Prompt engineering typically requires hand-crafting a set of prompts for individual downstream tasks. In this work, we aim to automate this prompt engineering and improve zero-shot accuracy through prompt ensembling. In particular, we ask "Given a large pool of prompts, can we automatically score the prompts and ensemble those that are most suitable for a particular downstream dataset, without needing access to labeled validation data?". We demonstrate that this is possible. In doing so, we identify several pathologies in a naive prompt scoring method where the score can be easily overconfident due to biases in pre-training and test data, and we propose a novel prompt scoring method that corrects for the biases. Using our proposed scoring method to create a weighted average prompt ensemble, our method outperforms an equal average ensemble, as well as hand-crafted prompts, on ImageNet, 4 of its variants, and 11 fine-grained classification benchmarks, all while being fully automatic, optimization-free, and not requiring access to labeled validation data.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Cited by top-tier papers17
- C-TPT: Calibrated Test-Time Prompt Tuning for Vision-Language Models via Text Feature DispersionHee Suk Yoon, Eunseop Yoon, Joshua Tian Jin Tee, Mark A. Hasegawa-Johnson et al.ICLR 2024 · 84 citations
- Generalized Logit Adjustment: Calibrating Fine-tuned Models by Removing Label Bias in Foundation ModelsBeier Zhu, Kaihua Tang, Qianru Sun, Hanwang ZhangNeurIPS 2023 · 50 citations
- Enhancing Zero-Shot Vision Models by Label-Free Prompt Distribution Learning and Bias CorrectingXingyu Zhu, Beier Zhu, Yi Tan, Shuo Wang et al.NeurIPS 2024 · 36 citations
- Distribution Alignment Optimization through Neural Collapse for Long-tailed ClassificationJintong Gao, He Zhao, Dandan Guo, Hongyuan ZhaICML 2024 · 27 citations
- Latte: Collaborative Test-Time Adaptation of Vision-Language Models in Federated LearningWenxuan Bao, Ruxi Deng, Ruizhong Qiu, Tianxin Wei et al.ICCV 2025 · 13 citations
Builds on13
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh et al.ICML 2021 · 47,906 citations
- Scaling Up Visual and Vision-Language Representation Learning With Noisy Text SupervisionChao Jia, Yinfei Yang, Ye Xia, Yi-Ting Chen et al.ICML 2021 · 5,401 citations
- The Many Faces of Robustness: A Critical Analysis of Out-of-Distribution GeneralizationDan Hendrycks, Steven Basart, Norman Mu, Saurav Kadavath et al.ICCV 2021 · 2,294 citations
- Scaling Out-of-Distribution Detection for Real-World SettingsDan Hendrycks, Steven Basart, Mantas Mazeika, Andy Zou et al.ICML 2022 · 653 citations
Related papers
- CARPRT: Class-Aware Zero-Shot Prompt Reweighting for Vision-Language ModelRuijiang Dong, Zesheng Ye, Jianzhong Qi, Lei Feng et al.ICLR 2026
- Test-Time Prompt Tuning for Zero-Shot Generalization in Vision-Language ModelsManli Shu, Weili Nie, De-An Huang, Zhiding Yu et al.NeurIPS 2022 · 603 citations
- Robust Test-Time Adaptation for Zero-Shot Prompt TuningDingchu Zhang, Zhi Zhou, Yufeng LiAAAI 2024 · 15 citations
- Understanding prompt engineering may not require rethinking generalizationVictor Akinwande, Yiding Jiang, Dylan Sam, J. Zico KolterICLR 2024 · 13 citations
- LaFTer: Label-Free Tuning of Zero-shot Classifier using Language and Unlabeled Image CollectionsMuhammad Jehanzeb Mirza, Leonid Karlinsky, Wei Lin, Horst Possegger et al.NeurIPS 2023 · 63 citations
