Abstract
Prompt learning, which focuses on learning soft prompts, has emerged as a promising approach for efficiently adapting pretrained vision-language models (VLMs) to multiple downstream tasks. While prior works have shown promising performances on common benchmarks, they typically rely on labeled data samples only. This greatly discredits the information gain from the vast collection of otherwise unlabeled samples available in the wild. To mitigate this, we propose a simple yet efficient cross-model framework to leverage on the unlabeled samples achieving significant gain in model performance. Specifically, we employ a semi-supervised prompt learning approach which makes the learned prompts invariant to the different views of a given unlabeled sample. The multiple views are obtained using different augmentations on the images as well as by varying the lengths of visual and text prompts attached to these samples. Experimenting with this simple yet surprisingly effective approach over a large number of benchmark datasets, we observe a considerable improvement in the quality of soft prompts thereby making an immense gain in image classification performance. Interestingly, our approach also benefits from out-of-domain unlabeled images highlighting the robustness and generalization capabilities.
Introduction
Adapting massive pretrained Vision-Language Models (VLMs) like CLIP to specific downstream tasks typically involves prompt learning. Instead of manually engineering text prompts like "a photo of a [class]," researchers learn "soft prompts"—continuous vectors in the embedding space. However, existing prompt learning methods are heavily dependent on manually labeled datasets. In real-world scenarios, labeled data is often scarce and expensive, while unlabeled data is abundant. XPL addresses this gap by introducing a semi-supervised framework that leverages unlabeled samples to make prompt learning more efficient and robust.
Methodology: Cross-Model Prompt Learning
The core of XPL is a dual-pathway architecture designed to facilitate semi-supervised learning through cross-model consistency.
Dual Pathways and Complementary Knowledge
The framework employs a Primary network and an Auxiliary network. Both share the same frozen VLM backbone but utilize different learnable prompt lengths (e.g., 16 tokens for the primary and 8 for the auxiliary). This variation in prompt length encourages the two networks to learn slightly different, yet complementary, features of the data. This "disagreement" prevents the models from collapsing into a state where they simply echo each other's errors, leading to more robust representations.
Cross-Model Supervision
For unlabeled images, XPL generates two versions: a "weakly augmented" version (simple transformations like flips) and a "strongly augmented" version (complex transformations). The Primary network’s prediction on the weak version serves as a "pseudo-label" to supervise the Auxiliary network’s prediction on the strong version, and vice versa. This consistency regularization ensures that the learned prompts are invariant to different views of the same sample.
Multi-modal Prompt Coupling
Rather than learning text and visual prompts independently, XPL uses a learnable coupling function $\mathcal{F}(\cdot)$ to derive visual prompts directly from text prompts. This ensures synchronization between the two modalities, which is critical for maintaining the alignment of the VLM's shared embedding space during training.
Experimental Setup
The authors evaluated XPL across 15 diverse image classification datasets, including:
- Natural Images: ImageNet, Caltech101, Oxford Pets, Flowers102.
- Specialized Domains: EuroSAT (satellite imagery), CropDiseases (agriculture), ISIC and ChestX (medical imaging).
- Art & Structure: Kaokore (Japanese art), DTD (textures), and Clevr-Count (structured counting).
- Domain Shift: DomainNet and Office-31 were used to test robustness to out-of-distribution data.
Key Results and Insights
The Power of 1% Labeled Data
A significant finding is that XPL, using only 1% of labeled data, can outperform fully supervised methods like CoOp that use 100% of the labels on specialized datasets like EuroSAT and CropDiseases. As shown in the accuracy curves above, XPL (black line) consistently stays above the 100% CoOp baseline (red dashed line) even with minimal labeled supervision.
Complementary Knowledge and Generalization
The performance gap analysis (panels a and b in the figure above) confirms that different prompt lengths ($Acc_8$ vs $Acc_{16}$) capture distinct information across categories. XPL exploits this gap to provide superior supervision for unlabeled samples. Furthermore, XPL demonstrates remarkable generalization from "seen" to "unseen" classes, improving the harmonic mean accuracy by 7.59% over standard multi-modal prompt learning baselines.
Robustness to Noise
Even when unlabeled data comes from a completely different domain (out-of-distribution), XPL remains robust. It utilizes these samples to learn a more generalized understanding of the task rather than simply memorizing the data distribution.
Conclusion and Future Work
XPL demonstrates that semi-supervised learning is a highly effective strategy for prompt-based VLM adaptation. While the dual-pathway approach introduces some computational overhead during training, only the Primary network is required for inference, maintaining efficiency in deployment. Future research may explore additional methods for creating complementary models beyond varying prompt lengths to further enhance the quality of learned soft prompts.
Summary updated