CAPrompt: Cyclic Prompt Aggregation for Pre-Trained Model Based Class Incremental Learning

Qiwei Li, Jiahuan Zhou

CAPrompt: Cyclic Prompt Aggregation for Pre-Trained Model Based Class Incremental Learning

Abstract

Class Incremental Learning (CIL) aims to enable models to learn new classes sequentially without forgetting previous ones. Current state-of-the-art methods often rely on frozen pre-trained backbones and learnable prompts. However, these methods typically employ a "hard" task-selection mechanism during inference, where an incorrect task ID prediction leads to catastrophic failure. We introduce CAPrompt (Cyclic Prompt Aggregation), a novel framework that replaces error-prone task selection with a "soft" aggregation strategy. By mathematically ensuring the model's prediction function is concave relative to prompt parameters, we demonstrate that a weighted sum of prompts consistently outperforms single-prompt selection. CAPrompt achieves significant performance gains across standard benchmarks, including CIFAR-100, ImageNet-R, and CUB200.

Introduction: The Bottleneck of Hard Selection

In Class Incremental Learning, the primary challenge is catastrophic forgetting. Recent approaches address this by using frozen Vision Transformers (ViT) and learning small sets of task-specific parameters called "prompts." During inference, these methods usually perform a two-step process: first, they predict the Task ID of the input sample; second, they apply the corresponding prompt for classification.

This "hard selection" approach has a critical flaw: if the Task ID prediction is incorrect, the model applies the wrong knowledge base, resulting in a total failure for that sample. Furthermore, these methods often ignore the intrinsic information within the prompts themselves for task identification, relying instead on auxiliary "keys."

Comparison of existing hard-selection methods versus the proposed soft aggregation approach in CAPrompt.

Methodology: Cyclic Prompt Aggregation

CAPrompt shifts the paradigm from picking a single prompt to aggregating knowledge across all learned prompts.

1. Prompt Aggregation and Theoretical Constraints

Instead of selecting a single prompt $\phi_m$, CAPrompt calculates an aggregated prompt $\phi$ as a weighted sum of all available prompts $\{\phi_1, \dots, \phi_t\}$. The weights are derived from the model's own class probability predictions.

To ensure that this aggregation is mathematically sound, the authors leverage Jensen’s Inequality. They prove that an aggregated prompt yields a lower error than a single prompt if the prediction function is concave. To enforce this concavity in the high-dimensional parameter space, CAPrompt introduces two specialized loss functions:

  • Concave Constraint ($L_{con}$): This loss explicitly penalizes the model if the prediction from an aggregated prompt is less accurate than the weighted average of predictions from individual prompts.
  • Linear Constraint ($L_l$): This forces prompts from sequential tasks to align within the parameter space, facilitating the concavity condition.

2. Cyclic Prompt Weighting

To obtain precise weights for aggregation, the model employs an iterative "cyclic" process. In the first pass, it uses uniform weights to generate an initial prediction. This "blurry" output is then used to refine the task weights for a second, high-precision forward pass.

Overview of the CAPrompt training and inference phases, highlighting the concave and linear constraints.

Experimental Results

CAPrompt was evaluated on three major benchmarks: CIFAR-100, ImageNet-R, and CUB200, each divided into 10 sequential tasks.

  • Performance: CAPrompt consistently outperformed existing state-of-the-art (SOTA) methods like HiDe-Prompt and CODA-Prompt. On CIFAR-100, it achieved an accuracy of 95.52%, a significant improvement over the previous SOTA of approximately 92.6%.
  • Retention: The method demonstrated superior resistance to forgetting. Average Forgetting (AF) scores were remarkably low, particularly on CIFAR-100 (1.76%) and CUB200 (1.46%).

Conclusion

CAPrompt demonstrates that "soft" prompt aggregation is a more robust strategy for incremental learning than traditional "hard" task selection. By shaping the loss landscape through geometric constraints and utilizing a cyclic refinement process, CAPrompt effectively leverages the knowledge stored in multiple prompts simultaneously. While the cyclic nature introduces some computational overhead, the significant gains in accuracy and stability make it a powerful new approach for pre-trained model-based CIL.

Summary updated

BibTeX
@inproceedings{li2025caprompt,
  author = {Qiwei Li and Jiahuan Zhou},
  title = {{CAPrompt: Cyclic Prompt Aggregation for Pre-Trained Model Based Class Incremental Learning}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i17.34027},
}
Figure