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 Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
17 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Scaling Up Visual and Vision-Language Representation Learning With Noisy Text Supervision cites The Many Faces of Robustness: A Critical Analysis of Out-of-Distribution Generalization
- Scaling Up Visual and Vision-Language Representation Learning With Noisy Text Supervision cites Learning Transferable Visual Models From Natural Language Supervision
- Generalized Logit Adjustment: Calibrating Fine-tuned Models by Removing Label Bias in Foundation Models cites Scaling Up Visual and Vision-Language Representation Learning With Noisy Text Supervision
- Generalized Logit Adjustment: Calibrating Fine-tuned Models by Removing Label Bias in Foundation Models cites The Many Faces of Robustness: A Critical Analysis of Out-of-Distribution Generalization
- Generalized Logit Adjustment: Calibrating Fine-tuned Models by Removing Label Bias in Foundation Models cites Language Models are Few-Shot Learners
- Generalized Logit Adjustment: Calibrating Fine-tuned Models by Removing Label Bias in Foundation Models cites Learning Transferable Visual Models From Natural Language Supervision
- Latte: Collaborative Test-Time Adaptation of Vision-Language Models in Federated Learning cites Scaling Up Visual and Vision-Language Representation Learning With Noisy Text Supervision
- Latte: Collaborative Test-Time Adaptation of Vision-Language Models in Federated Learning cites Learning Transferable Visual Models From Natural Language Supervision
- Learning Transferable Visual Models From Natural Language Supervision cites The Many Faces of Robustness: A Critical Analysis of Out-of-Distribution Generalization
- Learning Transferable Visual Models From Natural Language Supervision cites Language Models are Few-Shot Learners
- C-TPT: Calibrated Test-Time Prompt Tuning for Vision-Language Models via Text Feature Dispersion cites The Many Faces of Robustness: A Critical Analysis of Out-of-Distribution Generalization
- C-TPT: Calibrated Test-Time Prompt Tuning for Vision-Language Models via Text Feature Dispersion cites Learning Transferable Visual Models From Natural Language Supervision
- Enhancing Zero-Shot Vision Models by Label-Free Prompt Distribution Learning and Bias Correcting cites Generalized Logit Adjustment: Calibrating Fine-tuned Models by Removing Label Bias in Foundation Models
- Enhancing Zero-Shot Vision Models by Label-Free Prompt Distribution Learning and Bias Correcting cites The Many Faces of Robustness: A Critical Analysis of Out-of-Distribution Generalization
- Enhancing Zero-Shot Vision Models by Label-Free Prompt Distribution Learning and Bias Correcting cites Learning Transferable Visual Models From Natural Language Supervision
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
