ZIP: An Efficient Zeroth-order Prompt Tuning for Black-box Vision-Language Models

Seonghwan Park, Jaehyeon Jeong, Yongjun Kim, Jaeho Lee, Namhoon Lee

Abstract

Recent studies have introduced various approaches for prompt-tuning black-box vision-language models, referred to as black-box prompt-tuning (BBPT). While BBPT has demonstrated considerable potential, it is often found that many existing methods require an excessive number of queries (i.e., function evaluations), which poses a significant challenge in real-world scenarios where the number of allowed queries is limited. To tackle this issue, we propose Zeroth-order Intrinsic-dimensional Prompt-tuning (ZIP), a novel approach that enables efficient and robust prompt optimization in a purely black-box setting. The key idea of ZIP is to reduce the problem dimensionality and the variance of zeroth-order gradient estimates, such that the training is done fast with far less queries. We achieve this by re-parameterizing prompts in low-rank representations and designing intrinsic-dimensional clipping of estimated gradients. We evaluate ZIP on 13+ vision-language tasks in standard benchmarks and show that it achieves an average improvement of approximately 6% in few-shot accuracy and 48% in query efficiency compared to the best-performing alternative BBPT methods, establishing a new state of the art. Our ablation analysis further shows that the proposed clipping mechanism is robust and nearly optimal, without the need to manually select the clipping threshold, matching the result of expensive hyperparameter search.

Introduction

Large vision-language models (VLMs) like CLIP and SigLIP have demonstrated remarkable capabilities in zero-shot and few-shot learning. However, the most powerful versions of these models are often proprietary and accessible only through APIs (e.g., OpenAI or Google). This "black-box" nature prevents users from accessing internal weights or gradients, rendering traditional backpropagation-based fine-tuning impossible.

To adapt these models to specific downstream tasks, researchers utilize Black-Box Prompt Tuning (BBPT). This approach treats the model as a function to be optimized using zeroth-order (ZO) methods, which estimate gradients by applying small perturbations to inputs and observing the resulting change in output. Despite their utility, current BBPT methods struggle with the "curse of dimensionality"—where optimization becomes noisier as prompt parameters increase—and extreme query inefficiency, often requiring tens of thousands of expensive API calls to converge.

The ZIP Framework

We introduce Zeroth-order Intrinsic-dimensional Prompt-tuning (ZIP), a framework designed to make black-box adaptation both faster and more accurate. ZIP addresses the limitations of ZO optimization through three primary technical innovations:

1. Low-Rank Reparameterization

Instead of optimizing in the high-dimensional space of the original prompt, ZIP projects the optimization problem into a much smaller "intrinsic" dimension. This is achieved using a combination of the Fastfood transform—a computationally efficient random projection—and a low-rank matrix decomposition ($W = U \text{diag}(s) V^T$). By reducing the number of parameters the optimizer must track, ZIP significantly lowers the variance of gradient estimates.

2. Feature Sharing

To maintain expressive power despite the reduced parameter count, ZIP introduces a shared vector ($u$) that acts as a common base across all prompt tokens. This allows the model to capture global features and maintain structural coherence across the prompt without adding significant overhead.

3. Intrinsic-Dimensional Gradient Clipping

Zeroth-order gradient estimates are inherently noisy. ZIP stabilizes training using a novel clipping mechanism where the threshold is automatically set to the square root of the number of trainable parameters ($\sqrt{\delta}$). We demonstrate that the variance of zeroth-order gradients is naturally bounded by this value. This "tuning-free" threshold eliminates the need for expensive hyperparameter searches while ensuring robust convergence across diverse datasets.

Experimental Evaluation

We evaluated ZIP across a comprehensive suite of 13+ vision-language benchmarks, focusing on few-shot learning, cross-dataset transfer, and out-of-distribution (OOD) generalization.

  • Benchmarks: The suite included ImageNet, Caltech101, OxfordPets, Flowers102, Food101, FGVCAircraft, SUN397, DTD, SVHN, EuroSAT, Resisc45, CLEVR, and UCF101.
  • Robustness Testing: To assess generalization, we tested on ImageNet-V2, ImageNet-Sketch, ImageNet-A, and ImageNet-R.
  • Models: Experiments were primarily conducted using CLIP (ViT-B/16) and SigLIP.

Results and Discussion

Superior Accuracy and Efficiency

ZIP outperformed existing state-of-the-art BBPT methods (such as BAR, BlackVIP, and BPTVLM) on 11 out of 13 datasets. On average, ZIP achieved a 6% improvement in few-shot accuracy. More importantly, ZIP proved to be roughly twice as fast as its closest competitors, reaching target accuracy levels with 48% fewer queries.

Robustness and Generalization

In out-of-distribution scenarios, where the model encounters data significantly different from its training set, ZIP showed a 13.2% improvement over previous methods. This suggests that the low-rank approach effectively regularizes the model, preventing it from overfitting to the limited samples available in few-shot settings.

The Dimensionality Paradox

Our findings highlight a critical insight for black-box tuning: while adding more parameters typically helps in "white-box" scenarios, it often degrades performance in zeroth-order optimization due to increased variance. ZIP resolves this paradox by identifying and optimizing within a lower-dimensional subspace that captures the essential features of the task.

Conclusion

ZIP effectively bridges the performance gap between black-box and white-box optimization. By combining low-rank reparameterization with a mathematically grounded gradient clipping strategy, ZIP provides a practical and efficient solution for adapting foundation models via APIs. While the requirement for several thousand queries remains a challenge for the most cost-prohibitive APIs, ZIP represents a significant step toward making high-performance VLM adaptation accessible to a broader range of users and applications.

Summary updated

BibTeX
@inproceedings{park2025zip,
  author = {Seonghwan Park and Jaehyeon Jeong and Yongjun Kim and Jaeho Lee and Namhoon Lee},
  title = {{ZIP: An Efficient Zeroth-order Prompt Tuning for Black-box Vision-Language Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=2OegVbwvY2},
}
Figure