A Similarity Paradigm Through Textual Regularization Without Forgetting

Fangming Cui, Jan Fong, Rongfei Zeng, Xinmei Tian, Jun Yu

Introduction

Vision-Language Models (VLMs) like CLIP have revolutionized computer vision by enabling "zero-shot" recognition through hand-crafted text prompts (e.g., "a photo of a [class]"). To further enhance performance on specific tasks, researchers developed prompt learning techniques, such as CoOp, which replace these manual strings with learnable vectors. However, while these learned prompts improve accuracy on seen data, they often cause the model to overfit to the training distribution, leading to a loss of general knowledge—a phenomenon known as "forgetting."

The SPTR Framework

To address this trade-off, the authors introduce the Similarity Paradigm with Textual Regularization (SPTR). This framework is designed to retain the broad generalization capabilities of hand-crafted prompts while capturing the high performance of task-specific tuned prompts.

The SPTR framework architecture, illustrating the integration of Optimal Transport for textual regularization and the Similarity Paradigm for robustness.

1. Textual Regularization via Optimal Transport (OT)

Instead of training a single learnable prompt in isolation, SPTR utilizes a set of diverse hand-crafted prompts as a "Generalization Anchor." The framework employs Optimal Transport (OT)—a mathematical method for measuring distances between distributions—to ensure that the features of the tuned prompt stay semantically aligned with the diverse features of the hand-crafted ones. This many-to-one matching prevents the model from drifting into a narrow, overfitted feature space.

2. The Similarity Paradigm (SP)

To improve robustness against domain shifts and noise, SPTR introduces an adversarial component. The model generates "adversarial examples" (images with slight, intentional perturbations) and uses Kullback-Leibler (KL) divergence to force the model’s predictions on clean images to match its predictions on these perturbed images. This encourages the model to focus on stable, generalized features rather than dataset-specific noise.

Experimental Evaluation

The authors evaluated SPTR across 11 diverse datasets, including general objects (ImageNet, Caltech101), specialized domains (StanfordCars, Flowers102, Food101), and textures (DTD).

Key Results

SPTR consistently outperformed state-of-the-art methods like CoOp, MaPLe, and PromptSRC across several critical benchmarks:

  • Overall Performance: Across representative tasks, SPTR achieved an average accuracy of 72.89%, significantly higher than CLIP’s base 67.69%.
  • Few-Shot Learning: As illustrated in the performance plots, SPTR maintains a clear lead over competing methods as the number of training shots increases.
  • Base-to-Novel Generalization: On the harmonic mean metric (balancing seen and unseen classes), SPTR reached 80.61%, surpassing the recent TCP (79.51%).
  • Domain Robustness: On the challenging ImageNet-A dataset, SPTR showed a substantial improvement, achieving 51.30% accuracy compared to CLIP's 47.77%.
Performance comparison of SPTR against baseline methods across multiple datasets and the average performance over 11 datasets.

Conclusion and Limitations

SPTR successfully bridges the gap between task-specific tuning and general robustness. By anchoring learned prompts to hand-crafted knowledge and enforcing consistency through adversarial training, it effectively mitigates the forgetting problem in VLMs.

However, these improvements come with a trade-off in computational efficiency. The inclusion of adversarial training (via PGD) increases training time—for instance, 14.5 minutes for SPTR versus 10.8 minutes for CoOp on the SUN397 dataset—and results in relatively slower inference speeds. Future work may focus on optimizing these components for faster deployment across various Vision Transformer architectures.

Reference: Cui, F., et al. (2025). A Similarity Paradigm Through Textual Regularization Without Forgetting. The Thirty-Ninth AAAI Conference on Artificial Intelligence (AAAI-25).

Summary updated

BibTeX
@inproceedings{cui2025similarity,
  author = {Fangming Cui and Jan Fong and Rongfei Zeng and Xinmei Tian and Jun Yu},
  title = {{A Similarity Paradigm Through Textual Regularization Without Forgetting}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i15.33768},
}
Figure