Abstract
Prompt learning has emerged as an efficient way to adapt large-scale Vision-Language Models (VLMs) like CLIP to specific downstream tasks. However, this adaptation often leads to "forgetting" the model's original, broad knowledge, resulting in poor generalization to unseen classes or domains. This paper introduces SPTR (Similarity Paradigm with Textual Regularization), a framework designed to maintain the general knowledge of VLMs while learning task-specific features. By utilizing Optimal Transport for textual regularization and a similarity-matching strategy between natural and adversarial images, SPTR achieves state-of-the-art performance across 11 diverse datasets.
Introduction
Large Vision-Language Models (VLMs) such as CLIP have demonstrated remarkable "zero-shot" capabilities, identifying objects in images using simple hand-crafted prompts like "a photo of a [class]." To further enhance performance on specialized tasks, researchers have shifted toward prompt learning (e.g., CoOp), which replaces static text with learnable mathematical embeddings.
While effective for the specific data seen during training, these learned prompts often suffer from "tunnel vision." The model overfits to the training distribution and loses the generalized knowledge inherent in the original pre-trained model. This phenomenon, characterized as a forgetting problem, leads to a significant drop in performance when the model encounters novel classes or different data distributions. SPTR addresses this by "awakening" and preserving the latent general knowledge within the VLM during the fine-tuning process.
Methodology
SPTR introduces a dual-strategy approach to balance task-specific learning with broad knowledge retention: Textual Regularization and the Similarity Paradigm.
1. Textual Regularization via Optimal Transport (OT)
Traditional regularization methods often use simple point-to-point distance metrics (like L1 or Mean Squared Error) to prevent learned prompts from drifting too far from original features. SPTR instead utilizes Optimal Transport (OT). By calculating the distance between the distribution of the new learned prompts and a diverse set of hand-crafted prompts, OT allows for a more nuanced, fine-grained alignment. This forces the model to keep its new features within the manifold of the original generalized CLIP features.
2. The Similarity Paradigm (SP)
To bolster robustness and generalization, SPTR incorporates adversarial training. The framework generates "adversarial images"—inputs with subtle, intentional perturbations designed to mislead the model. The Similarity Paradigm then minimizes the Kullback-Leibler (KL) divergence between two specific alignment scores:
- The alignment between the learned prompts and natural images.
- The alignment between hand-crafted prompts and adversarial images.
By narrowing the gap between these two scores, the model learns to maintain consistent predictions even when the input data is noisy or deviates from the training set. This approach suggests that a model's ability to handle adversarial perturbations is intrinsically linked to its ability to generalize to new natural datasets.
Experimental Evaluation
The researchers evaluated SPTR across 11 representative datasets to test its versatility, including general objects (ImageNet, Caltech101), specialized categories (OxfordPets, StanfordCars, Flowers102, Food101, FGVCAircraft), scenes and actions (SUN397, UCF101), and textures or satellite imagery (DTD, EuroSAT).
Key Performance Metrics
- Base-to-Novel Generalization: In this challenging task—where the model is trained on one set of classes and tested on entirely new ones—SPTR achieved a harmonic mean (HM) of 80.61%, the highest among all compared methods.
- Cross-Dataset Robustness: When trained on ImageNet and evaluated on the remaining 10 datasets, SPTR showed a +1.8% improvement over the original CLIP, demonstrating that it does not merely memorize ImageNet-specific features.
- Overall Performance: Across four major generalization tasks, SPTR achieved an average performance of 72.89%, a +5.20% improvement over the original CLIP and outperforming recent state-of-the-art (SOTA) methods like PromptSRC and TCP.
Discussion and Limitations
The core philosophy of SPTR is that fine-tuning should not just be about learning new information, but about maintaining the pre-trained general knowledge already latent within the VLM. The results indicate that bridging the gap between natural and adversarial alignment acts as a powerful regularizer for generalization.
However, these improvements come with a trade-off in computational cost. Because SPTR generates adversarial examples during the training phase, it is slightly slower than simpler prompt-tuning methods. For instance, training on the SUN397 dataset takes approximately 14.5 minutes for 10 epochs. While SPTR uses fewer parameters than some complex architectures like MaPLe, the iterative nature of its training process is a factor for consideration in resource-constrained environments.
Conclusion
SPTR provides a robust framework for adapting Vision-Language Models without sacrificing their inherent zero-shot capabilities. By combining distribution-based textual regularization with adversarial similarity matching, the model achieves superior generalization across a wide array of visual domains. Future work will focus on validating this approach across even more diverse Vision Transformer (ViT) architectures beyond the standard CLIP backbones.
Summary updated