CP-Prompt: Composition-Based Cross-modal Prompting for Domain-Incremental Continual Learning

Yu Feng, Zhen Tian, Yifan Zhu, Zongfu Han, Haoran Luo, Guangwei Zhang, Meina Song

Abstract

CP-Prompt introduces a "twin-prompt" strategy for cross-modal Domain-Incremental Learning (DIL), enabling models to adapt to new data distributions—such as varying artistic styles—without sacrificing performance on previously learned domains. By integrating shallow Common Prompts for universal knowledge and deep Personalized Prompts for domain-specific nuances, the method achieves state-of-the-art results while tuning only 0.22% of the model's total parameters. Evaluations across CDDB-Hard, CORe50, and DomainNet demonstrate its effectiveness in mitigating catastrophic forgetting in large-scale frozen models like CLIP.

Introduction: The Challenge of Domain-Incremental Learning

In real-world applications, data is rarely static; it typically arrives as a stream of distinct "domains," such as transitioning from sketches to paintings and then to real-world photographs. Domain-Incremental Learning (DIL) seeks to adapt models to these evolving styles while avoiding "catastrophic forgetting," where new learning overwrites existing knowledge.

Overview of CP-Prompt for Domain-Incremental Learning across a stream of domains.

Current cross-modal models, such as CLIP, face significant hurdles in DIL settings. Specifically, they must balance capturing universal features (e.g., the general shape of an object) with domain-specific details (e.g., the unique texture of a sketch). Furthermore, integrating this context effectively within complex Transformer-based architectures remains a challenge.

Proposed Method: CP-Prompt

The authors propose CP-Prompt, a dual-layer prompting architecture designed to work with frozen backbone models. The system relies on two distinct types of prompts:

  1. Common Prompts: These are shallow prompts placed at the start of the vision and text encoders. They capture universal features shared across domains. As new domains are encountered, a copy of the current common prompt is frozen to preserve knowledge, while the active prompt continues to adapt.
  2. Personalized Prompts (Prefix-One): These are deep prompts integrated directly into the Multi-Head Self-Attention (MSA) layers. Unlike standard prompt tuning that adds tokens to the input, "Prefix-One" modifies the Key and Value vectors within the attention mechanism, allowing the model to capture fine-grained semantic details specific to each domain.
Detailed architecture of CP-Prompt, showing the integration of Common and Personalized Prompts into the cross-modal framework.

To handle inference without domain labels, CP-Prompt employs a K-Means clustering approach on extracted features to automatically select the most appropriate personalized prompts for a given input.

Experimental Evaluation

The researchers evaluated CP-Prompt on three major DIL benchmarks:

  • CDDB-Hard: Focused on deepfake detection across diverse generation methods.
  • CORe50: A benchmark for object recognition in varying environments.
  • DomainNet: A large-scale dataset featuring 345 categories across six domains (Clipart, Infographic, Painting, Quickdraw, Real, and Sketch).

Key Results and Insights

CP-Prompt consistently outperformed state-of-the-art sample-free methods. On CDDB-Hard, it achieved a 93.65% Average Accuracy (AA), surpassing the previous best of 92.51%. On CORe50 and DomainNet, it reached 90.67% and 73.35% AA, respectively. Notably, the forgetting rate on CDDB-Hard was reduced to -0.25, indicating virtually no loss of prior knowledge.

Key takeaways include:

  • Layered Strategy: Shallow prompts are best for stability and general knowledge, while deep prompts are critical for domain-specific accuracy.
  • Attention Integration: Modifying MSA layers (Prefix-One) is more effective than simple token concatenation for integrating new domain information.
  • Efficiency: The method is highly efficient, tuning only 335k parameters (0.22% of a 150M parameter model), making it suitable for resource-constrained deployment.

Conclusion

CP-Prompt provides a robust framework for cross-modal continual learning. While it relies on K-Means for domain selection—which can be sensitive to highly similar domains—it offers a highly efficient and effective solution for adapting large-scale models to streaming data. Future work may explore automated methods for determining optimal prompt insertion layers to further enhance performance.

Summary updated

BibTeX
@inproceedings{feng2024cp,
  author = {Yu Feng and Zhen Tian and Yifan Zhu and Zongfu Han and Haoran Luo and Guangwei Zhang and Meina Song},
  title = {{CP-Prompt: Composition-Based Cross-modal Prompting for Domain-Incremental Continual Learning}},
  booktitle = {ACM Multimedia},
  year = {2024},
  doi = {10.1145/3664647.3681481},
}
Figure