Abstract
Adapting large-scale "black-box" pre-trained models (PTMs) via APIs is notoriously expensive because finding the right "visual prompt" usually requires hundreds of thousands of queries. This paper introduces a subspace learning framework that slashes these query requirements by over 95% while maintaining state-of-the-art accuracy, effectively making large-scale model adaptation feasible for those without massive compute budgets.
Introduction
Visual Prompt Learning (VPL) adapts large pre-trained models to new tasks by adding small, learnable pixel-level modifications (prompts) to input images. However, many powerful models are "black boxes"—accessible only through APIs that return predictions without gradients. Tuning a high-dimensional visual prompt (thousands of pixels) for such models typically requires "zeroth-order optimization," a trial-and-error process that is extremely query-intensive. Existing methods like BlackVIP require a staggering number of API queries to converge, leading to high financial costs and slow deployment. This work addresses the challenge of adapting these models with a fraction of the queries.
Methodology
The proposed framework combines reparameterization with subspace learning to navigate the high-dimensional search space more efficiently. Instead of optimizing every pixel in a prompt directly, the authors use a small "Coordinator" network (an encoder-decoder) to generate prompts specific to each input image.
The core innovation is the Subspace Learning Paradigm:
- Intrinsic Dimensionality: Inspired by the concept that model adaptation occurs in a low-dimensional "intrinsic" space, the high-dimensional prompt parameters are projected into a tiny subspace.
- Iterative Subspace Construction: Rather than using a noisy random projection matrix, the framework iteratively learns the columns of a projection matrix to align the subspace with the most impactful directions for the task.
- Two-Phase Tuning: The prompt generator is first pre-trained to establish high-quality initial weights, followed by fine-tuning within the learned low-dimensional subspace.
- Zeroth-Order Gradient Estimation: A derivative-free optimizer (SPSA-GC style) estimates gradients based on API outputs. Searching in a tiny subspace makes this estimation significantly more efficient.
Experimental Setup
The method was evaluated across 14 diverse benchmarks to ensure robustness, covering:
- General Objects: Caltech101, ImageNet.
- Fine-grained Categories: OxfordPets, StanfordCars, Flowers102, Food101, FGVCAircraft.
- Specialized Domains: EuroSAT (satellite imagery), RESISC45 (remote sensing), UCF101 (action recognition), SUN397 (scene recognition).
- Textures & Logic: DTD (textures), SVHN (house numbers), CLEVR (object counting/logic).
Key Results
The results demonstrate a massive leap in efficiency without sacrificing performance. On average, the proposed method requires only 8.9k queries per task, compared to 246.9k for BlackVIP and 349k for standard Visual Prompting. This represents a 96-97% reduction in API calls.
Despite the massive reduction in queries and parameters (from ~9.9k to just 0.15k), the method matches or slightly exceeds the accuracy of BlackVIP across almost all benchmarks. Even when compared to "BlackVIP-ft" (a version using the same pre-trained weights), the subspace approach reduced queries by approximately one-third.
Discussion
Several key insights emerge from this work:
- Parameter Efficiency: Reducing tunable parameters to just 150 is sufficient to guide a massive PTM, supporting the "intrinsic dimensionality" hypothesis.
- Input-Dependence: Dynamic prompts generated by a "Coordinator" network are more efficient than static, one-size-fits-all pixel modifications.
- Search Space Optimization: Subspace learning effectively shrinks the "haystack" of high-dimensional search, allowing the optimizer to find the optimal prompt with far fewer attempts.
Conclusion
This paper presents a query-efficient approach to black-box model adaptation. By leveraging subspace learning and dynamic prompt generation, it drastically lowers the barrier to using large-scale AI models via APIs. Future work may explore adaptive methods to determine optimal subspace dimensions automatically for different tasks.
Summary updated