Black-Box Test-Time Prompt Tuning for Vision-Language Models
Test-time prompt tuning (TPT) aims to adjust the vision-language models (e.g., CLIP) with learnable prompts during the inference phase. However, previous works overlooked that pre-trained models as a service (MaaS) have become a noticeable trend due to their commercial usage and potential risk of misuse. In the context of MaaS, users can only design prompts in inputs and query the black-box vision-language models through inference APIs, rendering the previous paradigm of utilizing gradient for prompt tuning is infeasible. In this paper, we propose black-box test-time prompt tuning (B²TPT), a novel framework that addresses the challenge of optimizing prompts without gradients in an unsupervised manner. Specifically, B²TPT designs a consistent or confident (CoC) pseudo-labeling strategy to generate high-quality pseudo-labels from the outputs. Subsequently, we propose to optimize low-dimensional intrinsic prompts using a derivative-free evolution algorithm and to project them onto the original text and vision prompts. This strategy addresses the gradient-free challenge while reducing complexity. Extensive experiments across 15 datasets demonstrate the superiority of B²TPT. The results show that B²TPT not only outperforms CLIP's zero-shot inference at test time, but also surpasses other gradient-based TPT methods.
Authors
- Chaoran Cui (ORCID: https://orcid.org/0000-0003-3332-1348)
- Hongjun Dai (ORCID: https://orcid.org/0000-0002-1075-8750)
- Shuai Gong (ORCID: https://orcid.org/0000-0003-2573-111X)
- Fan’an Meng (ORCID: https://orcid.org/0009-0003-2911-4829)
Institutions
- Shandong University (CN)
- Shandong University of Finance and Economics (CN)
Publication Details
- Journal
- Proceedings of the AAAI Conference on Artificial Intelligence
- Published
- 2025-04-11
- DOI
- https://doi.org/10.1609/aaai.v39i6.32652
- Primary Topic
- Multimodal Machine Learning Applications
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- National Natural Science Foundation of China
- Natural Science Foundation of Shandong Province