REHEARSAL-BASED CONTINUAL LEARNING
Year: 2022

Abstract:
A dataset is a shred of crucial evidence to describe a task. However, each data point in the dataset does not have the same potential, as some of the data points can be more representative or informative than others. This unequal importance among the data points may have a large impact in rehearsal-based continual learning, where we store a subset of the training examples (coreset) to be replayed later to alleviate catastrophic forgetting. In continual learning, the quality of the samples stored in the coreset directly affects the model’s effectiveness and efficiency. The coreset selection problem becomes even more important under realistic settings, such as imbalanced continual learning or noisy data scenarios. To tackle this problem, we propose Online Coreset Selection (OCS), a simple yet effective method that selects the most representative and informative coreset at each iteration and trains them in an online manner. Our proposed method maximizes the model’s adaptation to a current dataset while selecting high-affinity samples to past tasks, which directly inhibits catastrophic forgetting. We validate the effectiveness of our coreset selection mechanism over various standard, imbalanced, and noisy datasets against strong continual learning baselines, demonstrating that it improves task adaptation and prevents catastrophic forgetting in a sample-efficient manner.

heading: 1 INTRODUCTION
text: Humans possess the ability to learn a large number of tasks by accumulating knowledge and skills over time. Building a system resembling human learning abilities is a deep-rooted desire since sustainable learning over a long-term period is essential for general artificial intelligence. In light of this need, continual learning (CL) (Thrun, 1995), or lifelong learning, tackles a learning scenario where a model continuously learns over a sequence of tasks (Kumar & Daume III, 2012; Li & Hoiem, 2016) within a broad research area, such as classification (Kirkpatrick et al., 2017; Chaudhry et al., 2019a), image generation (Zhai et al., 2019), language learning (Li et al., 2019b; Biesialska et al., 2020), clinical application (Lee & Lee, 2020; Lenga et al., 2020), speech recognition (Sadhu & Hermansky, 2020), and federated learning (Yoon et al., 2021). A well-known challenge for continual learning is catastrophic forgetting (McCloskey & Cohen, 1989), where the continual learner loses the fidelity for past tasks after adapting the previously learned knowledge to future tasks.
Recent rehearsal-based continual learning methods adapt the continual model to the previous tasks by maintaining and revisiting a small replay buffer (Titsias et al., 2020; Mirzadeh et al., 2020). However, the majority of these methods store random-sampled instances as a proxy set to mitigate catastrophic forgetting, limiting their practicality to real-world applications (see Figure 1a) when all the training instances are not equally useful, as some of them can be more representative or informative for the current task, and others can lead to performance degeneration for previous tasks. Furthermore, these unequal potentials could be more severe under practical scenarios containing imbalanced, streaming, or noisy instances (see Figure 2). This leads to an essential question in continual learning:
How can we obtain a coreset to promote task adaptation for the current task while minimizing catastrophic forgetting on previously seen tasks?
To address this question, we propose Online Coreset Selection (OCS), a novel method for continual learning that selects representative training instances for the current and previous tasks from arriving
streaming data in an online fashion based on our following three selection strategies: (1) Minibatch similarity selects samples that are representative to the current task Tt. (2) sample diversity encourages minimal redundancy among the samples of current task Tt. (3) Coreset affinity promotes minimum interference between the selected samples and knowledge of the previous tasks Tk, ∀k < t. To this end, OCS minimizes the catastrophic forgetting on the previous tasks by utilizing the obtained coreset for future training, and also encourages the current task adaptation by updating the model parameters on the top-κ selected data instances. The overall concept is illustrated in Figure 1b.
Our method is simple, intuitive, and is generally applicable to any rehearsal-based continual learning method. We evaluate the performance of OCS on various continual learning scenarios and show that it outperforms state-of-the-art rehearsal-based techniques on balanced, imbalanced, and noisy continual learning benchmarks of varying complexity. We also show that OCS is general and exhibits collaborative learning with the existing rehearsal-based methods, leading to increased task adaptation and inhibiting catastrophic forgetting. To summarize, our contributions are threefold:
• We address the problem of coreset selection for realistic and challenging continual learning scenarios, where the data continuum is composed of class-imbalanced or noisy instances that deteriorate the performance of the continual learner during training.
• We propose Online Coreset Selection (OCS), a simple yet effective online coreset selection method to obtain a representative and diverse subset that has a high affinity to the previous tasks from each minibatch during continual learning. Specifically, we present three gradient-based selection criteria to select the coreset for current task adaptation while mitigating catastrophic forgetting.
• We demonstrate that OCS is applicable to any rehearsal-based continual learning method and experimentally validate it on multiple benchmark scenarios, where it largely improves the performance of the base algorithms across various performance metrics.

heading: 2 RELATED WORK
text: Continual learning. In the past few years, there has been significant progress in continual learning to alleviate catastrophic forgetting (McCloskey & Cohen, 1989). The regularization approaches (Kirkpatrick et al., 2017; Lee et al., 2017; Serrà et al., 2018) modify the model parameters with additional regularization constraints to prevent catastrophic forgetting. The architecture approaches (Rusu et al., 2016; Yoon et al., 2018; Xu & Zhu, 2018; Li et al., 2019a; Yoon et al., 2020) utilize network isolation or expansion during continual learning to improve network performance. Another line of research uses rehearsal approaches, which memorize or generate a small fraction of data points for previous tasks and utilizes them to retain the task knowledge (Lopez-Paz & Ranzato, 2017; Chaudhry et al., 2019a; Aljundi et al., 2019b; Borsos et al., 2020). For example, Gradient-based Sample Selection (GSS) (Aljundi et al., 2019b) formulates the selection of the replay buffer as a constraint selection
problem to maximize the variance of gradient direction. ER-MIR (Aljundi et al., 2019a) iteratively constructs the replay buffer using a loss-based criterion, where the model selects the top-κ instances that increase the loss between the current and previous iteration. However, the existing rehearsalbased methods (Rebuffi et al., 2017; Aljundi et al., 2019b;a; Chaudhry et al., 2019a;b) do not select the coreset before the current task adaptation and update the model on all the arriving data streams, which makes them susceptible to real-world applications that include noisy and imbalanced data distributions. In contrast, OCS selects the instances before updating the model using our proposed selection criteria, which makes it robust to past and current task training across various CL scenarios.
Coreset selection. There exist various directions to obtain a coreset from a large dataset. Importance sampling (Johnson & Guestrin, 2018; Katharopoulos & Fleuret, 2018; Sinha et al., 2020) strengthens the loss/gradients of important samples based on influence functions. Kool et al. (2019) connect stochastic Gumbel-top-k trick and beam search to hierarchically sample sequences without replacement. Rebuffi et al. (2017) propose a herding based strategy for coreset selection. Nguyen et al. (2018) formulate the coreset summarization in continual learning using online variational inference (Sato, 2001; Broderick et al., 2013). Aljundi et al. (2019b) select the replay buffer to maximize the variance in the gradient-space. Contrary to these methods, OCS considers the diversity, task informativity and relevancy to the past tasks. Recently, Borsos et al. (2020) propose a bilevel optimization framework with cardinality constraints for coreset selection. However, their method is extremely limited in practice and inapplicable in large-scale settings due to the excessive computational cost incurred during training. In contrast, our method is simple, and scalable since it can construct the coreset in the online streaming data continuum without additional optimization constraints.

heading: 3 REHEARSAL-BASED CONTINUAL LEARNING
text: We consider learning a model over a sequence of tasks {T1, . . . , TT } = T , where each task is composed of independently and identically distributed datapoints and their labels, such that task Tt includes Dt = {xt,n, yt,n}Ntn=1 ∼ Xt × Yt, where Nt is the total number of data instances, and Xt × Yt is an unknown data generating distribution. We assume that an arbitrary set of labels for task Tt, yt = {yt,n}Ntn=1 has unique classes, yt ∩ yk = ∅, ∀t 6= k. In a standard continual learning scenario, the model learns a corresponding task at each step and t-th task is accessible at step t only. Let neural network fΘ : X1:T → Y1:T be parameterized by a set of weights Θ = {θl}Ll=1, where L is the number of layers in the neural network. We define the training objective at step t as follows:
minimize Θ Nt∑ n=1 `(fΘ(xt,n), yt,n), (1)
where `(·) is any standard loss function (e.g., cross-entropy loss). The naive CL design where a simple sequential training on multiple tasks without any means for tackling catastrophic forgetting cannot retain the knowledge of previous tasks and thus results in catastrophic forgetting. To tackle this problem, rehearsal-based methods (Nguyen et al., 2018; Chaudhry et al., 2019a; Titsias et al., 2020) update the model on a randomly sampled replay buffer Ck constructed from the previously observed tasks, where Ck = {xk,j , yk,j}Jkj=1 ∼ Dk, ∀k < t and Jk Nk. Consequently, the quality of selected instances is essential for rehearsal-based continual learning. For example, some data instances can be more informative and representative than others to describe a task and improve model performance. In contrast, some data instances can degrade the model’s memorization of past tasks’ knowledge. Therefore, obtaining the most beneficial examples for the current task is crucial for the success of rehearsal-based CL methods.
) Classwise acc. of T2
Average Fgt. of T1
To validate our hypothesis, we design a learning scenario with a sequence of two tasks, MNIST (T1) → CIFAR-10 (T2) using ResNet-18. After the standard single epoch training on T1, we update the model weights through a single backpropagation step using a randomly selected data point from T2, and measure test accuracy of its corresponding class c and forgetting of the entire dataset of a past task T1. Results for individual impacts on 1000 data points from T2 are
described in Section 3. The influence of each data point from T2 has a large disparity not only on the corresponding class accuracy but also on past task’s forgetting that results in a very high standard deviation. We emphasize that each data point has a different potential impact in terms of forgetting past tasks. Few data points are much more robust to catastrophic forgetting than others, and this can be severe when the influences are accumulated during training.
Based on this motivation, our objective is to select the data instances that can promote current task adaptation while minimizing catastrophic forgetting on the previous tasks. We propose a selection criterion that selects the subset that maximizes the gradient similarity between the representative instances and the current task dataset. More formally:
u∗ = maximize u∈Nκ S
( 1
Nt ∇fΘ (Dt) ,
1
κ ∑ n∈u ∇fΘ (xt,n, yt,n) ) , where u = {n : n ∈ N<Nt}, (2)
where S is any arbitrary similarity function and u∗ is an index set that selects top-κ informative samples without replacement. However, obtaining a representative subset from the entire dataset is computationally expensive and intractable for online continual learning; therefore, we consider a minibatch as an approximation of the dataset and select few representative data instances at each minibatch iteration. We empirically validate that our approximation generally holds across various datasets, network structures, and minibatch sizes in Appendix B and Figure B.9. Consequently, the model iteratively updates the parameters to find the optimal local minima of the loss using informative data points, which obtain similar gradient directions with the averaged gradients of the dataset. In the next section, we propose OCS which consists of a simple similarity criterion to achieve this objective. However, similarity criterion is not sufficient to select the representative coreset for online continual learning; hence, we propose diversity and coreset affinity criteria to mitigate catastrophic forgetting.

heading: 4 ONLINE CORESET SELECTION
text: In this section, we introduce our selection strategies and propose Online Coreset Selection (OCS) to strengthen current task adaptation and mitigate catastrophic forgetting. Thus far, the rehearsal-based continual learning methods (Rebuffi et al., 2017; Aljundi et al., 2019b;a; Chaudhry et al., 2019a;b) populate the replay buffer to preserve the knowledge on the previous tasks. However, we argue that some instances may be non-informative and inappropriate to construct the replay buffer under realistic setups (such as video streaming or imbalanced continual learning scenarios), leading to the degradation of the model’s performance. Moreover, it is critical to select the valuable samples for current task training since the model can easily overfit to the biased and noisy data stream, which negatively affects the model generalization. To satisfy these desiderata, we propose minibatch similarity (S) and sample diversity (V) criteria based on our aforementioned assumption to adaptively select the useful instances without the influence of outliers. Definition 1 (Minibatch similarity). Let bt,n = {xt,n, yt,n} ∈ Bt denote n-th pair of data point with gradient∇fΘ (bt,n) and its corresponding label at task Tt. Let ∇̄fΘ(Bt) denote the averaged gradient vector of Bt. The minibatch similarity S (bt,n | Bt) between bt,n and Bt is given by
S (bt,n | Bt) = ∇fΘ (bt,n) ∇̄fΘ (Bt)>
‖∇fΘ (bt,n)‖ · ‖∇̄fΘ (Bt)‖ . (3)
Definition 2 (Sample diversity). Let bt,n = {xt,n, yt,n} ∈ Bt denote n-th pair of a data point with gradient ∇fΘ (bt,n) and its corresponding label at task Tt. The sample diversity V ( bt,n | Bt\bt,n ) between bt,n and all other instances in Bt (Bt\bt,n) is given by
V ( bt,n | Bt\bt,n ) = −1
Nt − 1 Nt−1∑ p 6=n ∇fΘ (bt,n)∇fΘ (bt,p)> ‖∇fΘ (bt,n)‖ · ‖∇fΘ (bt,p)‖ . (4)
In particular, minibatch similarity considers a minibatch as an approximation of the current task dataset and compares the minibatch-level similarity between the gradient vector of a data point b and its minibatch B. It measures how well a given data instance describes the current task at each training step. Note that selecting examples with the largest minibatch similarity is reasonable when the variance of task instances is low; otherwise, it increases the redundancy among coreset items. In
contrast, we formulate the sample diversity of each data point b ∈ B as an averaged dissimilarity (i.e., an average of negative similarities) between a data point itself and other samples in the same minibatch B, and not as an average similarity. Thus, the measure of sample diversity in Equation (4) is negative and the range is [−1, 0].

heading: 4.1 ONLINE CORESET SELECTION FOR CURRENT TASK ADAPTATION
text: The model receives a data continuum during training, including noisy or redundant data instances in real-world scenarios. Consequently, the arriving data instances can interrupt and hurt the performance of the model. To tackle this problem, we consider an amalgamation of minibatch similarity and sample diversity to select the most helpful instances for current task training. More formally, our online coreset selection for the current task adaptation can be defined as follows:
u∗ = {
argmax n
(κ) S (bt,n | Bt) + V ( bt,n | Bt\bt,n ) ∣∣∣ n ∈ {0, . . . , |Bt| − 1}}. (5) We emphasize that we can obtain the top-κ valuable instances for the current task by computing Equation 5 in an online manner. Once the representative coreset is selected, we optimize the following objective for the current task training at each iteration:
minimize Θ
1
κ κ∑ (x̂,ŷ)∈B̂t ` (fΘ (x̂) , ŷ) , where B̂t = Bt[u∗]. (6)
We consider a selected coreset at each iteration as a candidate for the replay buffer. After the completion of each task training, we choose a coreset Ct among the collected candidates, or we may also iteratively update Ct to maintain the bounded buffer size for continual learning.

heading: 4.2 ONLINE CORESET SELECTION FOR CONTINUAL LEARNING
text: We now formulate OCS for online continual learning, where our objective is to obtain the coreset to retain the knowledge of the previous tasks using our proposed similarity and diversity selection criteria. However, continual learning is more challenging as the model suffers from catastrophic forgetting and coreset size is smaller than the size of the arriving data streams. Thus, inspired by our observation in Section 3, we aim to train the continual learner on the selected instances that are representative of the current task and prevent the performance degeneration of previous tasks.
We achieve our goal by introducing our Coreset affinity criterion A to Equation 5. In particular, A computes the gradient vector similarity between a training sample and the coreset for previous tasks (C). More formally, A can be defined as follows: Definition 3 (Coreset affinity). Let bt,n = {xt,n, yt,n} ∈ Bt denote the n-th pair of a data point with gradient ∇fΘ (bt,n) and its corresponding label at task Tt. Further let ∇̄fΘ(BC) be the averaged gradient vector of BC , which is randomly sampled from the coreset C. The coreset affinity A (bt,n | BC ∼ C) between bt,n and BC is given by
A (bt,n | BC ∼ C) = ∇fΘ (bt,n) ∇̄fΘ (BC)>
‖∇fΘ (bt,n) ‖ · ‖∇̄fΘ (BC) ‖ . (7)
While the past task is inaccessible after the completion of its training, our selectively populated replay buffer can be effectively used to describe the knowledge of the previous tasks. The key idea is to select the examples that minimize the angle between the gradient vector of the coreset containing previous task examples and the current task examples. Instead of randomly replacing the candidates in the coreset (Lopez-Paz & Ranzato, 2017; Chaudhry et al., 2019a; Aljundi et al., 2019b; Borsos et al., 2020), A promotes the selection of examples that do not degenerate the model performance on previous tasks. To this end, we select the most beneficial training instances which are representative and diverse for current task adaptation while maintaining the knowledge of past tasks. In summary, our OCS for training task Tt during CL can be formulated as:
u∗ = {
argmax n
(κ) S (bt,n | Bt) + V ( bt,n | Bt\bt,n ) + τA (bt,n | BC) ∣∣∣ n ∈ {0, . . . , |Bt| − 1}}. (8)
τ is a hyperparameter that controls the degree of model plasticity and stability. Note that, during the first task training, we do not have the interference from previous tasks and we select the top-κ instances that maximize the minibatch similarity and sample diversity. Given the obtained coreset B̂t = Bt[u∗], our optimization objective reflecting the coreset C, is as follows:
minimize Θ
1
κ κ∑ (x̂,ŷ)∈B̂t `(fΘ(x̂), ŷ) + λ |BC | |BC|∑ (x,y)∈BC `(fΘ(x), y), (9)
where BC is a randomly sampled minibatch from the coreset C and λ is a hyperparameter to balance the adaptation between the current task and past task coreset. Overall training procedure for Online Coreset Selection (OCS) is described in Algorithm 1. To the best of our knowledge, this is the first work that utilizes selective online training for the current task training and incorporates the relationship between the selected coreset and the current task instances to promote current task adaptation while minimizing the interference with previous tasks.
Algorithm 1 Online Coreset Selection (OCS) input Dataset {Dt}Tt=1, neural network fΘ, hyperparameters λ, τ , replay buffer C ← {}, buffer size bound J. 1: for task Tt = T1, . . . , TT do 2: Ct ← {} . Initialize coreset for current task 3: for batch Bt ∼ Dt do 4: BC ← SAMPLE(C) . Randomly sample a batch from the replay buffer 5: u∗ = argmax(κ)
n∈{0,...,|Bt|−1} S (bt,n | Bt) + V
( bt,n | Bt\bt,n ) + τA (bt,n | BC) . Coreset selection
6: Θ← Θ− η∇fΘ(Bt[u∗] ∪ BC) with Equation (9) . Model update with selected instances 7: Ct ← Ct ∪ B̂t 8: end for 9: C ← C ∪ SELECT(Ct, size = J/T ) with Equation (8) . Memorize coreset in the replay buffer
10: end for

heading: 5 EXPERIMENTS

heading: 5.1 EXPERIMENTAL SETUP
text: Datasets. We validate OCS on domain-incremental CL for Balanced and Imbalanced Rotated MNIST using a single-head two-layer MLP with 256 ReLU units in each layer, task-incremental CL for Split CIFAR-100 and Multiple Datasets (a sequence of five datasets) with a multi-head structured ResNet18 following prior works (Chaudhry et al., 2019a; Mirzadeh et al., 2020; 2021). Additionally, we evaluate on class-incremental CL for Balanced and Imbalanced Split CIFAR-100 with a single-head structured ResNet-18 in Table B.9. We perform five independent runs for all the experiments and provide further details on the experimental settings and datasets in Appendix A.
Baselines. We compare OCS with regularization-based CL methods: EWC (Kirkpatrick et al., 2017) and Stable SGD (Mirzadeh et al., 2020), rehearsal-based CL methods using random replay buffer: A-GEM (Chaudhry et al., 2019a) and ER-Reservior (Chaudhry et al., 2019b), coreset-based methods using CL algorithms: Uniform Sampling, k-means Features (Nguyen et al., 2018) and k-means Embeddings (Sener & Savarese, 2018), and coreset-based CL methods: iCaRL (Rebuffi et al., 2017), Grad Matching (Campbell & Broderick, 2019), GSS (Aljundi et al., 2019b), ER-MIR (Aljundi et al., 2019a), and Bilevel Optim (Borsos et al., 2020). We limit the buffer size for the rehearsal-based methods to one example per class per task. Additionally, we compare with Finetune, a naive CL method learnt on a sequence of tasks, and Multitask, where the model is trained on the complete data.
Metrics. We evaluate all the methods on two metrics following the CL literature (Chaudhry et al., 2019a; Mirzadeh et al., 2021). 1. Average Accuracy (At) is the averaged test accuracy of all tasks after the completion of CL at
task Tt. That is, At = 1t ∑t i=1 at,i, where at,i is the test accuracy of task Ti after learning task Tt. 2. Average Forgetting (F ) is the averaged disparity between the peak and final task accuracy after the completion of continual learning. That is, F = 1T−1 ∑T−1 i=1 maxt∈{1,...,T−1}(at,i − aT,i).

heading: 5.2 QUANTITATIVE ANALYSIS FOR CONTINUAL LEARNING
text: Balanced continual learning. Table 1 shows the results on the balanced CL benchmarks. First, observe that compared to the random replay based methods (A-GEM and ER-Reservoir), OCS shows 19% relative gain in average accuracy, 62% and 79% reduction in forgetting over the strongest baseline on Rotated MNIST and Split CIFAR-100, respectively. Second, OCS reduces the forgetting by 38% and 57% on Rotated MNIST and Multiple Datasets respectively over the coreset-based techniques, demonstrating that it selects valuable samples from the previous tasks. We further illustrate this in Figure 4, where OCS consistently exhibits superior average accuracy and first task accuracy. Third, we show the scalability of OCS with larger episodic memory in Figure 5. Interestingly, iCaRL shows lower performance than uniform sampling with a larger memory buffer for Rotated MNIST, while OCS outperforms across all memory sizes on both datasets. Furthermore, we note that ER-MIR, GSS, and Bilevel Optim require 0.9×, 3.9×, and 4.2× training time than OCS (see Table 5) on TITAN Xp, showing a clear advantage of OCS for the online streaming scenarios.
Imbalanced continual learning. To demonstrate the effectiveness of OCS in challenging scenarios, we evaluate on imbalanced CL in Table 1. We emphasize that compared to balanced CL, OCS shows significant gains over all the baselines for Rotated MNIST and Multiple Datasets. Notably, it leads to a relative improvement of ∼ 7% and ∼ 9% on the accuracy, ∼ 11% and 40% reduction on the forgetting compared to the best baseline for each dataset, respectively. The poor performance of the baselines in this setup is largely attributed to their lack of current task coreset selection, which results in a biased estimate degenerating model performance (see Figure 8). Moreover, we observe that OCS outperforms Multitask for complex imbalanced datasets, perhaps due to the bias from the
dominant classes and the absence of selection criteria in Multitask. Similar to balanced CL, OCS leads to superior performance for larger episodic memory in imbalanced CL (see Figure 5).
Noisy continual learning. Next, we evaluate on noisy Rotated MNIST dataset, which is constructed by perturbing a proportion of instances of the original dataset with Gaussian noise N (0, 1). Table 2 shows that the addition of noise significantly degrades the performance on all the baselines. In contrast, OCS leads to a relative gain of 43% on accuracy, 20% and 35% reduction in forgetting on 40% and 60% proportion of noisy data. Note that the performance gap is more significant for the higher distribution of noisy examples, supporting our claim that the similarity and diversity across the training examples in the coreset play an essential role for the task adaptation in continual learning.

heading: 5.3 ABLATION STUDIES
text: Effect of gradients. In Table 3, we empirically justify the utilization of gradients (Grad-OCS) compared to the raw inputs (Input-OCS) and feature-representations (Feat-OCS). We observe that Grad-OCS significantly outperforms Input-OCS and Feat-OCS on balanced and imbalanced CL, demonstrating that the gradients are a better metric to approximate the dataset.
Effect of individual components. We further dissect Minibatch similarity (S), Sample diversity (V) and Coreset affinity (A) in Table 4. Note that selection using S shows reasonable performance as the model can select valuable data points; however, it may select redundant samples, which degrades its performance. In addition, V in isolation is insufficient since it can select non-redundant and non-representative instances. The combination of S and V improves the average accuracy, but it shows a marginal improvement on the forgetting. To further gain insight into S and V , we interpolate between S and V in Figure 6, where we can observe that an optimal balance of S and V (indicated by the arrows) can further improve the performance of our proposed selection strategy.
Furthermore, A improves the forgetting since the selected candidates have similar gradient direction to the coreset of the previous tasks maximizing their performance. However, A does not consider the current task distribution explicitly and depends on the quality of the memorized replay buffer. We observe that using A in isolation obtains reasonably high performance on simple digit-based domain-incremental CL problems (e.g., Rotated MNIST) due to its inherent high resemblance among same class instances. Consequently, suppressing catastrophic forgetting by selective training based on A shows a relatively high impact rather than selective training based on distinguishing more informative or diverse samples. In contrast, A in isolation for selection is insufficient for complicated and realistic CL problems such as imbalanced CL and multiple datasets, and all the three components (S, V , and A) contribute to the performance of OCS. For Multiple Datasets, selection using only A (58.1%) obtained worse performance in comparison to S + V +A (61.5%) and S + V (58.6%). Further, selection using S +A (59.4± 2.0%) and V +A (56.4%± 1.3) also obtained 2.1%p and 5.1%p lower average accuracy than full OCS, respectively.
Method Noisy Rot-MNIST (60%) Multiple Datasets
S V A Accuracy Forgetting Accuracy Forgetting X − − 64.0 (± 1.18) 0.33 (± 0.01) 56.3 (± 0.97) 0.10 (± 0.02) − X − 40.1 (± 1.32) 0.06 (± 0.02) 49.8 (± 1.30) 0.12 (± 0.01) − − X 79.6 (± 0.87) 0.10 (± 0.01) 58.1 (± 0.96) 0.05 (± 0.01) X X − 66.8 (± 1.39) 0.30 (± 0.01) 58.6 (± 1.91) 0.09 (± 0.02) X X X 80.3 (± 0.75) 0.10 (± 0.01) 61.5 (± 1.34) 0.03 (± 0.01)
Figure 6: Interpolation between S and V .
Table 5: Running time on Balanced Rot-MNIST.
Method Training Time
ER-MIR 0.38 h (×0.87) GSS 1.71 h (×3.89) Bilevel 1.83 h (×4.17) OCS (Ours) 0.44 h (×1.00)
Figure 8: T-SNE visualization of the selected samples on Imbalanced Rotated MNIST.

heading: 5.4 FURTHER ANALYSIS
text: Coreset visualization. Next, we visualize the coreset selected by different methods for imbalanced and noisy rotated MNIST in Figure 7. We observe that uniform sampling selects highly biased samples representing the dominant classes for imbalanced CL and noisy instances for noisy CL. In contrast, iCaRL selects the representative samples per class for imbalanced CL; however, it selects noisy instances during noisy CL. In comparison, OCS selects the beneficial examples for each class during imbalanced CL and discards uninformative noisy instances in the noisy CL training regime.
T-SNE visualization. We further compare the T-SNE visualization of the selected coreset by Bilevel Optim, GSS and OCS in Figure 8. We observe that the samples chosen by OCS are diverse, whereas Bilevel Optim and GSS select the majority of the samples from the dominant classes. We attribute the representative clusters and diversity in the samples selected by OCS to our proposed S (selects the valuable samples) and V (minimizes the redundancy among the selected samples) criteria. Collaborative learning with MC-SGD. We remark that OCS can be applied to any rehearsal-based CL method with a replay buffer during training. We empirically demonstrate the effect of collaborative learning with other CL methods in Table 6. In particular, we use Mode Connectivity SGD (MCSGD) (Mirzadeh et al., 2021), which encourages the mode connectivity between model parameters for continual and multitask loss and approximates the multitask loss through randomly selected replay buffer. Note that OCS leads to a relative gain of 1.2% to 3.4% on accuracy over MC-SGD on Permuted MNIST, Rotated MNIST, and Split CIFAR-100 datasets. Furthermore, MC-SGD + OCS shows considerably lower forgetting, illustrating that OCS prevents the loss of prior task knowledge.

heading: 6 CONCLUSION
text: We propose Online Coreset Selection (OCS), a novel approach for coreset selection during online continual learning. Our approach is modelled as a gradient-based selection strategy that selects representative and diverse instances, which are useful for preserving the knowledge of the previous tasks at each iteration. This paper takes the first step to utilize the coreset for improving the current task adaptation, while mitigating the catastrophic forgetting on previous tasks. Our experimental evaluation on the standard balanced continual learning datasets against state-of-the-art rehearsal-based techniques demonstrates the efficiency of our approach. We also show promising results on various realistic and challenging imbalanced and noisy continual learning datasets. We further show the natural extension of our selection strategy to existing rehearsal-based continual learning using a random-replay buffer. Our future work will focus on improving the selection strategies and exploring ways to utilize unlabelled data stream during training.

heading: A EXPERIMENTAL DETAILS
text: Datasets. We evaluate the performance of OCS on the following benchmarks:
1. Balanced and Imbalanced Rotated MNIST. These datasets are MNIST handwritten digits dataset (LeCun et al., 1998) variants containing 20 tasks, where each task applies a fixed random image rotation (between 0 and 180 degrees) to the original dataset. The imbalanced setting contains a different number of training examples for each class in a task, where we randomly select 8 classes over 10 at each task and each class contains 10% of training instances for training. The total amount of training instances at each class can be [5900, 670, 590, 610, 580, 5400, 590, 620, 580, 590], where bold fonts denote the reduced number of instances for selected classes. The size of the replay buffer is 200 for all the rehearsal-based methods.
2. Balanced and Imbalanced Split CIFAR-100. These datasets are CIFAR-100 dataset (Krizhevsky, 2012) variants, where each task consists of five random classes out of the 100 classes. We use the Long-Tailed CIFAR-100 (Cui et al., 2019) for Imbalanced Split CIFAR-100 consisting of n = niµi samples for each class, where i is the class index, ni is the original number of training images, and µ = 0.05. It contains 20 tasks of five random classes out of the 100 classes. The size of the replay buffer is 100 (one example per class) for all the rehearsal-based methods.
3. Balanced and Imbalanced Multiple Datasets. This dataset contains a sequence of five benchmark datasets: MNIST (LeCun et al., 1998), fashion-MNIST (Xiao et al., 2017), NotMNIST (Bulatov, 2011), Traffic Sign (Stallkamp et al., 2011), and SVHN (Netzer et al., 2011), where each task contains randomly selected 1000 training instances from each dataset. This dataset contains five tasks and 83 classes. We use the same strategy as Long-Tailed CIFAR-100 to construct the imbalanced Multiple Datasets with µ = 0.1. The size of the replay buffer is 83 (one example per class) for all rehearsal-based methods.
Network Architectures. We use a MLP with 256 ReLU units in each layer for Rotated MNIST and a ResNet-18 (He et al., 2016) for Split CIFAR-100 datasets following Mirzadeh et al. (2020). For Rotated MNIST experiments, we use a single-head architecture, where the final classifier layer is shared across all the tasks, and the task identity is not provided during inference. In contrast, we use the multi-head structured ResNet-18 for CIFAR-100 and Multiple Datasets experiments, where the task identifiers are provided, and each task consists of its individual linear classifier.
Implementations. We follow the design of Mirzadeh et al. (2021) for evaluating all the methods. We utilize their implementation for Finetune, EWC (Kirkpatrick et al., 2017), Stable SGD (Mirzadeh et al., 2020), A-GEM (Chaudhry et al., 2019a), ER-Reservoir (Chaudhry et al., 2019b) and MCSGD (Mirzadeh et al., 2021). We adapt the implementation released by Borsos et al. (2020) for Uniform Sampling, iCaRL (Rebuffi et al., 2017), k-means Features (Nguyen et al., 2018), k-means Embedding (Sener & Savarese, 2018), Grad Matching (Campbell & Broderick, 2019), and Bilevel Optim (Borsos et al., 2020). Further, we implement GSS (Aljundi et al., 2019b) and ER-MIR (Aljundi et al., 2019a) following the official code relased by the authors. Following iCaRL (Rebuffi et al., 2017), we store a balanced coreset Ct (equal number of examples per class) among the collected coreset candidates.
Memory Capacity. Existing rehearsal-based continual learning methods (Chaudhry et al., 2019a;b; Aljundi et al., 2019a; Mirzadeh et al., 2020; 2021) adopt two typical strategies to store data points in the replay buffer at the end of training each task: (1) memorizing a fixed number of data points per task (|Ci| = J/T ), where an index of the task in a task sequence i ∈ {1, ..., T}, the total number of task T , and memory capacity J , (2) fully utilizing the memory capacity and randomly discard stored samples of each task when new data points arrive from next tasks (|Ci| = J/t), where the current task t and an index of the observed task i ∈ {1, ..., t}. While both strategies are available, we adopt the latter strategy for all baselines and OCS. The details of this are omitted in Algorithm 1 for simplicity.
Hyperparameter configurations. Table A.7 shows the initial learning rate, learning rate decay, and batch size for each dataset that are shared among all the methods. Further, we report the best results obtained for λ ∈ {0.01, 0.05, 0.1, 1, 10, 50, 100} for all the experiments. For OCS, we use batch size as 100 for Rotated MNIST and 20 for Split CIFAR-100 and Multiple Dataset. The running time reported in Table 5 was measured on a
single NVIDIA TITAN Xp. Due to the significant computational cost incurred by the training of Bilevel Optim (Borsos et al., 2020) for online continual learning, we restrict the bilevel optimization procedure to construct the replay buffer at the end of each task training.
Choice of hyperparameters for OCS. Note that we use the same value of κ = 10, τ = 1k for all experiments and analyses, including balanced, imbalanced, and noisy CL scenarios for all datasets, which shows that a simple selection of the hyperparameters is enough to show impressive performance. We expect careful tuning would further enhance the performance of OCS.

heading: B ADDITIONAL EXPERIMENTS
text: Current task adaptation with the baselines. One of our main contributions is the selective online training that selects the important samples for current task training. Therefore, we investigate the application of the other baselines for current task training in Table B.8. It is worth noting that all the rehearsal-based baselines that utilize their coreset selection criteria for current task adaptation decrease the performance (1.0 - 9.8%p ↓), except Grad Matching (0.5%p ↑) on Balanced Rotated MNIST. Moreover, for Imbalanced Rotated MNIST, Uniform Sampling, k-means Features, and k-means Embedding increase the performance 1.9%p, 13.3%p, and 4.0%p compared to Table 1 respectively. In contrast, iCaRL and Grad Matching criteria decrease the performance by 1.7%p and 3.2%p on Imbalanced Rotated MNIST, respectively. On the contrary, OCS improves the performance for both the balanced and imbalanced scenarios. In light of this, we can conclude that efficient coreset selection plays a crucial role in imbalanced and noisy continual learning; therefore, the future rehearsal-based continual learning methods should evaluate their method on realistic settings rather than the standard balanced continual learning benchmarks.
Class-incremental continual learning. We also evaluate OCS for balanced and imbalanced classincremental CL (CIL) setups in Table B.9. We Split CIFAR-100 dataset to five tasks with memory size of 1K for all methods. While the problem is extremely hard to solve, we want to emphasize that OCS outperforms the strongest baseline by 10.61% and 63.6% on accuracy and forgetting respectively
for balanced CIFAR-100 dataset, 24.05% and 30% on accuracy and forgetting respectively for imbalanced CIFAR-100 dataset in the CIL setting. Note that we report the results for all the baselines using hyperparameter configuration of the main experiments.
Uniform training with OCS coreset. We further analyze the effect of online coreset selection for current task training in Table B.10a. In particular, we compare uniform sampling for the current task while utilizing the coreset constructed by OCS for the previous tasks (Uniform + OCS) with our original selection scheme utilizing OCS for current and previous tasks. First, observe that Uniform + OCS shows 2.6% and 9.2% relative decrease in performance on Rotated MNIST and Multiple datasets respectively compared to our original OCS selection strategy. Second, note that Uniform + OCS significantly deteriorates the catastrophic forgetting for all datasets since uniformly sampled examples do not preserve the previous tasks knowledge. Moreover, imbalanced continual learning shows a similar trend in Table B.10b, where Uniform + OCS leads to a drop in both the accuracy and forgetting across all benchmarks. This further strengthens our claim that OCS is essential for the previous tasks and plays a vital role in encouraging current-task adaptation.
Distance between the whole dataset and its minibatch. To verify our conjecture that a minibatch can approximation of the whole dataset and select few representative data instances at each minibatch iteration, we empirically validate that the whole dataset and its minibatch have significant semantic relevancy. More formally, for a given subset Bt, dataset Dt, and > 0, we suppose that the neural network satisfies following equation,
S∗ ( 1
Nt ∇fΘ(Dt),
1
|Bt| ∇fΘ(Bt)
) ≤ , (10)
where S∗ is an arbitrary distance function. To this end, we conduct a simple experiment using two different datasets (MNIST and CIFAR-10) and network architectures (MLP and ResNet-18) to show that it generally holds on various datasets and network architectures. We use a 2-layered MLP for MNIST and ResNet-18 for CIFAR-10 following our main experiments. At each iteration of training,we measure the `2 distance (S∗(·) = `2(·)) and cosine similarity (S∗(·) = 1/(sim(·))) between the averaged gradient of the training minibatch and averaged gradient of the entire training dataset. To show that the distance is sufficiently small, we also measure the gradient `2 distance between the entire dataset and the irrelevant dataset. Note that we recalculated the gradient for the whole dataset at each iteration for all results to correctly measure the distance at each step. As shown in Figure B.9, the gradient of larger minibatch shows better approximation to the gradient of the entire dataset for `2 distance and cosine similarity. Further, note that that even the gradients of an arbitrary subset with a small-sized minibatch is significantly similar to the whole dataset with a small , and it is more evident when compared to the irrelevant gradients from a different dataset, PMNIST (Permuted MNIST) (Goodfellow et al., 2013).

Review summaries:
This paper proposes an Online Coreset Selection method to select the most representative and informative coreset at each iteration and trains them. The proposed method maximizes the model’s adaptation to a target dataset while selecting high-affinity samples to past tasks, which directly inhibits catastrophic forgetting. Experiments on the benchmark datasets show competitive results compared with baselines.

The author propose a novel approach for online coreset selection, i.e exemplars used in the rehearsal process of past tasks in a continual learning framework. The proposed method is based on the observation that not all the samples in a dataset are equally valuable, but their quality affects model's effectiveness and efficiency. The method selects the most representative and informative samples at each iteration and trains them in an online manner. The approach has been conviently compared with state-of-the art methods and demonstrated its superiority.