Abstract
Pretrained large-scale vision-language models such as CLIP have demonstrated excellent generalizability over a series of downstream tasks. However, they are sensitive to the variation of input text prompts and need a selection of prompt templates to achieve satisfactory performance. Recently, various methods have been proposed to dynamically learn the prompts as the textual inputs to avoid the requirements of laboring hand-crafted prompt engineering in the fine-tuning process. We notice that these methods are suboptimal in two aspects. First, the prompts of the vision and language branches in these methods are usually separated or uni-directionally correlated. Thus, the prompts of both branches are not fully correlated and may not provide enough guidance to align the representations of both branches. Second, it's observed that most previous methods usually achieve better performance on seen classes but cause performance degeneration on unseen classes compared to CLIP. This is because the essential generic knowledge learned in the pretraining stage is partly forgotten in the fine-tuning process. In this paper, we propose Co-Articulated Multi-Modal Learning (COMMA) to handle the above limitations. Especially, our method considers prompts from both branches to generate the prompts to enhance the representation alignment of both branches. Besides, to alleviate forgetting about the essential knowledge, we minimize the feature discrepancy between the learned prompts and the embeddings of hand-crafted prompts in the pre-trained CLIP in the late transformer layers. We evaluate our method across three representative tasks of generalization to novel classes, new target datasets and unseen domain shifts. Experimental results demonstrate the superiority of our method by exhibiting a favorable performance boost upon all tasks with high efficiency.
Introduction
Large-scale Vision-Language Models (VLMs) like CLIP have revolutionized computer vision by providing a robust foundation for zero-shot learning. However, their performance is highly dependent on the quality of text prompts. While prompt learning—optimizing small sets of learnable vectors while keeping the backbone frozen—has emerged as a solution, it faces two critical challenges: disjointed cross-modal branches and catastrophic forgetting of generic knowledge. Existing methods often treat vision and language prompts as separate or only uni-directionally linked, leading to suboptimal alignment. Furthermore, fine-tuning on specific "seen" classes often degrades the model's performance on "unseen" novel classes.
Methodology: Co-articulated Multi-Modal Learning
COMMA addresses these issues through two primary innovations: Correlated Prompt Generation and Late-Layer Distillation.
Correlated Prompt Generation
Unlike previous methods that use independent or uni-directional prompts, COMMA introduces a two-way interaction. Vision prompts for subsequent layers are generated by attending to both preceding vision and language prompts. Using a cross-modal mechanism where vision prompts act as queries and language prompts act as keys and values, the model ensures that both branches remain synchronized and aligned throughout the deep transformer layers.
Alleviating Forgetting via Late-Layer Distillation
The authors identified that the loss of CLIP's generic intelligence is most pronounced in the deepest layers of the transformer. To mitigate this, COMMA incorporates a knowledge distillation loss ($L_{kd}$). This loss constrains the learned prompts in the final layers to remain close to the original embeddings of the pre-trained CLIP model. By focusing this constraint on the late layers, the model retains its broad generalization capabilities while still allowing for task-specific adaptation in earlier layers.
Experimental Results
COMMA was evaluated across 11 diverse image recognition datasets, including ImageNet, OxfordPets, and EuroSAT, focusing on base-to-novel generalization, cross-dataset transfer, and domain generalization.
Key Findings
- State-of-the-Art Performance: COMMA outperformed existing methods on 10 out of 11 datasets for base-to-novel generalization. It achieved an average accuracy of 75.87% on unseen classes, surpassing MaPLe (75.14%).
- Robustness to Distribution Shift: In domain generalization tests (e.g., ImageNet-Sketch, ImageNet-Adversarial), COMMA consistently improved performance, demonstrating higher robustness than its predecessors.
- Cross-Dataset Generalization: When trained on ImageNet and tested on other datasets, COMMA achieved the highest average accuracy (66.84%), proving its effectiveness as a generalist learner.
- Efficiency: Despite the co-articulation mechanism, COMMA remains highly efficient, maintaining an inference speed of approximately 637 FPS with a batch size of 16.
Conclusion
COMMA presents a significant advancement in prompt learning for VLMs. By fostering two-way communication between vision and language prompts and strategically preserving generic knowledge in deep layers, it achieves a superior balance between task-specific specialization and broad generalization. Future work may involve scaling this approach to larger foundation models or extending it to video-language tasks where temporal alignment is critical.
Code is available at https://github.com/hulianyuyy/COMMA.
Summary updated