Abstract
This paper addresses soft prompt learning for Vision & Language (V&L) models. Similarly to their NLP counterparts, V&L models can be adapted to a downstream task by learning soft continuous prompts using a few training examples. Current methods learn the soft prompts by minimizing a cross-entropy loss using as class weights the features obtained by passing the prompts plus the class names through the text encoder. Such methods, however, significantly overfit the training data suffering from large accuracy degradation when tested on unseen classes from the same domain. Our main contribution, in this paper, is a surprisingly simple approach to alleviate this problem: we use a second cross entropy loss to minimize the distance between the learned soft prompts and a set of hand-engineered manual prompts (obtained by prompt engineering). The proposed loss can be interpreted in multiple ways including as a regularizer, as a means for language-based augmentation, and as a way of learning more discriminative class centroids. Importantly, our formulation is inherently amenable to including, during training, virtual classes, i.e. class names for which no visual samples are available, further increasing the robustness of the learned prompts. Through extensive evaluations on 11 datasets, we show that our approach (a) significantly outperforms all prior works on soft prompting, and (b) matches and surpasses, for the first time, the accuracy on novel classes obtained by hand-crafted prompts and CLIP for the majority of the test datasets.
Introduction
Large-scale Vision-Language (V&L) models like CLIP have revolutionized zero-shot classification through the use of "hard prompts"—manually crafted strings like "a photo of a {class}". To enhance performance on specific downstream tasks, researchers introduced soft prompting (e.g., CoOp), which replaces these static strings with learnable continuous vectors.
However, soft prompting faces a critical challenge: base class overfitting. While these models excel on categories seen during training, their performance often collapses on novel classes. In many scenarios, the original zero-shot CLIP model actually outperforms optimized soft-prompt models on unseen data because the learned vectors drift away from the semantic space of natural language. LASP (Language-Aware Soft Prompting) is designed to solve this by anchoring learnable prompts to the linguistic foundations of the model.
Methodology
LASP introduces a multi-faceted approach to regularize prompt learning:
- Language-Aware Loss ($L_{TT}$): This core innovation adds a text-to-text cross-entropy loss alongside the standard image-text classification loss. It forces the learned soft prompts to remain semantically similar to a set of 34 pre-defined manual templates. This ensures the prompts stay "grounded" in natural language.
- Grouped LASP: To increase representational capacity, prompts are divided into $G$ groups. Each group is optimized against different subsets of manual templates, allowing the model to learn diverse "experts" for different descriptive styles.
- Re-calibration Mechanism: LASP fine-tunes the Layer Normalization (LN) layers of the vision encoder and introduces a learnable class-agnostic bias ($b$) to the text embeddings to account for distribution shifts between pre-training and downstream tasks.
- Virtual Classes (LASP-V): Since the $L_{TT}$ loss is purely text-based, LASP can incorporate "virtual classes"—category names without corresponding training images. This further regularizes the prompts and enhances robustness to unseen categories.
Experimental Results
The authors evaluated LASP across a diverse suite of 11 datasets, ranging from general objects (ImageNet) to specialized domains like satellite imagery (EuroSAT) and textures (DTD).
Key Findings
- State-of-the-Art Generalization: LASP-V consistently outperformed prior methods such as CoOp, CoCoOp, and ProDA in terms of Harmonic Mean (H) across all 11 benchmarks.
- Surpassing Zero-Shot Baselines: For the first time, a soft-prompting method matched or exceeded the accuracy of hand-crafted prompts on novel classes in 8 out of 11 datasets.
- Domain-Specific Success: On the EuroSAT dataset, LASP-V achieved a remarkable 17.37% improvement on novel classes compared to previous state-of-the-art methods.
- Inference Efficiency: Unlike dynamic methods like CoCoOp, LASP prompts are static at inference time, maintaining the computational efficiency of the original CLIP model.
Conclusion and Future Work
LASP demonstrates that the text encoder's inherent knowledge can serve as a powerful regularizer for prompt learning. By treating manual prompts as a "teacher," LASP prevents the catastrophic forgetting of general world knowledge during task-specific adaptation. While the method currently relies on pre-defined templates and vision encoder re-calibration, it sets a new standard for robust and efficient vision-language adaptation. Future research may explore more sophisticated ways to utilize virtual linguistic data to further bridge the gap between base and novel class performance.
Summary updated