Abstract
Recent vision-language pre-trained (VLP) models have become the backbone for many downstream tasks, but they are utilized as frozen model without learning. Prompt learning is a method to improve the pre-trained VLP model by adding a learnable context vector to the inputs of the text encoder. In a few-shot learning scenario of the downstream task, MLE training can lead the context vector to over-fit dominant image features in the training data. This overfitting can potentially harm the generalization ability, especially in the presence of a distribution shift between the training and test dataset. This paper presents a Bayesian-based framework of prompt tuning, which could alleviate the over-fitting issues on few-shot learning application and increase the adaptability of prompts on unobserved instances. Specifically, modeling data-dependent prior enhances the adaptability of text features for both seen and unseen image features without the trade-off of performance between them. Based on the Bayesian framework, we utilize the Wasserstein gradient flow in the estimation of our target posterior distribution, which enables our prompt to be flexible in capturing the complex modes of image features. We demonstrate the effectiveness of our method on benchmark datasets for several experiments by showing statistically significant improvements on performance compared to existing methods.
Introduction
Vision-Language Pretrained (VLP) models, such as CLIP, have revolutionized multi-modal tasks. To adapt these massive, frozen models to specific downstream tasks, researchers often use prompt learning. This involves adding a small, learnable "context vector" to the text input rather than retraining the entire model.
However, standard prompt learning methods face two major hurdles:
- Overfitting in Few-Shot Scenarios: With limited data, standard training causes prompts to over-fit to dominant features, ignoring the broader class variety.
- Distribution Shift: Prompts learned on one dataset often fail when test data looks different (e.g., training on photos, testing on sketches).
This paper introduces Adaptive Particle-based Prompt Learning (APP), a Bayesian framework that makes these models more robust and adaptable by modeling a distribution of prompts rather than a single point estimate.
Methodology: The APP Framework
APP shifts the paradigm by using Bayesian inference to capture the multi-modal nature of real-world image distributions. The framework relies on two key technical components:
- Data-Dependent Prior: Unlike standard Bayesian methods using generic priors, APP uses a neural network to generate a prior conditioned on the image features themselves, linking the prompt space directly to visual content.
- Wasserstein Gradient Flow: To approximate the complex posterior distribution of prompts, the authors use Stein Variational Gradient Descent (SVGD). This treats prompts as a set of "particles" that evolve to cover different variations of image features.
Key Insights: Diversity through Repulsion
A unique feature of APP is the "repulsive force" between particles during training. This force prevents particles from collapsing into a single point, ensuring they capture diverse "modes" of the image features. This prevents the text features from getting "stuck" on a single visual attribute and helps them capture the category's essence more broadly.
Additionally, APP enables Test-Time Adaptation. When the model encounters a new image, it performs a weighted update using the test image's features, allowing the prompt to "flex" and adapt to the new data distribution on the fly.
Experimental Results
The researchers evaluated APP across 11 diverse benchmarks, including ImageNet, EuroSAT, and OxfordPets, testing for few-shot classification and domain generalization.
Quantitative Performance
APP outperformed state-of-the-art baselines (like CoOp, ProDA, and PLOT) in 45 out of 55 experimental cases. On ImageNet-Sketch, APP achieved 35.70% accuracy, significantly higher than CoOp (34.07%) and PLOT (33.93%), proving its superior handling of stylistic shifts.
Qualitative Alignment
UMAP visualizations demonstrate that APP’s text features align much more harmoniously with image feature clusters compared to other methods. While competing methods often produce text features that are "offset" from the actual data, APP's particles effectively represent the multi-modal distribution of the image features.
Conclusion
APP provides a robust Bayesian framework for vision-language prompt learning. By utilizing data-dependent priors and Wasserstein gradient flow, it overcomes the limitations of static prompts in few-shot and distribution-shift scenarios. While it introduces some computational overhead, its ability to adapt without performance trade-offs marks a significant step forward in multi-modal model adaptation.
Summary updated