KOPPA: Improving Prompt-based Continual Learning with Key-Query Orthogonal Projection and Prototype-based One-Versus-All

Quyen Tran, Lam Tran, Khoat Than, Toan Tran, Dinh Q. Phung, Trung Le · OpenReview

Abstract

Drawing inspiration from prompt tuning techniques applied to Large Language Models, recent methods based on pre-trained ViT networks have achieved remarkable results in the field of Continual Learning. Specifically, these approaches propose to maintain a set of prompts and allocate a subset of them to learn each task using a key-query matching strategy. However, they may encounter limitations when lacking control over the correlations between old task queries and keys of future tasks, the shift of features in the latent space, and the relative separation of latent vectors learned in independent tasks. In this work, we introduce a novel key-query learning strategy based on orthogonal projection, inspired by model-agnostic meta-learning, to enhance prompt matching efficiency and address the challenge of shifting features. Furthermore, we introduce a One-Versus-All (OVA) prototype-based component that enhances the classification head distinction. Experimental results on benchmark datasets demonstrate that our method empowers the model to achieve results surpassing those of current state-of-the-art approaches by a large margin of up to 20%.

Introduction: The Challenge of Semantic Drift

In Continual Learning (CL), models must learn a sequence of tasks without forgetting previous ones—a challenge known as "Catastrophic Forgetting." Recent breakthroughs have utilized pre-trained Vision Transformers (ViT) and "prompt tuning," where the model learns a small set of task-specific instructions (prompts) rather than updating the entire backbone network.

However, current state-of-the-art (SOTA) methods like CODA suffer from a critical training-testing mismatch. When a model learns an early task, it is unaware of the prompts that will be defined for future tasks. At test time, an image from an early task might accidentally "trigger" prompts from later tasks because the keys for those later tasks weren't constrained during the initial training. This causes the image's representation in the latent space to shift or "drift," leading the model to select the wrong classification head and fail.

The KOPPA Framework

To address these limitations, we propose KOPPA (Key-query Orthogonal Projection with Prototype-based OVA), which introduces geometric constraints to the prompt selection process.

Overview of the KOPPA architecture highlighting the semantic drift problem and the proposed key-query matching strategy using orthogonal projection.

Key-Query Orthogonal Projection

Inspired by Meta-Learning (MAML), this strategy ensures that the "keys" used to select prompts for new tasks are always perpendicular (orthogonal) to the "queries" generated by old tasks. As illustrated in the architecture diagram, this geometric constraint ensures that new tasks cannot interfere with the prompt-selection process of previously learned tasks, effectively "locking" the old task representations in place and eliminating semantic drift.

Prototype-based One-Versus-All (OVA)

To further assist the model in distinguishing between classes from different tasks, KOPPA stores a small number of "prototypes" (latent feature vectors) from previous tasks. These are used to train a One-Versus-All classification head. At inference, this head acts as a gatekeeper, helping the model identify which task a sample likely belongs to before making a final class prediction. This approach provides the benefits of experience replay without the need to store raw, privacy-sensitive images.

Experimental Results

KOPPA was evaluated on standard Class Incremental Learning (CIL) benchmarks, including S-CIFAR-100 and S-ImageNet-R (split into 5, 10, and 20 tasks).

Main experimental results comparing KOPPA against state-of-the-art methods across multiple benchmarks. KOPPA shows significant improvements in accuracy ($A_N$) and reduction in forgetting ($F_N$).

As shown in the results table, KOPPA sets a new bar for prompt-based continual learning:

  • Massive Accuracy Gains: On the challenging S-ImageNet-R-20 benchmark, KOPPA achieved 92.89% accuracy, a staggering 20.52% improvement over the previous leader, CODA (72.37%).
  • Near-Zero Forgetting: On S-CIFAR-100, KOPPA's forgetting rate ($F_N$) was a mere 0.43%, significantly lower than CODA (1.67%) and standard Experience Replay (8.50%).
  • Stability: Unlike previous methods that degrade as the number of tasks increases, KOPPA remains stable even when the sequence is stretched to 20 tasks, maintaining high accuracy throughout.

Conclusion

KOPPA effectively mitigates semantic drift and catastrophic forgetting in prompt-based continual learning through geometric orthogonal constraints and prototype-based classification. By treating forgetting as a geometric interference problem, KOPPA creates independent "hallways" in the latent space for each task. While the rigid orthogonality might limit positive backward transfer, the substantial gains in stability and accuracy demonstrate that KOPPA is a powerful new framework for robust continual learning.

Summary updated

BibTeX
@misc{tran2023koppa,
  author = {Quyen Tran and Lam Tran and Khoat Than and Toan Tran and Dinh Q. Phung and Trung Le},
  title = {{KOPPA: Improving Prompt-based Continual Learning with Key-Query Orthogonal Projection and Prototype-based One-Versus-All}},
  year = {2023},
  eprint = {2311.15414},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2311.15414},
}
Figure