<figure><img src="image_1.png" /></figure>

HAL
open science

# Advancing Prompt-Based Methods for Replay-Independent General Continual Learning

Zhiqi Kang, Liyuan Wang, Xingxing Zhang, Karteek Alahari

<figure><img src="image_2.png" /></figure>

## To cite this version:

Zhiqi Kang, Liyuan Wang, Xingxing Zhang, Karteek Alahari. Advancing Prompt-Based Methods for Replay-Independent General Continual Learning. ICLR 2025 - International Conference on Learning Representations, Apr 2025, Singapore, Singapore. pp.1-19. hal-05003725

HAL Id: hal-05003725

https://hal.science/hal-05003725v1

Submitted on 4 Apr 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_3.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# ADVANCING PROMPT-BASED METHODS FOR REPLAY-INDEPENDENT GENERAL CONTINUAL LEARNING

**Zhiqi Kang**
Inria*

**Liyuan Wang**†
Tsinghua University

**Xingxing Zhang**
Tsinghua University

**Karteek Alahari**†
Inria*

## ABSTRACT

General continual learning (GCL) is a broad concept to describe real-world continual learning (CL) problems, which are often characterized by online data streams without distinct transitions between tasks, i.e., blurry task boundaries. Such requirements result in poor initial performance, limited generalizability, and severe catastrophic forgetting, heavily impacting the effectiveness of mainstream GCL models trained from scratch. While the use of a frozen pretrained backbone with appropriate prompt tuning can partially address these challenges, such prompt-based methods remain suboptimal for CL of remaining tunable parameters on the fly. In this regard, we propose an innovative approach named MISA (Mask and Initial Session Adaption) to advance prompt-based methods in GCL. It includes a forgetting-aware initial session adaption that employs pretraining data to initialize prompt parameters and improve generalizability, as well as a non-parametric logit mask of the output layers to mitigate catastrophic forgetting. Empirical results demonstrate substantial performance gains of our approach compared to recent competitors, especially without a replay buffer (e.g., up to 18.39, 22.06, and 11.96 % points performance lead on CIFAR-100, Tiny-ImageNet, and ImageNet-R, respectively). Moreover, our approach features the plug-in nature for prompt-based methods, independence of replay, ease of implementation, and avoidance of CL-relevant hyperparameters, serving as a strong baseline for GCL research. Our source code is publicly available at https://github.com/kangzhiq/MISA.

## 1 INTRODUCTION

Continual learning (CL) (Wang et al., 2024b; De Lange et al., 2021) focuses on the lifelong acquisition of knowledge in response to real-world changes. Although conventional CL research often relies on offline training of each task with distinct transitions between tasks (i.e., clear task boundaries), online scenarios with blurry task boundaries tend to be more practical yet challenging. Such “online” scenarios demand the model to swiftly adapt to new information, which is essential for real-time applications. Blurry task boundaries further reflect realistic data distributions without distinct transitions between tasks, i.e., old classes disappear gradually over time and might re-appear when new classes emerge (see Fig. 1, Left). The above considerations, collectively referred to as general continual learning (GCL) (De Lange et al., 2021), have received increasing attention in recent years. However, most of the earlier works (Aljundi et al., 2019; Buzzega et al., 2020; Koh et al., 2021; Bang et al., 2021) address GCL by learning a model from scratch. This strategy often leads to challenges such as poor initial performance, limited generalizability, and severe catastrophic forgetting (McCloskey & Cohen, 1989) in such a complex setting.

One promising direction that emerged in GCL literature (Moon et al., 2023) is to employ prompt-based methods (Wang et al., 2022d;c; 2024a) on the basis of pretrained models (PTMs), which involves keeping the PTMs frozen and introducing a few prompt parameters for representation learning. Such methods outperform previous train-from-scratch ones by a significant margin. The frozen backbone pretrained on a large-scale dataset provides a solid initialization with strong generalizability and is resistant to forgetting. However, the particular challenges of GCL persist for the remaining

<footnote>†Corresponding authors: L. Wang and K. Alahari.
*Univ. Grenoble Alpes, CNRS, Grenoble INP, LJK, 38000 Grenoble, France.</footnote>
<figure><img src="image_4.png" /><figcaption>Figure 1: Problem setup and motivation. Left: illustration of the GCL data stream. Mid: average prediction accuracy at different timesteps in GCL. Right: session 1 accuracy, where we evaluate the retention of knowledge acquired at session 1 after each session. All methods are tested without a replay buffer.</figcaption></figure>

tunable components, i.e., the prompt parameters and the output layers, making the direct application of prompt-based methods to GCL suboptimal.

Studies have demonstrated that prompt parameters and output layers are particularly vulnerable in the challenging setting of GCL. First, prompt-tuning is known to suffer from a limited capacity in vision tasks (Lester et al., 2021; Vu et al., 2021; Chen et al., 2021). Training these parameters on the fly in online scenarios of GCL can result in poor initial performance and limited generalizability. As shown in Fig. 1 (Mid), state-of-the-art methods have moderate initial performance and drop dramatically after session transitions (timestep 4). Moreover, it is well studied in the CL literature (Wu et al., 2019; Ahn et al., 2021) that the output layers suffer from forgetting in class-incremental learning, a challenge that is exacerbated in GCL due to the naturally imbalanced data stream and the interference between new and old knowledge caused by blurry task boundaries. While recent GCL works (Moon et al., 2023) have introduced specialized learning strategies for the output layers, they still fail to outperform conventional prompt-based methods. Specifically, the session 1 accuracy in Fig. 1 (Right) shows the capacity to retain acquired knowledge from the first session in subsequent sessions, where all existing methods suffer to retain this knowledge. Thus, there is a clear need for learning-efficient and forgetting-less strategies to address the particular challenges of GCL.

Our method, MISA (Mask and Initial Session Adaption), is designed with two objectives: a forgetting-aware initial session adaption (ISA) for better learning efficiency and generalizability of the prompt parameters, and a non-parametric logit masking for less catastrophic forgetting of the output layers. The initial session refers to a warm-up of the model parameters prior to any GCL sessions. Specifically, we reuse the pretraining data of the PTMs to warm up the prompt parameters. As naïve pretraining tends to enhance mainly the initialization rather than the generalizability, we devise a novel forgetting-aware minimization technique in ISA to improve the generalizability of prompts to distribution shift. Unlike conventional CL methods that address forgetting after it occurs, our approach proactively prevents future forgetting and maintains the pretrained knowledge for downstream GCL. As for reducing forgetting of the output layers, we propose a non-parametric strategy that is based on class appearance to mask the output logits. We show that such a simple strategy, which is not effective for the train-from-scratch paradigm, can benefit from the stable representation space retained by the frozen backbone and effectively rectify the output layers.

In summary, our MISA is specifically designed for tunable parameters of prompt-based methods in GCL. We emphasize the plug-in nature of MISA for different methods and scenarios, as it is replay-independent, hyperparameter-free, and effective in GCL. Accordingly, our approach brings substantial performance gains compared to recent strong baselines. For instance, there is up to 18.39, 22.06, and 11.96% points performance lead on CIFAR-100, Tiny-ImageNet, and ImageNet-R datasets, respectively. Our contributions can be summarized as follows:

* We propose an innovative approach that addresses the poor initialization, limited generalizability, and severe forgetting of GCL, which features the ease of implementation, avoidance of CL-relevant hyperparameters, and plug-in nature for prompt-based methods.

* Our proposed forgetting-aware initial session adaptation effectively improves the initialization of prompt parameters and their generalizability to distribution shift, and our non-parametric logit masking rectifies the output layers to alleviate catastrophic forgetting.
* Across multiple challenging benchmarks, our approach outperforms a variety of existing methods by a wide margin, setting a new state of the art for GCL research.

## 2 RELATED WORK

**Continual Learning (CL).** The default setting of CL involves offline training of each task with explicit task boundaries. Representative methods for this setting can be divided into three groups (Wang et al., 2024b). The first one is *replay-based methods*, which store or generate a few old training samples for subsequent reuse (Buzzega et al., 2020; Wang et al., 2022a; Kang et al., 2023; Ostapenko et al., 2019). The second is *parameter isolation methods* (Serra et al., 2018; Jung et al., 2020), which allocates task-specific parameters to prevent overwriting. The third is *regularization-based methods*, which introduce regularization in loss functions to mitigate forgetting (Wu et al., 2019; Cha et al., 2021; Douillard et al., 2020). There have been attempts to regularize the sharpness of the loss surface to alleviate forgetting (Mirzadeh et al., 2020; Yang et al., 2023; Mehta et al., 2023), but these are limited to a training-from-scratch paradigm or shallow networks.

Prompt-based methods (Smith et al., 2023; Wang et al., 2022d;c; 2024a) provide another avenue for CL. In particular, they are state of the art for conventional CL settings, wherein the PTMs are frozen and a few prompt parameters are introduced for representation learning. They can be categorized into task-specific prompts (Razdaibiedina et al., 2023a; Wang et al., 2022b), shared-task prompts (Wang et al., 2022d; Smith et al., 2023) and their variants (Wang et al., 2022c; Hong et al., 2024). Although these methods perform well in conventional CL scenarios with adequate pretraining, they exhibit many problems in GCL, such as poor initial performance, limited generalizability, and severe catastrophic forgetting. Moreover, many advanced prompt-based methods are not adapted to GCL by design. For instance, CODA-Prompt (Smith et al., 2023) and NSP² (Lu et al., 2024) assume orthogonality between tasks, which cannot be satisfied in the case of blurry task boundaries. RanPAC (McDonnell et al., 2024) and HiDe-Prompt (Wang et al., 2024a) lack the design for online updates of class statistics in GCL.

**General Continual Learning (GCL)** is a broad concept to describe a variety of practical challenges in CL (De Lange et al., 2021). In addition to the primary focus on “online learning” and “blurry task boundaries” considered in our approach, other requirements of GCL like “constant memory” and “no test-time oracle” also play a crucial role in enabling the model to better adapt to real-world applications. These additional aspects will be briefly discussed in this paper as well to demonstrate that our approach is suitable for GCL. Various settings have been proposed as realizations of GCL (Aljundi et al., 2019; Koh et al., 2021; Moon et al., 2023). Si-Blurry (Moon et al., 2023) is one of the recent approaches for GCL to evaluate the two primary facets, which assumes that the distributions of training samples belonging to each class are randomly sampled in each task. Although there have been numerous attempts (Aljundi et al., 2019; Buzzega et al., 2020; Bang et al., 2021) to address GCL, they often focus on training from scratch and thus require replaying a few old training samples, achieving inferior performance with potential privacy issues. Gummadi et al. (2022) dealt with blurry task boundaries with novelty detection yet is designed for offline scenarios. The most recent and only prompt-based GCL method (Moon et al., 2023) demonstrated improved performance when using a pretrained backbone compared to training from scratch. However, it remains suboptimal in addressing the GCL challenges, yielding only marginal improvements over conventional prompt-based CL methods.

## 3 PRELIMINARIES

In this section, we review the problem setup of conventional CL and GCL, as well as the advanced prompt-based methods that address the former.

**Problem Setup.** Let $\mathcal{C}$ be the set of available classes whose cardinality is denoted as $N = |\mathcal{C}|$. Suppose that there are $T$ learning sessions or tasks. In conventional CL, we create a uniform partition $\{C_t\}_{t=1...T}$ of $\mathcal{C}$, where $C_t$ represents the classes assigned to task $t$. The number of classes in each task is identical, i.e., $\forall i, j, i \neq j, |C_i| = |C_j|$. In addition, at each task, the model can extensively iterate on the data with epoch $K \in \mathbb{N}$. In contrast, GCL relaxes the assumptions of clear boundaries and offline learning. Due to such blurry task boundaries, we opt for the notion of learning sessions,
<figure><img src="image_5.png" /><figcaption>Figure 2: An overview of our MISA with a frozen pretrained backbone in GCL. (a) Data in GCL consists of disjoint and blurry classes. (b) Initial session adaption is conducted prior to any CL sessions. Once finished, only the warmed-up prompt parameters are reused for CL. (c) Non-parametric logit mask which retains logits of available classes in a batch or a session.</figcaption></figure>

which represent different time steps in a one-pass data stream of GCL. Specifically, classes can overlap between learning sessions, such that:

$$ \forall i, j, i \neq j, P(\mathbb{C}_i \cap \mathbb{C}_j \neq \emptyset) > 0, \quad (1) $$

where P denotes probability. Moreover, due to the one-pass constraint on the data, the model can only perform one epoch over the data, such that $K = 1$. Consequently, GCL emphasizes realistic data distributions and the swift adaptation of the model.

The latest realization of GCL is Si-Blurry (Moon et al., 2023). Here, the available classes $\mathbb{C}$ are randomly divided into non-overlapping $\mathbb{C}^D$ and $\mathbb{C}^B$ for disjoint classes and blurry classes, respectively. The disjoint class ratio is defined as $m = |\mathbb{C}^D|/|\mathbb{C}|$. $\mathbb{C}^D$ and $\mathbb{C}^B$ are divided into non-uniform partitions $\{\mathbb{C}_t^D\}_{t=1...T}$ and $\{\mathbb{C}_t^B\}_{t=1...T}$, unlike the uniform distribution in conventional CL. Although all data corresponding to $\mathbb{C}^D$ is divided into disjoint sessions, there is a ratio of $n$ training samples from $\mathbb{C}^B$ being randomly shuffled across sessions, with $n$ as the blurry sample ratio. The stochastic nature of Si-Blurry is controlled by $m$ and $n$. As a realization of GCL, the shuffling of blurry classes satisfies Eq. 1. Moreover, Si-Blurry assumes an online scenario that naturally fits in the one-pass requirement of GCL. We also show in Appendix A.3 that Si-Blurry is a realization of generalized class incremental learning (Mi et al., 2020).

**Prompt-Based Methods.** We denote a pretrained vision transformer (ViT) (Dosovitskiy et al., 2020) as $f = f_c \circ f_r \circ f_e$, where $f_e$ is the input embedding network, $f_r$ is a stack of self-attention layers, and $f_c$ is the output layer(s). For an input image $x$ and its one-hot label vector $y$, let $f_e(x) = x_e \in \mathbb{R}^{L \times D}$ be the embedding features with $L$ the token length and $D$ the embedding dimension. Prompts are learnable parameters $p_e \in \mathbb{R}^{L_p \times D}$ prepended to the embedding features as $x_p = [p_e; x_e]$, with $L_p$ the prompt length. The extended features are forwarded to the network such that $\hat{y} = f_c \circ f_r(x_p)$, with $\hat{y} \in \mathbb{R}^N$ the prediction vector. Existing prompt-based methods (Wang et al., 2022d;c; Smith et al., 2023) for conventional CL usually train a pool of prompts and at each time select the most relevant ones through a query-key matching mechanism. Consequently, the poorly trained prompts can not only impair representation learning but also disrupt the matching mechanism, leading to degraded performance. Therefore, enhancing the knowledge encoded in prompts is crucial for improving these methods.

## 4 METHOD

We now present the two main components of our MISA, as shown in Fig. 2: (1) forgetting-aware initial session adaption (ISA), which warms up prompt parameters with forgetting-aware minimization (FAM) and prompt augmentation; and (2) non-parametric logit masking that rectifies the output of the model to avoid the interference of old and new knowledge. These two components provide benefits such as ease of implementation, avoidance of CL-relevant hyperparameters, and their plug-in nature for other prompt-based methods.
## 4.1 INITIAL SESSION ADAPTATION

We start by defining the initial session. In conventional (offline) CL, it has been overlooked that using the pretrained models for prompt-based methods implies an initial learning session of the backbone prior to any downstream CL sessions. To fully exploit the benefits of pretraining data, we propose to incorporate prompt parameters in the initial session of GCL. In particular, we leverage the pretraining dataset $D_{init}$ to prepare the prompt parameters for swift adaption. We warm up the prompt parameters in a supervised manner* for ISA, following the pretraining paradigm of the backbone. Accordingly, the supervised learning objective is defined as:

$$ \min_{\mathbf{p}_e, f_c} \sum_{(\mathbf{x}, \mathbf{y}) \in D_{init}} \mathcal{L}_{ce}(f_c \circ f_r([\mathbf{p}_e; \mathbf{x}_e]), \mathbf{y}), \qquad (2) $$

where $\mathcal{L}_{ce}$ is the cross-entropy loss. We omit the regularization term in Eq. 2 for simplicity. Both $\mathbf{p}_e$ and $f_c$ are randomly initialized. The learned $f_c$ will be discarded after this step, and only the learned $\mathbf{p}_e$ will be reused afterwards. The class prototypes learned from $D_{init}$ in $f_c$ are irrelevant to downstream tasks, as class identities are expected to change, making them ineffective for downstream use. Note that using the same pretraining dataset at the backbone is a design choice to ensure a fair comparison with existing methods, as the adaptation of $\mathbf{p}_e$ does not require any additional data, rather than a strict requirement of the ISA dataset. Additional experiments when pretraining data is partially or completely unavailable can be found in Appendix A.4.9.

There are several reasons for which ISA should naturally be effective. First, ISA for the prompt parameters is equivalent to the pretraining operation in an offline setting, which has already been shown effective in various settings. Second, ISA can also be seen as a particular initialization of prompts, which proved to be essential for the effectiveness of visual prompt tuning (Tsai et al., 2024; Shen et al., 2024). Lastly, from a domain adaptation perspective, the warmed-up prompts effectively reduce the domain gap to downstream GCL compared to randomly initialized prompts. It should be noted that ISA is designed to improve the poor learning capacity of visual prompts in GCL. Such limitation is less significant in conventional (offline) CL, as sufficient training with adequate differentiation of task-specific knowledge allows the prompts to eventually converge to a near-optimal stage. This highlights that our design is tailored to the particular challenges of GCL.

## 4.2 FORGETTING-AWARE MINIMIZATION

While naïvely initializing the prompt parameters using Eq. 2 on pretraining data can address issues due to poor initialization, this straightforward strategy lacks considerations for generalizability. Inspired by sharpness-aware minimization (SAM) that encourages the model to converge to a flat minima, we propose forgetting-aware minimization (FAM) in ISA, which seeks forgetting-aware flat minima and improves generalizability to distribution shift of prompt parameters.

**Vanilla SAM.** SAM (Foret et al., 2020) aims to reduce the sharpness of the loss surface by a minimax game: minimizing the maximal loss changes from a small perturbation $\epsilon$ on the model's learnable parameters $\theta$. The optimization objective is defined as:

$$ \min_{\theta} \max_{\|\epsilon\|_2 \le \rho} \mathcal{L}_{train}(\theta + \epsilon), \qquad (3) $$

where $\rho$ is the size of the neighborhood and $\mathcal{L}_{train}$ represents a general learning objective. The correlation between the flatness of the loss surface and less forgetting in CL has been revealed by Mirzadeh et al. (2020); Shi et al. (2021); Mehta et al. (2023), which motivates the use of SAM in CL (Yang et al., 2023). However, previous efforts mainly focus on a training-from-scratch paradigm of shallow ResNets, rather than a pretraining paradigm of large transformer backbones.

**Perturbation in Vanilla SAM.** The optimal perturbation $\epsilon^*$ can be calculated by using a first-order Taylor expansion of $\mathcal{L}_{train}(\theta + \epsilon)$ around $\theta$. This simplifies the original optimization problem into a linear-constrained one, which can be approximated as (Foret et al., 2020):

$$ \epsilon^* \triangleq \arg \max_{\|\epsilon\|_2 \le \rho} \mathcal{L}_{train}(\theta + \epsilon) \approx \rho \frac{\nabla_{\theta} \mathcal{L}_{train}(\theta)}{\|\nabla_{\theta} \mathcal{L}_{train}(\theta)\|_2}. \qquad (4) $$

<footnote>*We leave self-supervised warm-up as a potential future direction.</footnote>
Although this strategy has shown effectiveness in various situations, applying SAM directly to CL neglects the inherent conflict caused by distribution shift – a common challenge in CL. In particular, when the distribution of a new task diverges significantly from that of the previous task(s), the model is likely to be pulled from the initial flat loss surface to a sharp and unconstrained one. This phenomenon is widely recognized as a cause of forgetting, but here, it also contributes to a loss of generalizability of the initialized prompt parameters. Therefore, the perturbation in vanilla SAM is not a reliable estimation of future forgetting in CL, significantly limiting its effectiveness. To address this issue, our approach is to simulate such distribution shifts during ISA and estimate perturbations from them, thereby enhancing the robustness of the initialized parameters against forgetting and the loss of generalizability.

**Forgetting-Aware Minimization.** Our design improves generalizability by using gradients computed for external tasks as perturbations. We define the data from the target task as in-distribution data $D_{id}$ and the data from the external task as out-of-distribution data $D_{ood}$. While also minimizing the training loss under parameter perturbations, we target the perturbations that are consistent with the external task gradient, rather than those that lead to the maximum changes of the training loss. Consequently, this gradient represents the maximum forgetting for $D_{id}$ data caused by $D_{ood}$. Such perturbation pulls the model out of the loss space of $D_{id}$ and encourages the model to flatten as well as the loss surface for out-of-distribution data. This is a realistic simulation of the parameter update for downstream CL tasks after ISA. The overall optimization objective is defined as:

$$ \min_{\theta} \mathcal{L}_{\text{train}}(\theta + \delta; D_{id}), \qquad (5) $$

$$ \text{subject to} \quad \delta = -\rho \frac{\nabla_{\theta} \mathcal{L}_{\text{train}}(\theta; D_{ood})}{\|\nabla_{\theta} \mathcal{L}_{\text{train}}(\theta; D_{ood})\|_{2}}. \qquad (6) $$

Similar to SAM, $\rho$ is a constant controlling the neighborhood radius. Like SAM, our design requires only one additional backpropagation step. In practice, to avoid any additional data for ISA, we simply split the ISA dataset $D_{init}$ without overlap into a large subset of $D_{id}$ and a small subset of $D_{ood}^*$.

In summary, our FAM aims to not only find a flat loss surface, but also mitigate the loss of generalizability and performance for parameters initialized from ISA by proactively preventing future forgetting. Unlike conventional CL methods that address forgetting after it occurs, we take a preventative approach with the help of pretraining. While vanilla SAM offers some benefits in this regard, its perturbation is randomly chosen from the high-dimensional loss space unrelated to forgetting, and is ineffective in handling distribution shifts in CL. Accordingly, we use ISA data to create pseudo-downstream tasks, optimizing on a more targeted and informative direction of perturbation to obtain a more forget-aware flat loss surface. Notably, Eq. 5 and Eq. 6 exhibit a similar form to MAML (Finn et al., 2017) (i.e., a representative meta-learning framework), suggesting that our FAM promotes generalizability of forgetting-sensitive directions in a data-driven manner.

**Prompt Augmentation.** In preliminary experiments, we observe that vanilla SAM faces difficulties in optimizing in the limited and constrained space of the prompt parameters (see Appendix A.4.3). Therefore, we propose to use a prompt augmentation technique in ISA to directly increase the complexity of the learnable parameter space. Specifically, we have $p'_e = p_e + f_{\text{MLP}}(p_e)$ with $f_{\text{MLP}}$ is a shallow multi-layer perception (MLP) (Razdaibiedina et al., 2023b;a). With the additional parameters and non-linearity introduced by the MLP, the learning capacity is improved to enable the flatness-aware minimization for prompt-based methods. At the end of ISA, $f_{\text{MLP}}$ will be discarded and we store the augmented $p'_e$ for later purposes, as shown in Fig. 2 (b).

## 4.3 NON-PARAMETRIC LOGIT MASKING

**Logit Masking.** Although the blurry task boundaries of GCL result in a natural replay that partially alleviates forgetting, they make it more difficult for the model to handle the balance between learning and forgetting, especially in the output layers. Specifically, GCL not only leads to an imbalance in class distribution but also enforces the model to overfit the re-appeared classes $\mathbb{C}^B$ and thus

<footnote>*We leave the choice of external datasets as a future direction since the focus of this work is to enhance prompt parameters without demanding any external data.</footnote>
overwrite the knowledge of other previous tasks, especially the disjoint classes $\mathbb{C}^D$. This is a typical cause of forgetting when the model is trained with a supervised cross-entropy loss $\mathcal{L}_{ce}$. Output logit masking is known to be effective for this in conventional CL, as it isolates the logits of non-repeated classes to maintain their activation at test time. We have:

$$ \min_{\theta} \sum_{(x,y) \in \mathcal{D}} \mathcal{L}_{ce}(m \odot \hat{y}, y), \qquad (7) $$

where $\mathcal{D}$ is the dataset available and $\odot$ is an element-wise multiplication, $m \in \mathbb{R}^N$ is a masking vector that masks out some logits and keeps the rest. One of the latest works in GCL, MVP (Moon et al., 2023), trains a learnable mask to improve information retention. We empirically find that such a learnable mask is not desirable, as the method still suffers from strong forgetting to retain the knowledge of previous classes (see Fig. 1, Right).

**Non-Parametric Logit Masking.** After analyzing the purpose of the logit mask and the sub-optimality of existing learnable masks, we propose a simple logit mask that is parameter-free and can effectively reduce the information interference between classes. The first masking strategy is a session-level mask, where the mask is renewed at the end of each session and keeps the logits of available classes in the current session. However, it requires the notion of sessions, which is not always meaningful in an online setting. To this end, we further propose a batch-level mask that operates in the same way but at the batch level. We thus have:

$$ m_i = \begin{cases} 1, & \text{if } y_i = 1, \text{ for } (x, y) \in \mathcal{D}, \\ 0, & \text{otherwise,} \end{cases} \qquad (8) $$

where $y_i$ is the i-th entry of the one-hot label vector, and $\mathcal{D}$ is the set of available data. More precisely, when $\mathcal{D}$ refers to the data from a mini-batch, $m$ is a batch-level mask, as shown in Fig. 2 (c). Instead, when $\mathcal{D}$ refers to the data available for one session, $m$ is a session-level mask. We then multiply the mask with the prediction vector as defined in Eq. 7.

Despite its simplicity, non-parametric masking brings a substantial improvement in reducing forgetting, which allows the model to better adapt to GCL. The effectiveness of this simple logit masking arises from the disentanglement of representation learning and learning the classifier. With a frozen PTM ensuring a stable representation space, the mask effectively mitigates information interference in the output layers. In contrast, training-from-scratch approaches update all parameters simultaneously, reducing the efficacy of the logit mask. We include further analysis and comparison with the existing logit masking strategy Caccia et al. (2021) in Appendix A.4.10.

# 5 EXPERIMENTS

## 5.1 EXPERIMENTAL DETAILS

**Datasets.** We consider three representative datasets: CIFAR-100, Tiny-ImageNet and ImageNet-R with 60k, 100k, 30k training samples and 100, 200, 200 classes, respectively. We follow the setting in Si-Blurry (Moon et al., 2023) in our GCL experiments. Specifically, the disjoint class ratio $m$ is set to 50% and the blurry sample ratio $n$ is set to 10%. We perform 5-session GCL on these three datasets. An extended study of one new class at each session can be found in Appendix A.4.8. Unless specified, the results are obtained on 5 runs with independent seeds. By default, our ISA uses the ImageNet-1k dataset (Deng et al., 2009) of 1000-class large-scale images.

**Baselines.** We consider a variety of CL methods from different categories, including replay-based methods: ER (Rolnick et al., 2019), DER++ (Buzzega et al., 2020), ER-ACE (Caccia et al., 2021), Rainbow Memory (RM) (Bang et al., 2021), and CLIB (Koh et al., 2021); regularization-based methods: LwF (Li & Hoiem, 2018), EWC (Kirkpatrick et al., 2017); and prompt-based methods: L2P (Wang et al., 2022d) and DualPrompt (Wang et al., 2022c). We also compare with the best-performing state-of-the-art prompt-based GCL method to date: MVP (Moon et al., 2023). Continual fine-tuning and linear probing are considered as the lower-bound methods. All the methods share the same frozen pretrained vit-base-patch16-224 model, except EWC++ and fine-tuning that conducted full parameter tuning on the same pretrained model. Following the model architecture of MVP for a fair comparison, unless specified, we opt for DualPrompt as the baseline method and then add our components. We note that our proposed method is not restricted to specific model designs.
<table><caption>Table 1: Average accuracy (%) with standard deviation of different methods, tested with 5-task CIFAR-100, Tiny-ImageNet, and ImageNet-R.</caption><thead><tr><th rowspan="2">Buffer</th><th rowspan="2">Method</th><th colspan="2">CIFAR-100</th><th colspan="2">Tiny-ImageNet</th><th colspan="2">ImageNet-R</th></tr><tr><th>A<sub>AUC</sub> ↑</th><th>A<sub>Last</sub> ↑</th><th>A<sub>AUC</sub> ↑</th><th>A<sub>Last</sub> ↑</th><th>A<sub>AUC</sub> ↑</th><th>A<sub>Last</sub> ↑</th></tr></thead><tbody><tr><td rowspan="6">0</td><td>Finetuning</td><td>19.71±3.39</td><td>10.42±4.92</td><td>15.50±0.74</td><td>10.42±4.92</td><td>7.51±3.94</td><td>2.29±0.85</td></tr><tr><td>Linear Probe</td><td>49.69±6.09</td><td>23.07±7.33</td><td>42.15±2.79</td><td>21.97±6.43</td><td>29.24±1.26</td><td>16.87±3.14</td></tr><tr><td>EWC</td><td>49.51±0.52</td><td>52.83±2.31</td><td>51.70±2.89</td><td>31.04±3.12</td><td>31.58±1.04</td><td>20.72±1.11</td></tr><tr><td>LwF</td><td>55.51±3.49</td><td>36.53±10.96</td><td>49.00±1.52</td><td>27.47±7.59</td><td>31.61±1.53</td><td>20.62±3.67</td></tr><tr><td>L2P</td><td>57.08±4.43</td><td>41.63±12.73</td><td>52.09±1.92</td><td>35.05±5.73</td><td>29.65±1.63</td><td>19.55±4.78</td></tr><tr><td>DualPrompt</td><td>67.07±4.16</td><td>56.82±3.49</td><td>66.09±2.00</td><td>48.72±3.41</td><td>40.11±1.27</td><td>29.24±4.63</td></tr><tr><td>Ours</td><td>68.10±4.91</td><td>62.59±2.38</td><td>68.95±1.33</td><td>52.78±2.08</td><td>40.60±1.21</td><td>31.96±3.07</td></tr><tr><td rowspan="6">500</td><td>Ours</td><td>80.55±2.17</td><td>80.98±1.08</td><td>80.44±0.80</td><td>74.84±0.64</td><td>50.89±1.03</td><td>43.92±0.37</td></tr><tr><td>ER</td><td>65.57±4.77</td><td>60.68±1.15</td><td>59.46±1.81</td><td>40.60±2.71</td><td>40.31±1.33</td><td>28.85±1.43</td></tr><tr><td>DER++</td><td>66.92±4.16</td><td>65.63±0.72</td><td>61.67±1.19</td><td>46.03±1.00</td><td>40.32±1.08</td><td>31.53±1.57</td></tr><tr><td>ER-ACE</td><td>69.36±3.01</td><td>72.07±0.62</td><td>64.52±0.78</td><td>56.82±0.67</td><td>41.06±1.32</td><td>36.59±0.52</td></tr><tr><td>RM</td><td>40.86±3.32</td><td>23.94±0.61</td><td>31.96±0.80</td><td>7.43±0.27</td><td>18.31±1.09</td><td>4.14±0.18</td></tr><tr><td>CLIB</td><td>69.68±2.20</td><td>67.16±0.72</td><td>60.11±1.53</td><td>48.97±1.48</td><td>37.18±1.52</td><td>29.51±0.98</td></tr><tr><td>Ours</td><td>76.06±4.22</td><td>79.32±1.28</td><td>76.52±0.73</td><td>65.19±0.58</td><td>49.07±1.47</td><td>44.17±1.72</td></tr><tr><td rowspan="6">2000</td><td>Ours</td><td>82.37±1.54</td><td>82.27±0.73</td><td>79.08±0.60</td><td>69.91±0.52</td><td>54.72±1.15</td><td>47.48±0.57</td></tr><tr><td>ER</td><td>69.86±4.08</td><td>71.81±0.69</td><td>66.75±1.13</td><td>55.07±1.28</td><td>45.74±1.35</td><td>38.13±0.32</td></tr><tr><td>DER++</td><td>69.42±3.65</td><td>65.68±0.72</td><td>66.58±0.88</td><td>56.81±0.65</td><td>42.79±1.31</td><td>36.06±1.04</td></tr><tr><td>ER-ACE</td><td>70.59±3.02</td><td>74.75±0.19</td><td>66.86±0.84</td><td>58.40±0.38</td><td>43.62±1.31</td><td>40.49±0.22</td></tr><tr><td>RM</td><td>53.27±3.00</td><td>65.51±0.55</td><td>47.26±1.13</td><td>44.55±0.37</td><td>27.88±1.29</td><td>24.25±0.99</td></tr><tr><td>CLIB</td><td>71.53±2.61</td><td>72.09±0.49</td><td>65.47±0.76</td><td>56.87±0.54</td><td>42.69±1.30</td><td>35.43±0.38</td></tr><tr><td>Ours</td><td>78.65±3.59</td><td>84.42±0.44</td><td>80.67±0.75</td><td>74.34±0.32</td><td>52.47±1.45</td><td>50.54±2.08</td></tr><tr><td>Ours</td><td>83.58±1.72</td><td>85.32±0.25</td><td>82.91±0.47</td><td>76.41±0.33</td><td>57.67±0.72</td><td>53.62±0.68</td></tr></tbody></table>

<table><caption>Table 2: Ablation studies of the proposed forgetting-aware initial session adaption (ISA-FAM) and non-parametric logit mask (Logit Mask) in MISA.</caption><thead><tr><th rowspan="2">Method</th><th colspan="2">Component</th><th colspan="2">CIFAR-100</th><th colspan="2">ImageNet-R</th></tr><tr><th>ISA-FAM</th><th>Logit Mask</th><th>A<sub>AUC</sub> ↑</th><th>F<sub>Last</sub> ↓</th><th>A<sub>AUC</sub> ↑</th><th>F<sub>Last</sub> ↓</th></tr></thead><tbody><tr><td>Baseline</td><td></td><td></td><td>67.07±4.16</td><td>35.12±2.44</td><td>40.11±1.27</td><td>43.27±6.35</td></tr><tr><td rowspan="3">Ours</td><td>✓</td><td></td><td>68.97±0.85</td><td>30.01±4.14</td><td>41.09±1.74</td><td>41.51±7.75</td></tr><tr><td></td><td>✓</td><td>74.84±2.99</td><td>11.71±1.56</td><td>45.59±1.71</td><td>20.84±5.49</td></tr><tr><td></td><td>✓</td><td>80.55±2.17</td><td>10.35±1.12</td><td>50.89±1.03</td><td>19.91±4.21</td></tr></tbody></table>

**Implementation Details.** For existing methods, we reuse the implementation of Moon et al. (2023). For MISA, we follow the same training configuration to ensure a fair comparison, e.g., using an Adam optimizer with learning rate 0.005 and batch size 32. In ISA, we use an Adam optimizer with learning rate 0.0001 and batch size 128 to train the prompts in an offline manner for three epochs. For FAM, we split ImageNet-1k into 900 classes for $D_{id}$ and 100 classes for $D_{ood}$ without overlap. We randomly sample 10 classes as $D_{ood}$ to simulate a small-scale downstream task and resample new ones when we iterate over this subset. More aggressive augmentation is applied on $D_{ood}$ data as we applied double auto-augmentation (Cubuk et al., 2019). For a fair comparison with existing logit masking strategies, we apply our batch-level mask in MISA by default as it does not require a session identifier. More details can be found in Appendix A.1.

**Evaluation Metrics.** We follow the evaluation protocol of Moon et al. (2023), using $A_{AUC}$ and $A_{Last}$ as the main evaluation metrics. $A_{AUC}$ (Koh et al., 2021) measures the performance of anytime inference, with no task labels provided to satisfy the “no test-time oracle” requirement in GCL. $A_{Last}$ is equivalent to the final average accuracy in conventional CL. As we identified forgetting as an essential issue in existing methods, we include $F_{Last}$ as the average forgetting at the end of training. More details on these metrics can be found in Appendix A.2.

## 5.2 BENCHMARK RESULTS

We compare our MISA to existing methods in Tab.1. Our approach consistently outperforms all the other methods by a significant margin, especially when the model is trained *without* rehearsal, i.e., buffer size = 0. This is an extremely challenging case as previous GCL methods often rely on a reply buffer to alleviate forgetting. Specifically, MISA outperforms the previous state-of-the-art MVP by 18.39, 22.06, and 11.96 % points in $A_{Last}$ on CIFAR-100, Tiny-ImageNet, and ImageNet-R datasets, respectively. While $A_{Last}$ focuses on the overall performance at the end of the training, $A_{AUC}$ better exhibits the effectiveness in adaptation to the online data stream. Our approach outperforms MVP
<table><caption>Table 3: Comparison of different masking strategies with different batch sizes. All masking strategies are applied to the same baseline method.</caption><thead><tr><th rowspan="2">Mask</th><th colspan="3">Buffer 0</th><th colspan="3">Buffer 500</th></tr><tr><th>1</th><th>32</th><th>64</th><th>1</th><th>32</th><th>64</th></tr></thead><tbody><tr><td>Seen-Class</td><td>35.41±0.87</td><td>39.40±2.72</td><td>37.15±1.64</td><td>42.68±1.24</td><td>48.91±2.00</td><td>45.32±1.74</td></tr><tr><td>Learnable</td><td>36.00±1.54</td><td>39.88±1.73</td><td>37.74±1.49</td><td>44.40±1.97</td><td>44.83±1.86</td><td>43.49±2.11</td></tr><tr><td>Batch-Level</td><td>1.50±0.04</td><td>45.59±1.71</td><td><b>48.41±2.14</b></td><td>34.14±0.89</td><td><b>49.00±1.46</b></td><td>47.87±2.60</td></tr><tr><td>Session-Level</td><td><b>44.19±0.19</b></td><td><b>48.71±3.57</b></td><td>48.19±2.31</td><td><b>44.58±0.77</b></td><td>48.99±2.00</td><td><b>50.26±1.16</b></td></tr></tbody></table>

<table><caption>Table 4: A<sub>AUC</sub> scores on CIFAR100 and ImageNet-R with prompts obtained by different strategies.</caption><thead><tr><th>Method</th><th>Logit Mask</th><th>Naive ISA</th><th>SAM</th><th>FAM</th><th>CIFAR-100</th><th>ImageNet-R</th></tr></thead><tbody><tr><td>Baseline</td><td>✓</td><td></td><td></td><td></td><td>74.84±2.99</td><td>45.59±1.71</td></tr><tr><td rowspan="3">Ours</td><td>✓</td><td>✓</td><td></td><td></td><td>77.21±2.66</td><td>47.71±1.31</td></tr><tr><td>✓</td><td>✓</td><td>✓</td><td></td><td>79.13±2.38</td><td>49.99±1.21</td></tr><tr><td>✓</td><td>✓</td><td></td><td>✓</td><td><b>80.55±2.17</b></td><td><b>50.89±1.03</b></td></tr></tbody></table>

by a margin of 12.45, 11.49, and 10.29 % points in A<sub>AUC</sub> on the three datasets, respectively. In particular, MISA beats all conventional CL methods in this measure, which was not achieved by MVP. Furthermore, our approach significantly reduces the variance of the performance with different stochastic classes and data compositions, which confirms its robustness to different realistic learning scenarios.

The integration of the replay buffer can further improve our approach and ensure its standout performance over existing methods in the same configuration. We also note that MVP benefits more from the replay buffer than MISA. We believe it is because MVP suffers from strong forgetting due to their ineffective logit mask. The existence of a replay buffer relieves MVP from this issue. In contrast, MISA better handles the interference of new and old knowledge through our non-parametric logit masking and performs consistently well with or without a replay buffer. Therefore, the replay-independent nature makes MISA a more suitable choice in practice.

## 5.3 FURTHER ANALYSIS

**Ablation Study.** We present the ablation study on CIFAR-100 and ImageNet-R for our proposed components in Tab. 2. The baseline method is overwhelmed by severe forgetting, which prevents the model from accumulating knowledge for good average accuracy, even with forgetting-aware ISA (ISA-FAM). Instead, with the integration of our non-parametric logit masking, forgetting is largely reduced and the performance improves. Finally, without the interference of forgetting, ISA-FAM becomes much more effective. These experiments justify the importance of swift adaption and knowledge retention, as well as their complementary roles in GCL.

**Logit Masking vs Batch Size.** We examine the effectiveness of different logit masking strategies for different batch sizes in Tab. 3. Our session-level masking performs especially well when no replay buffer is available. Unsurprisingly, batch-level mask fails when batch size = 1. This corresponds to an extreme case of online learning where the model receives one sample at a time, which is out of the scope for our paper. In addition, the batch-level mask can quickly recover the performance with a replay buffer. Notably, both our non-parametric masks outperform the learnable mask in most cases.

**Effectiveness of FAM in ISA.** We perform a specific ablation study for our forgetting-aware ISA training strategy, by comparing the impact of prompt parameters with different initialization strategies in Tab. 4. All the methods are equipped with our non-parametric logit mask to overcome the negative impact of strong forgetting. The baseline method utilizes a uniform initialization for prompt parameters. Initializing prompts from a naive ISA, i.e., pretraining with Eq. 2, provides better initialization but lacks considerations for generalizability. Thus, direct integration of SAM can improve performance. Our FAM further boosts the model by enhancing the robustness to distribution shift to maintain the generalizability in downstream GCL, as highlighted by the A<sub>AUC</sub> score. Note that both SAM and FAM are equipped with prompt augmentation to enable flatness-aware minimization, whose ablation study can be found in Appendix A.4.4.
<table><caption>Table 5: Validation of transferability of our proposed components on existing prompt-based methods on ImageNet-R. For ISA, both methods reuse the same prompts as our approach.</caption><thead><tr><th>Baseline</th><th>ISA-FAM & Logit Mask</th><th>A<sub>AUC</sub> ↑</th><th>A<sub>Last</sub> ↑</th></tr></thead><tbody><tr><td>L2P</td><td>✓</td><td>29.42<sub>±1.46</sub><br><b>34.11<sub>±0.36</sub></b></td><td>20.46<sub>±4.17</sub><br><b>27.86<sub>±1.11</sub></b></td></tr><tr><td>MVP</td><td>✓</td><td>40.60<sub>±1.21</sub><br><b>43.01<sub>±1.26</sub></b></td><td>31.96<sub>±3.07</sub><br><b>33.52<sub>±3.38</sub></b></td></tr></tbody></table>

<table><caption>Table 6: Performance of pre-trained checkpoint *not* overlapping with CIFAR-100 or Tiny-ImageNet.</caption><thead><tr><th rowspan="2">Method</th><th colspan="2">CIFAR-100</th><th colspan="2">Tiny-ImageNet</th><th colspan="2">ImageNet-R</th><th colspan="2">NCH</th></tr><tr><th>A<sub>AUC</sub></th><th>A<sub>Last</sub></th><th>A<sub>AUC</sub></th><th>A<sub>Last</sub></th><th>A<sub>AUC</sub></th><th>A<sub>Last</sub></th><th>A<sub>AUC</sub></th><th>A<sub>Last</sub></th></tr></thead><tbody><tr><td>EWC</td><td>41.5<sub>±6.6</sub></td><td>29.4<sub>±3.3</sub></td><td>40.9<sub>±2.3</sub></td><td>23.3<sub>±5.5</sub></td><td>31.8<sub>±1.3</sub></td><td>19.9<sub>±6.2</sub></td><td>50.0<sub>±12.4</sub></td><td>32.6<sub>±9.7</sub></td></tr><tr><td>DualPrompt</td><td>47.2<sub>±2.8</sub></td><td>42.7<sub>±4.6</sub></td><td>48.2<sub>±1.1</sub></td><td>31.2<sub>±2.7</sub></td><td>33.7<sub>±1.0</sub></td><td>26.7<sub>±0.8</sub></td><td>60.6<sub>±11.7</sub></td><td>49.4<sub>±7.8</sub></td></tr><tr><td>MVP</td><td>48.8<sub>±5.1</sub></td><td>35.5<sub>±5.1</sub></td><td>46.5<sub>±2.0</sub></td><td>26.8<sub>±4.5</sub></td><td>35.4<sub>±1.4</sub></td><td>24.2<sub>±4.4</sub></td><td>60.4<sub>±10.1</sub></td><td>43.5<sub>±11.6</sub></td></tr><tr><td>Ours</td><td><b>55.7</b><sub>±1.9</sub></td><td><b>53.8</b><sub>±3.6</sub></td><td><b>56.5</b><sub>±2.0</sub></td><td><b>47.4</b><sub>±1.7</sub></td><td><b>41.2</b><sub>±1.0</sub></td><td><b>35.9</b><sub>±0.9</sub></td><td><b>71.2</b><sub>±3.3</sub></td><td><b>61.8</b><sub>±7.4</sub></td></tr></tbody></table>

**Transferability of MISA.** Our approach is designed to be general and plug-in for prompt-based CL methods. To demonstrate this transferability, we evaluate our approach with two other methods: L2P and MVP. The former is a representative prompt-based method for conventional CL, and the latter is the previous state-of-the-art prompt-based method for GCL. As shown in Tab. 5, both methods can benefit from our design. Note that these methods share the same initialized prompts parameters as our approach, without performing additional ISA. The full results can be found in Appendix A.4.1.

**Knowledge Overlap Analysis.** This analysis aims to reduce the potential knowledge overlap between pretraining data and downstream GCL. Specifically, we consider a particular pretrained checkpoint (Kim et al., 2022), which removes 389 classes from ImageNet-1k that are similar to CIFAR-100 or Tiny-ImageNet. We repeat our experiments on this subset of ImageNet-1k to exclude information leaks to either the backbone or prompt parameters from ISA. Moreover, we included a completely out-of-distribution dataset NCH (Kather et al., 2018) from the medical image domain to showcase the transferability of our learned prompts. As shown in Tab. 6, our approach still achieves substantial improvements over all baselines (see details in Appendix A.4.2).

**Memory and Computation Analysis.** We analyze in Tab.7 the complexity of representative methods. Specifically, we report the average execution time for each method to learn from one batch on 1 RTX A5000 GPU. Our approach brings a significant performance gain without introducing additional parameters or increased execution time. Combined with the replay-independent nature, our MISA has further satisfied the requirements of GCL in terms of constant memory.

<table><caption>Table 7: Comparison of resource overheads with the same machine and configuration.</caption><thead><tr><th>Method</th><th># Param.</th><th>Time</th><th>Accuracy</th></tr></thead><tbody><tr><td>DualPrompt</td><td>637k</td><td>1.31s</td><td>67.07</td></tr><tr><td>MVP</td><td>639k</td><td>2.75s</td><td>68.10</td></tr><tr><td>Ours</td><td>637k</td><td>1.32s</td><td><b>80.55</b></td></tr></tbody></table>

**CL-Relevant Hyperparameters.** We argue that the hyperparameters of MVP selected with validation data from a static view is contradictory to the stochastic nature of data distribution. In contrast, our approach does not require CL-relevant hyperparameters, which is an important advantage for facilitating the use of our components in other methods or scenarios such as GCL.

## 6 CONCLUSION

In this paper, we advance prompt-based methods in the challenging GCL setting with our novel approach MISA, which consists of a forgetting-aware initial session adaption to improve learning efficiency and generalizability of the prompt parameters, and a non-parametric logit mask to alleviate forgetting of the output layers. Our extensive experiments show the effectiveness of each component and the significant performance gain compared to existing methods, setting a new state of the art for GCL. Moreover, our approach is compatible with other prompt-based CL methods, which can seamlessly benefit from our components. Finally, our approach overcomes the need for CL-relevant hyperparameters and is independent of replay data, enabling robustness and flexibility for CL applications.
REPRODUCIBILITY STATEMENT

To ensure the reproducibility of our work, we have provided comprehensive details about the ex-
perimental setup in Section 5, including datasets used, baseline methods, implementation details
and evaluation metrics. More details about the implementation can be found in Appendix A.1. All
code, models, and configuration files required to replicate our results are made publicly available in
a repository.

REFERENCES

Abien Fred Agarap. Deep learning using rectified linear units (relu). *arXiv preprint* [arXiv:1803.08375](https://arxiv.org/abs/1803.08375), 2018.

Hongjoon Ahn, Jihwan Kwak, Subin Lim, Hyeonsu Bang, Hyojun Kim, and Taesup Moon. SS-IL: Separated softmax for incremental learning. In *ICCV*, pp. 844–853, 2021.

Rahaf Aljundi, Min Lin, Baptiste Goujaud, and Yoshua Bengio. Gradient based sample selection for online continual learning. *NeurIPS*, 32, 2019.

Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.

Jihwan Bang, Heesu Kim, YoungJoon Yoo, Jung-Woo Ha, and Jonghyun Choi. Rainbow memory: Continual learning with a memory of diverse samples. In CVPR, pp. 8218–8227, 2021.

Pietro Buzzega, Matteo Boschini, Angelo Porrello, Davide Abati, and Simone Calderara. Dark experience for general continual learning: a strong, simple baseline. In *NeurIPS*, 2020.

Lucas Caccia, Rahaf Aljundi, Nader Asadi, Tinne Tuytelaars, Joelle Pineau, and Eugene Belilovsky. New insights on reducing abrupt representation change in online continual learning. *arXiv preprint arXiv:2104.05025*, 2021.

Hyuntak Cha, Jaeho Lee, and Jinwoo Shin. Co2l: Contrastive continual learning. In CVPR, pp. 9516–9525, 2021.

Xiangning Chen, Cho-Jui Hsieh, and Boqing Gong. When vision transformers outperform resnets
without pre-training or strong data augmentations. *arXiv preprint arXiv:2106.01548*, 2021.

Ekin D Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, and Quoc V Le. Autoaugment: Learning augmentation strategies from data. In CVPR, pp. 113–123, 2019.

Matthias De Lange, Rahaf Aljundi, Marc Masana, Sarah Parisot, Xu Jia, Aleš Leonardis, Gregory Slabaugh, and Tinne Tuytelaars. A continual learning survey: Defying forgetting in classification tasks. *PAMI*, 44(7):3366–3385, 2021.

Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, pp. 248–255. IEEE, 2009.

Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.

Arthur Douillard, Matthieu Cord, Charles Ollion, Thomas Robert, and Eduardo Valle. Podnet: Pooled outputs distillation for small-tasks incremental learning. In ECCV, 2020.

Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In ICML, pp. 1126–1135. PMLR, 2017.

Pierre Foret, Ariel Kleiner, Hossein Mobahi, and Behnam Neyshabur. Sharpness-aware minimization for efficiently improving generalization. arXiv preprint arXiv:2010.01412, 2020.
Meghna Gummadi, David Kent, Jorge A Mendez, and Eric Eaton. Shels: Exclusive feature sets for novelty detection and continual learning without class boundaries. In *Conference on Lifelong Learning Agents*, pp. 1065–1085. PMLR, 2022.

Chenxing Hong, Yan Jin, Zhiqi Kang, Yizhou Chen, Mengke Li, Yang Lu, and Hanzi Wang. Dynamically anchored prompting for task-imbalanced continual learning. *arXiv preprint arXiv:2404.14721*, 2024.

Sangwon Jung, Hongjoon Ahn, Sungmin Cha, and Taesup Moon. Continual learning with node-importance based adaptive group sparse regularization. *NeurIPS*, 33:3647–3658, 2020.

Zhiqi Kang, Enrico Fini, Moin Nabi, Elisa Ricci, and Karteek Alahari. A soft nearest-neighbor framework for continual semi-supervised learning. In *ICCV*, pp. 11868–11877, 2023.

Jakob Nikolas Kather, Niels Halama, and Alexander Marx. 100,000 histological images of human colorectal cancer and healthy tissue, May 2018. URL https://doi.org/10.5281/zenodo.1214456.

Gyuhak Kim, Bing Liu, and Zixuan Ke. A multi-head model for continual learning via out-of-distribution replay. In *Conference on Lifelong Learning Agents*, pp. 548–563. PMLR, 2022.

James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, et al. Overcoming catastrophic forgetting in neural networks. *PNAS*, 2017.

Hyunseo Koh, Dahyun Kim, Jung-Woo Ha, and Jonghyun Choi. Online continual learning on class incremental blurry task configuration with anytime inference. *arXiv preprint arXiv:2110.10031*, 2021.

Brian Lester, Rami Al-Rfou, and Noah Constant. The power of scale for parameter-efficient prompt tuning. *arXiv preprint arXiv:2104.08691*, 2021.

Zhizhong Li and Derek Hoiem. Learning without forgetting. *PAMI*, 2018.

Dongze Lian, Daquan Zhou, Jiashi Feng, and Xinchao Wang. Scaling & shifting your features: A new baseline for efficient model tuning. *Advances in Neural Information Processing Systems*, 35: 109–123, 2022.

Yue Lu, Shizhou Zhang, De Cheng, Yinghui Xing, Nannan Wang, Peng Wang, and Yanning Zhang. Visual prompt tuning in null space for continual learning. *arXiv preprint arXiv:2406.05658*, 2024.

Michael McCloskey and Neal J Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. *Psychology of Learning and Motivation*, 24:109–165, 1989.

Mark D McDonnell, Dong Gong, Amin Parvaneh, Ehsan Abbasnejad, and Anton van den Hengel. Ranpac: Random projections and pre-trained models for continual learning. *NeurIPS*, 36, 2024.

Sanket Vaibhav Mehta, Darshan Patil, Sarath Chandar, and Emma Strubell. An empirical investigation of the role of pre-training in lifelong learning. *JMLR*, 24(214):1–50, 2023.

Fei Mi, Lingjing Kong, Tao Lin, Kaicheng Yu, and Boi Faltings. Generalized class incremental learning. In *CVPR Workshops*, pp. 240–241, 2020.

Seyed Iman Mirzadeh, Mehrdad Farajtabar, Razvan Pascanu, and Hassan Ghasemzadeh. Understanding the role of training regimes in continual learning. *NeurIPS*, 33:7308–7320, 2020.

Jun-Yeong Moon, Keon-Hee Park, Jung Uk Kim, and Gyeong-Moon Park. Online class incremental learning on stochastic blurry task boundary via mask and visual prompt tuning. In *ICCV*, pp. 11731–11741, 2023.

Oleksiy Ostapenko, Mihai Puscas, Tassilo Klein, Patrick Jahnichen, and Moin Nabi. Learning to remember: A synaptic plasticity driven framework for continual learning. In *CVPR*, 2019.
Anastasia Razdaibiedina, Yuning Mao, Rui Hou, Madian Khabsa, Mike Lewis, and Amjad Almahairi. *Progressive prompts: Continual learning for language models.* arXiv preprint arXiv:2301.12314, 2023a.

Anastasia Razdaibiedina, Yuning Mao, Rui Hou, Madian Khabsa, Mike Lewis, Jimmy Ba, and Amjad Almahairi. *Residual prompt tuning: Improving prompt tuning with residual reparameterization.* arXiv preprint arXiv:2305.03937, 2023b.

David Rolnick, Arun Ahuja, Jonathan Schwarz, Timothy Lillicrap, and Gregory Wayne. *Experience replay for continual learning.* NeurIPS, 32, 2019.

Joan Serra, Didac Suris, Marius Miron, and Alexandros Karatzoglou. *Overcoming catastrophic forgetting with hard attention to the task.* In ICML, 2018.

Sheng Shen, Shijia Yang, Tianjun Zhang, Bohan Zhai, Joseph E Gonzalez, Kurt Keutzer, and Trevor Darrell. *Multitask vision-language prompt tuning.* In WACV, pp. 5656–5667, 2024.

Guangyuan Shi, Jiaxin Chen, Wenlong Zhang, Li-Ming Zhan, and Xiao-Ming Wu. *Overcoming catastrophic forgetting in incremental few-shot learning by finding flat minima.* NeurIPS, 34: 6747–6761, 2021.

James Seale Smith, Leonid Karlinsky, Vyshnavi Gutta, Paola Cascante-Bonilla, Donghyun Kim, Assaf Arbelle, Rameswar Panda, Rogerio Feris, and Zsolt Kira. *Coda-prompt: Continual de-composed attention-based prompting for rehearsal-free continual learning.* In CVPR, pp. 11909–11919, 2023.

Bart Thomee, David A Shamma, Gerald Friedland, Benjamin Elizalde, Karl Ni, Douglas Poland, Damian Borth, and Li-Jia Li. *Yfcc100m: The new data in multimedia research.* Communications of the ACM, 59(2):64–73, 2016.

Yun-Yun Tsai, Chengzhi Mao, and Junfeng Yang. *Convolutional visual prompt for robust visual perception.* Advances in Neural Information Processing Systems, 36, 2024.

Tu Vu, Brian Lester, Noah Constant, Rami Al-Rfou, and Daniel Cer. *Spot: Better frozen model adaptation through soft prompt transfer.* arXiv preprint arXiv:2110.07904, 2021.

Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge Belongie. *The caltech-ucsd birds-200-2011 dataset.* Technical Report CNS-TR-2011-001, California Institute of Technology, 2011.

Fu-Yun Wang, Da-Wei Zhou, Han-Jia Ye, and De-Chuan Zhan. *Foster: Feature boosting and compression for class-incremental learning.* In ECCV, pp. 398–414. Springer, 2022a.

Liyuan Wang, Jingyi Xie, Xingxing Zhang, Mingyi Huang, Hang Su, and Jun Zhu. *Hierarchical decomposition of prompt-based continual learning: Rethinking obscured sub-optimality.* NeurIPS, 36, 2024a.

Liyuan Wang, Xingxing Zhang, Hang Su, and Jun Zhu. *A comprehensive survey of continual learning: Theory, method and application.* PAMI, 2024b.

Yabin Wang, Zhiwu Huang, and Xiaopeng Hong. *S-prompt: Learning with pre-trained transformers: An occam's razor for domain incremental learning.* NeurIPS, 35:5682–5695, 2022b.

Zifeng Wang, Zizhao Zhang, Sayna Ebrahimi, Ruoxi Sun, Han Zhang, Chen-Yu Lee, Xiaoqi Ren, Guolong Su, Vincent Perot, Jennifer Dy, et al. *Dualprompt: Complementary prompting for rehearsal-free continual learning.* In ECCV, pp. 631–648. Springer, 2022c.

Zifeng Wang, Zizhao Zhang, Chen-Yu Lee, Han Zhang, Ruoxi Sun, Xiaoqi Ren, Guolong Su, Vincent Perot, Jennifer Dy, and Tomas Pfister. *Learning to prompt for continual learning.* In CVPR, pp. 139–149, 2022d.

Yue Wu, Yinpeng Chen, Lijuan Wang, Yuancheng Ye, Zicheng Liu, Yandong Guo, and Yun Fu. *Large scale incremental learning.* In CVPR, 2019.

Enneng Yang, Li Shen, Zhenyi Wang, Shiwei Liu, Guibing Guo, and Xingwei Wang. *Data augmented flatness-aware gradient projection for continual learning.* In ICCV, pp. 5630–5639, 2023.
# A APPENDIX

## A.1 IMPLEMENTATION DETAILS

We follow the implementation of Moon et al. (2023) for a fair comparison with existing methods. Specifically, all methods use a pretrained ViT checkpoint ViT-B/16 (Dosovitskiy et al., 2020). We freeze the backbone, learning only the prompt parameters and the classification head. As such, the total number of parameters is around 86M, whereas the trainable one is around 0.6M. We equip our approach with the same memory buffer as DualPrompt in the implementation of Moon et al. (2023) with size 500 and 2000, if applicable.

For forgetting-aware optimization, we use the first 900 classes of ImageNet-1k as $D_{id}$ for initializing the parameters and the last 100 classes for $D_{ood}$ to calculate perturbation. During training, we randomly sample 10 classes as actual $D_{ood}$. Since this subset is smaller than $D_{id}$, whenever we go through the entire small subset, we will resample the other 10 classes. We will repeat this process until the end of training. To apply a more aggressive data augmentation on $D_{ood}$ data, we applied two times AutoAugment to augment the image, while for $D_{id}$ data, we only applied it once.

For prompt augmentation, we use a two-layer MLP with projection dimensions (768, 96) and (96, 768), which corresponds to a down-sampling rate of 1/8 for the feature dimension $D$. We empirically found it more effective than up-sampling. We add LayerNorm (Ba et al., 2016) and ReLU (Agarap, 2018) activation in between these two layers. Once the ISA is finished, this MLP is discarded.

## A.2 EVALUATION METRICS

We start from conventional evaluation metrics in CL. Let $R_{i,j}$ be the evaluation score of the model after session $i$ with respect to the data in the session $j$. We then have an evaluation matrix $R$ such that the column $R_j$ shows the history of evaluation after each session with respect to the data in the session $j$. The final accuracy $A_{Last}$ can be defined as:

$$A_{Last} = \frac{1}{T} \sum_{i=1}^{T} R_{T,i}, \qquad (9)$$

and the forgetting can be defined as:

$$F_{Last} = \frac{1}{T} \sum_{i=1}^{T} (\max(R_j) - R_{T,i}), \qquad (10)$$

where $A_{Last}$ is the higher the better and $F_{Last}$ is the lower the better.

$A_{AUC}$ is the anytime inference metric proposed by Koh et al. (2021) to evaluate the GCL performance. Here, the evaluation is not performed at the end of each session but whenever the model observes a number of $n$ samples. Let the total number of evaluations performed be $L$ and $l$ be the time-step for evaluation. We have:

$$A_{AUC} = \frac{1}{L} \sum_{l=1}^{L} R_{l,l}, \qquad (11)$$

where $R_{l,l}$ shows the evaluation score of the model at the time-step $l$ with respect to the data it has observed until time-step $l$.

## A.3 SI-BLURRY AS A REALIZATION OF GENERALIZED CLASS INCREMENTAL LEARNING

Following the definition of generalized class incremental learning (GCIL) in Mi et al. (2020), we reformulate the Si-Blurry scenario in this GCIL framework. Let $\mathbb{C}$ be the set of available classes whose cardinality is $N = |\mathbb{C}|$. Let $\{\mathbb{C}^D, \mathbb{C}^B\}$ be a partition of $\mathbb{C}$ where $\mathbb{C}^D$ represents disjoint classes and $\mathbb{C}^B$ represents blurred classes. $m$ is the disjoint class ratio such that $m = |\mathbb{C}^D|/|\mathbb{C}|$. Let $\mathbb{X}$ be the set of available samples, we thus have: $\mathbb{X}^D = \{x_i : y_i \in \mathbb{C}^D\}$ and $\mathbb{X}^B = \{x_i : y_i \in \mathbb{C}^B\}$, where $y_i$ is the class label of the sample $x_i$. Let $T$ be the total number of learning sessions. $\{\mathbb{C}_t^D\}_{t=1...T}$ and $\{\mathbb{C}_t^B\}_{t=1...T}$ are then a partition of $\mathbb{C}^D$ and $\mathbb{C}^B$ to allocate classes for each session,
<table><caption>Table 8: Validation of transferability of our proposed components on existing prompt-based methods. We perform experiments on 5-task ImageNet-R, averaged over 5 runs.</caption><thead><tr><th rowspan="2">Baseline</th><th colspan="2">Component</th><th colspan="2">ImageNet-R</th></tr><tr><th>Init-Adapt</th><th>Logit-Mask</th><th>A<sub>AUC</sub> ↑</th><th>A<sub>Last</sub> ↑</th></tr></thead><tbody><tr><td rowspan="3">L2P</td><td>✓</td><td></td><td>29.42±1.46</td><td>20.46±4.17</td></tr><tr><td></td><td>✓</td><td>31.72±1.36</td><td>21.09±3.87</td></tr><tr><td>✓</td><td>✓</td><td>31.84±2.99</td><td>25.88±0.83</td></tr><tr><td></td><td></td><td></td><td><b>34.11</b>±0.36</td><td><b>27.86</b>±1.11</td></tr><tr><td rowspan="3">MVP</td><td>✓</td><td></td><td>40.60±1.21</td><td>31.96±3.07</td></tr><tr><td></td><td>✓</td><td>41.12±1.77</td><td>32.05±1.32</td></tr><tr><td>✓</td><td>✓</td><td>40.98±0.85</td><td>32.31±3.32</td></tr><tr><td></td><td></td><td></td><td><b>43.01</b>±1.26</td><td><b>33.52</b>±3.38</td></tr></tbody></table>

respectively. In Si-Blurry, the number of classes for each session is not uniform across tasks as the number is randomly sampled. For disjoint data, we have $\mathcal{X}_t^D = \{x_i : y_i \in \mathbb{C}_t^D\}$. Let $\{\tilde{\mathcal{X}}^B, \bar{\mathcal{X}}^B\}$ be a partition of $\mathcal{X}^B$, with a blurry sample ratio $n = |\tilde{\mathcal{X}}^B|/|\mathcal{X}^B|$. $\bar{\mathcal{X}}^B$ is a normal set and $\tilde{\mathcal{X}}^B$ is the blurred set. $\tilde{\mathcal{X}}^B$ will be divided into sessions as $\tilde{\mathcal{X}}_t^B = \{x_i : x_i \in \tilde{\mathcal{X}}^B, y_i \in \mathbb{C}_t^B\}$. In a blurred boundary setting, $\tilde{\mathcal{X}}^B$ is non-empty and will be shuffled and randomly distributed to different sessions as $\{\tilde{\mathcal{X}}_t^B\}$. The final set of data available to the session $t$ is then $\mathcal{X}_t = \mathcal{X}_t^D \cup \tilde{\mathcal{X}}_t^B \cup \tilde{\mathcal{X}}_t^B$. Accordingly, the classes available for the session is $\mathbb{C}_t = \mathbb{C}_t^D \cup \mathbb{C}_t^B \cup \tilde{\mathbb{C}}_t^B$ where $\forall x_i \in \tilde{\mathcal{X}}_t^B, y_i \in \tilde{\mathbb{C}}_t^B$. With this formulation, we revisit the properties of GCIL defined in Mi et al. (2020) to show that Si-Blurry can be seen as a realization of GCIL in an online learning paradigm.

**Property 1:** The number of classes could differ in each session. We have:

$$ \forall i, j, i \neq j, P(|\mathbb{C}_i| \neq |\mathbb{C}_j|) > 0, \qquad (12) $$

where $P(\cdot)$ is the probability.

**Property 2:** Classes could appear in different sessions. We have:

$$ \forall i, j, i \neq j, P(\mathbb{C}_i \cap \mathbb{C}_j \neq \emptyset) > 0, \qquad (13) $$

**Property 3:** The number of samples for each class could be different in one session. For a session $t$, we have:

$$ \forall i, j, i \neq j, P(|\tilde{\mathcal{X}}_t^i| \neq |\mathcal{X}_t^j|) > 0, \qquad (14) $$

where $|\tilde{\mathcal{X}}_t^i|$ is the number of samples for class $i$ in session $t$.

As GCIL in Mi et al. (2020) has no explicit constraint on the number of iterations allowed for learning, Si-Blurry features the more complex and realistic setting with the one-pass requirement. In summary, Si-Blurry can be seen as a realization of GCIL of Mi et al. (2020) with an online learning paradigm.

## A.4 ADDITIONAL EXPERIMENTS

### A.4.1 TRANSFERABILITY

We include the full table for the validation of the transferability of our proposed components on existing prompt-based methods for the effectiveness of each component, as shown in Tab. 8.

### A.4.2 KNOWLEDGE OVERLAP ANALYSIS

To ensure that there is no overlapping of data with ImageNet, Kim et al. (2022) manually removed 389 classes from the original 1000 classes in ImageNet that are similar/identical to the classes in CIFAR-10, CIFAR-100, or Tiny-ImageNet. They pre-trained the network with the remaining subset of 611 classes of ImageNet and released the checkpoint for public research purposes.

While the list of the 389 classes is not publicly available, we reached out to the authors for the list and performed additional ISA to obtain prompt parameters that are initialized without knowledge
<table><caption>Table 9: Validation of ISA for different types of prompts. All methods are equipped with our logit mask to exclude the impact of strong forgetting.</caption><thead><tr><th rowspan="2">Baseline</th><th colspan="2">Prompt Type</th><th colspan="2">ImageNet-R</th></tr><tr><th>G-prompt</th><th>E-prompt</th><th>A<sub>AUC</sub> ↑</th><th>A<sub>Last</sub> ↑</th></tr></thead><tbody><tr><td rowspan="3">DualPrompt</td><td>✓</td><td></td><td>47.84±1.49</td><td>40.82±0.73</td></tr><tr><td></td><td>✓</td><td>48.40±1.20</td><td>42.66±0.34</td></tr><tr><td>✓</td><td>✓</td><td><strong>50.89</strong>±1.03</td><td><strong>43.92</strong>±0.37</td></tr></tbody></table>

<table><caption>Table 10: CL experiments on ImageNet-R with prompts obtained by different strategies. We use our logit masking for all to exclude the impact of strong forgetting.</caption><thead><tr><th>Method</th><th>Logit-Mask</th><th>Naive ISA</th><th>SAM</th><th>Augmentation</th><th>A<sub>AUC</sub></th></tr></thead><tbody><tr><td>Baseline</td><td>✓</td><td></td><td></td><td></td><td>45.59<sup>±1.71</sup></td></tr><tr><td rowspan="3">Ours</td><td>✓</td><td>✓</td><td></td><td></td><td>47.64<sup>±1.24</sup></td></tr><tr><td>✓</td><td>✓</td><td>✓</td><td></td><td>47.71<sup>±1.31</sup></td></tr><tr><td>✓</td><td>✓</td><td>✓</td><td>✓</td><td><strong>49.99</strong><sup>±1.21</sup></td></tr></tbody></table>

overlap. These additional experiments ensure that the improvements of our proposed components are not from a leak of information from the pretraining data.

### A.4.3 SAM WITH PROMPT-TUNING

Although SAM has been shown to be effective in improving the generalizability of CL models, it works most of the time with full-parameter tuning. The effectiveness with parameter-efficient tuning methods, i.e., a frozen pretrained backbone and a few learnable parameters, remains unclear. We first conducted a toy example by applying SAM with a pretrained ViT backbone and prompt parameters in a two-task conventional CL setting. The evaluation on the first task shows the convergence of the model, whereas the evaluation on the second task is a direct verification of the model's generalizability.

As shown in Fig. 3, directly integrating the SAM optimizer into prompt-based tuning cannot work well, or even hinders the model's convergence. We speculate it is because the simplicity and scarcity of the prompts make them incapable of modifying the loss surface of the pretrained model. Moreover, the imposed flatness constraint prevents the loss from converging to the original sharp minima. Based on this analysis, we further conduct experiments by de-freezing more parameters to the training. Specifically, 0.3M refers to tuning the prompts $p_e$ and the output layer $f_c$, while 7M and 14M introduce additional parameters from the last one or two self-attention blocks of $f_r$, respectively. We observe that when more parameters are available for training, the SAM begins to show its power. This experiment confirms that SAM has difficulty when applied to a large frozen pretrained model and a few learnable prompt parameters.

<figure><img src="image_6.png" /><figcaption>Figure 3: Toy example of implementing SAM with prompt tuning. We performed 2-task CL with randomly sampled 50 classes from ImageNet-1K. The first task is optimized with SAM and the second task uses a standard Adam optimizer. 0.3M, 7M, and 14M represent the number of learnable parameters, and additional parameters are from the last layers of the pretrained backbone $f_r$. SAM works better with more parameters becoming learnable.</figcaption></figure>
<table><caption>Table 11: Validation of the effectiveness of ISA with respect to the training iterations.</caption><thead><tr><th rowspan="2">Baseline</th><th rowspan="2">Epoch</th><th colspan="2">ImageNet-R</th></tr><tr><th>A<sub>AUC</sub> ↑</th><th>A<sub>Last</sub> ↑</th></tr></thead><tbody><tr><td rowspan="4">DualPrompt</td><td>1</td><td>48.14±1.26</td><td>42.40±0.57</td></tr><tr><td>2</td><td>49.79±1.11</td><td>43.33±0.52</td></tr><tr><td>3</td><td><strong>49.99</strong>±1.21</td><td><strong>43.48</strong>±0.43</td></tr><tr><td>4</td><td>49.87±1.31</td><td>43.22±0.85</td></tr></tbody></table>

<table><caption>Table 12: Validation of the effectiveness of downstream task adaptation.</caption><thead><tr><th rowspan="2">Baseline</th><th rowspan="2">Adaptation</th><th colspan="2">ImageNet-R</th></tr><tr><th>A<sub>AUC</sub> ↑</th><th>A<sub>Last</sub> ↑</th></tr></thead><tbody><tr><td rowspan="2">DualPrompt</td><td></td><td>49.99±1.21</td><td>43.48±0.43</td></tr><tr><td>✓</td><td><strong>50.16</strong>±1.22</td><td><strong>43.56</strong>±0.42</td></tr></tbody></table>

### A.4.4 ABLATION STUDY OF PROMPT AUGMENTATION

We show in Tab. 10 that direct integration of SAM shows only marginal performance gain, as SAM struggles to work with prompt-tuning. In the end, with our prompt augmentation technique, we observe an additional boost to the performance.

### A.4.5 IMPACT OF PROMPTS (G-PROMPT AND E-PROMPT)

As our baseline method (Wang et al., 2022c) is composed of two types of prompts: G-prompt, which is for capturing general information, and E-prompt, which is for capturing task-specific information. We conduct an ablation study in Tab. 9 on these two types of prompts to validate the effectiveness of each type of prompt.

### A.4.6 IMPACT OF TRAINING EPOCHS

Our ISA involves a joint offline training on the large-scale dataset. The training only lasts for 3 epochs. We show in Tab. 11 that the prompt parameters the best generalizable warm-up at the end of epoch 3. Further training brings no significant improvements.

### A.4.7 IMPACT OF DOWNSTREAM CL ADAPTATION

Our approach directly uses the prompts obtained from ISA to downstream tasks. However, in the cases where there is a significant domain gap between the ISA dataset and the downstream CL dataset, it is preferable to apply a dedicated domain adaptation module to compensate for this mismatch. We found that a simple shift-and-scale method (Lian et al., 2022) can help the model better adapt the downstream tasks without hindering the knowledge in the ISA prompts, as shown in Tab. 12. We leave this adaption as an interesting future direction since it was not the main focus of this work.

### A.4.8 CASE STUDY OF ONE CLASS AT A TIME GCL

We conducted a case study of an extreme case where each new task comprises only one class. Note that the tasks are not strictly disjoint, as the data stream can still contain data from previous tasks due to GCL's blurry task boundary requirements. Typically, any class-incremental scenario can be decomposed to one-class increments, without assuming the number of classes in each new task. This challenging setting demands the model to swiftly adapt and learn new knowledge about a new single class without forgetting previous knowledge that is underrepresented in the current data stream. The results are presented in Tab. 13. Specifically, we conducted 100-task CIFAR-100 and 200-task ImageNet-R experiments with 5 random seeds. We note that our method still outperforms existing methods by a substantial margin.
<table><caption>Table 13: Performance of different methods in GCL with one incremental class at a time.</caption><thead><tr><th rowspan="2">Method</th><th colspan="2">ImageNet-R</th><th colspan="2">CIFAR-100</th></tr><tr><th>A<sub>AUC</sub></th><th>A<sub>Last</sub></th><th>A<sub>AUC</sub></th><th>A<sub>Last</sub></th></tr></thead><tbody><tr><td>EWC</td><td>2.3<sup>±1.1</sup></td><td>3.1<sup>±1.6</sup></td><td>68.1<sup>±0.4</sup></td><td>64.5<sup>±1.4</sup></td></tr><tr><td>DualPrompt</td><td>25.6<sup>±5.6</sup></td><td>31.2<sup>±1.6</sup></td><td>80.4<sup>±0.4</sup></td><td>79.1<sup>±0.2</sup></td></tr><tr><td>MVP</td><td>4.1<sup>±1.4</sup></td><td>5.2<sup>±4.4</sup></td><td>78.7<sup>±0.1</sup></td><td>76.2<sup>±0.2</sup></td></tr><tr><td>Ours</td><td><b>31.1</b><sup>±0.6</sup></td><td><b>42.7</b><sup>±0.7</sup></td><td><b>85.3</b><sup>±0.1</sup></td><td><b>83.7</b><sup>±0.3</sup></td></tr></tbody></table>

### A.4.9 EXPERIMENTS OF PARTIALLY OR COMPLETELY UNAVAILABLE PRETRAINING DATASET.

Although our ISA experiment was based on the same pretrained dataset as the backbone, this is not a strict requirement. The corresponding pretraining data might be partially or completely unavailable regarding large pretrained vision, vision-language, and language models. In these cases, the ISA should be able to learn robust and transferable general knowledge for the prompt parameters to deal with the potential knowledge mismatch with the backbone. We conduct experiments with two cases: (1) the pretrained data is partially available, (2) the pretrained data is completely unavailable. For the former, we use a subset (ImageNet-100, denoted at IN-100) of the pretraining dataset (ImageNet-1k, denoted as IN-1k), and for the latter, we use ImageNet-1k as the ISA dataset whereas the backbone (CLIP-ViT) was trained on a completely unrelated dataset, i.e., YFCC100M (Thomee et al., 2016). Additionally, we highlight that general and diverse ISA datasets are beneficial for the prompt parameters to capture transferable knowledge. To showcase this, we also conducted ISA on a fine-grained dataset, i.e., CUB200 (Wah et al., 2011), where we observed a clear performance drop. The evaluation was performed with 5-task GCL in ImageNet-R with 5 random seeds. The results are in Tab. 14.

### A.4.10 ANALYSIS OF OUR LOGIT MASKING STRATEGY.

In this section, we compare our non-parametric logic masking with that of ER-ACE Caccia et al. (2021). Although they seem similar, they differ in their use cases and objectives. We follow the notations of ER-ACE in this analysis.

First of all, the mask of ER-ACE is replay-dependent, whereas ours is replay-independent. And we are primarily interested in the case where we do not use a replay buffer.

The second difference lies in the objective of the mask. Although both masks deal with the co-existence of current-class data $\mathcal{X}^{cur}$ and old-class data in one mini-batch, the nature of the data is different. In ER-ACE, old-class data $\mathcal{X}^{bf}$ is sampled from a replay buffer, whereas in our case, old-class data $\mathcal{X}^{old}$ is the new data of old classes from the blurry task boundaries. Let $\mathcal{C}$ be the class in data batch $\mathcal{X}$, and $\mathcal{C}_{seen}$ denote all the classes the model has seen. Thus $\mathcal{C}_{bf} \cup \mathcal{C}_{cur} \subseteq \mathcal{C}_{seen}$. For ER-ACE, they applied $1_{\mathcal{C}_{cur}}$ for $\mathcal{X}^{cur}$ and $1_{\mathcal{C}_{seen}}$ for $\mathcal{X}^{bf}$, with $1_{\mathcal{C}}$ a binary vector masking out classes not in $\mathcal{C}$. The idea was to prevent the gradient update of $\mathcal{X}^{cur}$ from interfering with representations of previously seen classes. This is a rather conservative strategy as the idea is to prevent old-class representation from being changed. Instead, since our $\mathcal{X}^{old}$ are new data of old classes, unlike $\mathcal{X}^{bf}$, we can opt for a more proactive strategy to encourage representation update of $\mathcal{C}_{cur}$ and $\mathcal{C}_{old}$ at the same time. Thus our mask to $\mathcal{X}^{cur} \cup \mathcal{X}^{old}$ is $1_{\mathcal{C}_{cur} \cup \mathcal{C}_{old}}$. Similarly, we exclude other classes that have not been seen in the current mini-batch to avoid interference with their representations. The overall optimization objective of ER-ACE is

$$L_{ce}(X^{bf}, Y^{bf}|C_{seen}) + L_{CE}(X^{cur}, Y^{cur}|C_{cur}),$$

whereas ours is

$$L_{ce}(X^{old} \cup X^{cur}, Y^{old} \cup Y^{cur}|C_{old} \cup C_{cur}),$$

where $L_{ce}(\mathcal{X}, \mathcal{Y}|\mathcal{C})$ is the cross-entropy loss with $1_{\mathcal{C}}$ as the binary mask on the data $\mathcal{X}, \mathcal{Y}$.
<table><caption>Table 14: Experiments of partially or completely unavailable pretraining data for ISA.</caption><thead><tr><th rowspan="2">Method</th><th colspan="2">PTM(IN-1k)+ISA(IN-100)</th><th colspan="2">PTM(YFCC100M)+ISA(IN-1k)</th><th colspan="2">PTM(IN-1k)+ISA(CUB200)</th></tr><tr><th>A<sub>AUC</sub></th><th>A<sub>Last</sub></th><th>A<sub>AUC</sub></th><th>A<sub>Last</sub></th><th>A<sub>AUC</sub></th><th>A<sub>Last</sub></th></tr></thead><tbody><tr><td>EWC</td><td>31.5<sub>&plusmn;1.0</sub></td><td>20.7<sub>&plusmn;1.1</sub></td><td>30.6<sub>&plusmn;1.3</sub></td><td>22.2<sub>&plusmn;3.8</sub></td><td>31.5<sub>&plusmn;1.0</sub></td><td>20.7<sub>&plusmn;1.1</sub></td></tr><tr><td>DualPrompt</td><td>40.1<sub>&plusmn;1.2</sub></td><td>29.2<sub>&plusmn;4.6</sub></td><td>37.9<sub>&plusmn;0.9</sub></td><td>30.3<sub>&plusmn;0.2</sub></td><td>40.1<sub>&plusmn;1.2</sub></td><td>29.2<sub>&plusmn;4.6</sub></td></tr><tr><td>MVP</td><td>40.6<sub>&plusmn;1.2</sub></td><td>31.9<sub>&plusmn;3.0</sub></td><td>34.0<sub>&plusmn;1.3</sub></td><td>25.0<sub>&plusmn;4.4</sub></td><td>40.6<sub>&plusmn;1.2</sub></td><td>31.9<sub>&plusmn;3.0</sub></td></tr><tr><td>Ours</td><td><b>49.5</b><sub>&plusmn;1.3</sub></td><td><b>43.0</b><sub>&plusmn;0.6</sub></td><td><b>49.3</b><sub>&plusmn;1.2</sub></td><td><b>42.3</b><sub>&plusmn;0.9</sub></td><td><b>43.4</b><sub>&plusmn;1.9</sub></td><td><b>36.6</b><sub>&plusmn;1.6</sub></td></tr></tbody></table>