Prompt Customization for Continual Learning

Yong Dai, Xiaopeng Hong, Yabin Wang, Zhiheng Ma, Dongmei Jiang, Yaowei Wang

TL;DR

Prompt-based continual learning often fails because "hard-selecting" prompts from a pool is noisy and treats every image in a task as identical. This paper introduces Prompt Customization (PC), a method that replaces selection with instance-specific generation and modulation, achieving state-of-the-art results across class, domain, and task-agnostic incremental learning settings.

What Problem Does This Paper Address?

Continual Learning (CL) aims to teach models new tasks without them "catastrophically forgetting" what they previously learned. Recently, "prompt-based" methods have become the gold standard. These methods keep a large pre-trained model (like a Vision Transformer) frozen and only train a small set of "prompts"—learnable vectors that guide the model's attention.

However, current methods like L2P and DualPrompt rely on a hard selection strategy: for a given input, the model picks a prompt from a fixed pool. The authors identify two major flaws here:

  1. Selection Noise: As the number of tasks grows, the prompt pool expands, making it increasingly likely the model will pick the wrong prompt during inference.
  2. Homogeneity: These methods usually assign the same prompt to every image in a task. This ignores the natural variability within a task (e.g., a "dog" task includes both Chihuahuas and Great Danes), leading to suboptimal instructions for the model.

Methods

The authors propose the Prompt Customization (PC) framework, which moves away from "picking" prompts and toward "crafting" them on the fly. It consists of two primary modules:

  • Prompt Generation Module (PGM): Instead of selecting one prompt, PGM treats a fixed-size "codebook" as a set of fundamental building blocks. It uses an attention mechanism to assign "soft weights" (coefficients) to these blocks, creating a unique, linear combination of prompts tailored to each specific input image.
  • Prompt Modulation Module (PMM): Once a prompt is generated, PMM further refines it. It calculates the correlation between the input data and the generated prompt to adaptively assign weights, making the prompts more flexible and "expressive."

To ensure the system remains stable over time, the authors use a momentum update strategy for the codebook (keeping it from changing too drastically between tasks) and an orthogonality constraint (ensuring the building blocks in the codebook stay distinct and don't overlap in meaning).

Datasets

The researchers evaluated PC on four major benchmarks covering three distinct types of incremental learning:

  • Class-Incremental: Split CIFAR-100 and Split ImageNet-R (learning new categories over time).
  • Domain-Incremental: CORe50 (learning to recognize objects in new environments/lighting).
  • Task-Agnostic Domain-Incremental: DomainNet (a highly challenging setup where task boundaries are not provided during testing).

Key Insights and Ideas

  • Soft is Better than Hard: By using "soft" coefficients to combine prompts rather than "hard" selection, the model avoids the catastrophic errors that occur when a selection mechanism misidentifies a task.
  • The Power of Instance-Specificity: The "aha moment" is that even within a single task, different images benefit from slightly different prompts. Visualizing the prompts via t-SNE shows that PC generates a diverse "cloud" of prompts that adapt to the data distribution, whereas older methods produce rigid, clustered points.
  • Efficiency vs. Performance: The authors introduced a "PC-light" version. It outperforms the previous state-of-the-art (CODA-Prompt) while requiring only about 25% of the training time, proving that smart architecture can be more effective than brute-force computation.

Key Results

  • Superior Accuracy: PC consistently outperformed existing methods. On the Split CIFAR-100 (10 tasks) benchmark, it achieved 87.20% accuracy, surpassing CODA-Prompt.
  • Massive Gains in Challenging Settings: In the task-agnostic DomainNet experiment, PC achieved 58.82% accuracy, a staggering 16.2% improvement over the previous best exemplar-free method (S-iPrompt).
  • Scalability: While other methods see a sharp performance drop as the number of tasks increases (from 5 to 20 tasks), PC’s performance remains remarkably stable, suggesting it is better suited for long-term "lifelong" learning.

Limitations and Future Work

While PC represents a significant step forward, the authors note a few areas for growth:

  • Backbone Dependency: The method relies on a frozen, pre-trained Vision Transformer (ViT). If the initial pre-training is too far removed from the target domain, the prompts might struggle to bridge the gap.
  • Future Modalities: The current work is focused on image classification. The authors suggest that exploring prompt customization for multimodal datasets (combining text, audio, and video) is a promising next step for more generalized AI agents.

Summary updated

BibTeX
@article{dai2025prompt,
  author = {Yong Dai and Xiaopeng Hong and Yabin Wang and Zhiheng Ma and Dongmei Jiang and Yaowei Wang},
  title = {{Prompt Customization for Continual Learning}},
  journal = {IEEE Trans. Artif. Intell.},
  year = {2025},
  doi = {10.1109/tai.2024.3524977},
}
Figure