## Continual Learning via Online Leverage Score Sampling

Dan Teng Neuri dan@neuri.ai

Sakyasingha Dasgupta Neuri sakya.dasgupta@gmail.com

## Abstract

In order to mimic the human ability of continual acquisition and transfer of knowledge across various tasks, a learning system needs the capability for continual learning, effectively utilizing the previously acquired skills. As such, the key challenge is to transfer and generalize the knowledge learned from one task to other tasks, avoiding forgetting and interference of previous knowledge and improving the overall performance. In this paper, within the continual learning paradigm, we introduce a method that effectively forgets the less useful data samples continuously and allows beneficial information to be kept for training of the subsequent tasks, in an online manner. The method uses statistical leverage score information to measure the importance of the data samples in every task and adopts frequent directions approach to enable a continual or life-long learning property. This effectively maintains a constant training size across all tasks. We first provide mathematical intuition for the method and then demonstrate its effectiveness in avoiding catastrophic forgetting and computational efficiency on continual learning of classification tasks when compared with the existing state-of-the-art techniques.

## 1 Introduction

It is a typical practice to design and optimize machine learning (ML) models to solve a single task. On the other hand, humans, instead of learning over isolated complex tasks, are capable of generalizing and transferring knowledge and skills learned from one task to another. This ability to remember, learn and transfer information across tasks is referred to as continual learning [36, 31, 12, 27]. The major challenge for creating ML models with continual learning ability is that they are prone to catastrophic forgetting [22, 23, 11, 7]. ML models tend to forget the knowledge learned from previous tasks when re-trained on new observations corresponding to a different (but related) task. Specifically when a deep neural network (DNN) is fed with a sequence of tasks, the ability to solve the first task will decline significantly after training on the following tasks. The typical structure of DNNs by design does not possess the capability of preserving previously learned knowledge without interference between tasks or catastrophic forgetting. In order to overcome catastrophic forgetting, a learning system is required to continuously acquire knowledge from the newly fed data as well as to prevent the training of the new data samples from destroying the existing knowledge.

In this paper, we propose a novel approach to continual learning with DNNs that addresses the catastrophic forgetting issue, namely a technique called online leverage score sampling (OLSS) . In OLSS, we progressively compress the input information learned thus far, along with the input from current task and form more efficiently condensed data samples. The compression technique is based on the statistical leverage scores measure, and it uses the concept of frequent directions in order to connect the series of compression steps for a sequence of tasks.

When thinking about continual learning, a major source of inspiration is the ability of biological brains to learn without destructive interference between older memories and generalize knowledge

Preprint. Under review.

across multiple tasks. In this regard, the typical approach is enabling some form of episodic-memory in the network and consolidation [22] via replay of older training data. However, this is an expensive process and does not scale well for learning large number of tasks. As an alternative, taking inspiration from the neuro-computational models of complex synapses [1], recent work has focused on assigning some form of importance to parameters in a DNN and perform task-specific synaptic consolidation [14, 39]. Here, we take a very different view of continual learning and find inspiration in the brains ability for dimensionality reduction [26] to extract meaningful information from its environment and drive behavior. As such, we enable such progressive dimensionality reduction (in terms of number of samples) of previous task data combined with new task data in order to only preserve a good summary information (discarding the less relevant information or effective forgetting) before further learning. Repeating this process in an online manner we enable continual learning for a large sequence of tasks. Much like our brains, a central strategy employed by our method is to strike a balance between dimensionality reduction of task specific data and dimensionality expansion as processing progresses throughout the hierarchy of the neural network [8].

## 1.1 Related Work

Recently, a number of approaches have been proposed to adapt a DNN model to the continual learning setting, from an adaptive model architecture perspective such as adding columns or neurons for new tasks [30, 38, 32]; model parameter adjustment or regularization techniques like, imposing restrictions on parameter updates [14, 39, 17, 35]; memory revisit techniques which ensure model updates towards the optimal directions [19, 28, 33]; Bayesian approaches to model continuously acquired information [35, 24, 9]; or on broader domains with approaches targeted at different setups or goals such as few-shot learning or transfer learning [6, 25].

In order to demonstrate our idea in comparison with the state-of-the-art techniques, we briefly discuss the following three popular approaches to continual learning:

I) Regularization : It constrains or regularizes the model parameters by adding additional terms in the loss function that prevent the model from deviating significantly from the parameters important to earlier tasks. Typical algorithms include elastic weight consolidation (EWC) [14] and continual learning through synaptic intelligence (SI) [39].

II) Architectural modification : It revises the model structure successively after each task in order to provide more memory and additional free parameters in the model for new task input. Recent examples in this direction are progressive neural networks [30] and dynamically expanding networks [38].

III) Memory replay : It stores data samples from previous tasks in a separate memory buffer and retrains the new model based on both the new task input and the memory buffer. Popular algorithms here are gradient episodic memory (GEM) [19], incremental classifier and representation learning (iCaRL) [28].

Among these approaches, regularization is particularly prone to saturation of learning when the number of tasks is large. The additional / regularization term in the loss function will soon lose its competency when important parameters from different tasks are overlapped too many times. Modifications on network architectures like progressive networks resolve the saturation issue, but do not scale when the number and complexity of tasks increase. The scalability problem is also prominent when using current memory replay techniques, often suffering from high memory and computational costs.

Our approach resembles the use of memory replay since it preserves the original input data samples from earlier tasks for further training. However, it does not require extra memory for training and is cost efficient compared to previous memory replay methods. It also makes more effective use of the model structure by exploiting the model capacity to adapt with more tasks, in contrast to constant addition of neurons or additional network layers for new tasks. Furthermore, unlike the importance assigned to model specific parameters when using regularization methods, we assign importance to the training data that is relevant in effectively learning new tasks, while forgetting less important information.

## 2 Online Leverage Score Sampling

Before presenting the idea, we first setup the problem: Let { ( A , B 1 1 ) , ( A , B 2 2 ) , ..., ( A , B i i ) , ... } represent a sequence of tasks, each task consists of n i data samples and each sample has a feature dimension d and an output dimension m , i.e., input A i ∈ R n i × d and true output B i ∈ R n i × m . Here, we assume the feature and output dimensions are fixed for all tasks 1 . The goal is to train a DNN over the sequence of tasks and ensure it performs well on all of them, without catastrophic forgetting. Here, we consider that the network's architecture stays the same and the tasks are received in a sequential manner. Formally, with f representing a DNN, our objective is to minimize the loss 2 :

$$\min _ { f } \left \| f ( A ) - B \right \| _ { 2 } ^ { 2 } \text$$

Under this setup, we look at some of the existing models:

Online EWC trains f on the i th task ( A , B i i ) with a loss function containing additional penalty terms

$$\min _ { f } \left \| f ( A _ { i } ) - B _ { i } \right \| _ {$$

where λ indicates the importance level of the previous tasks compared to task i , F j p represents the p th diagonal entry of the Fisher information matrix for Task j , w represents the number of parameters in the network, θ p corresponds to the p th model parameter for the current task and θ j ∗ p is the p th model parameter value for the j th task.

Alternately, GEM maintains an extra memory buffer containing data samples from each of the previous tasks M k with k &lt; i . It trains on the current task ( A , B i i ) with a regular loss function, but subject to inequalities on each update of f (update on each parameter θ ),

$$\ell _ { 1 } \quad \begin{array} {$$

$$\mathbb { l } \, k < i.$$

## 2.1 Our approach

The new method OLSS, different from either method above, targets to find an approximation of A in a streaming (online) manner, i.e., form a sketch ˆ A i ∈ R glyph[lscript] × d to approximate [ A T 1 A T 2 · · · A T T i ] ∈ R ( n 1 + ... + n i ) × d such that the resulting

$$\hat { f } _ { i } \coloneqq \arg \min _ { f } \left \| f ( \hat {$$

is likely to perform on all tasks as good as

$$f _ { i } ^ { * } \coloneqq \arg \min _ { f } \left \| f ( [ A _ { 1 } ^ { T } \ A _ { 2 } ^ { T } \ \cdots \ A _ { i } ^ { T } ] ^ { T } ) - [ B _ { 1 } ^ { T } \ B _ { 2 } ^ { T } \ \cdots \ B _ { i } ^ { T } ] ^ { T } \right \| _ { 2 } ^ { 2 }.$$

In order to avoid extra memory and computation cost during the training process, we could set the approximate ˆ A i to have the same number of rows (number of data samples) as the current task A i .

Equation (1) and (2) represent nonlinear least squares problems. It is to be noted that a nonlinear least squares problem can be solved with an approximation deduced from an iteration of linear least

1 If we know apriori that the feature or output dimensions are different, we could choose a presumed larger value of d and m . In continuous learning our aim is to solve successive problems with some degree of overlap. As such, the feature and output dimensions being the same across tasks is not overly strict.

2 Here, we represent a generic Euclidean loss term. However, this could take the form of any typical formulation in terms of l 1 -loss, l 2 -loss or cross-entropy loss as commonly used in classification problems.

squares problems with J T J ∆ θ = J T ∆ B where J is the Jacobian of f at each update (using the Gauss-Newton method). Besides this technique, there are various other approaches in addressing this problem. Here we adopt a cost effective simple randomization technique - leverage score sampling, which has been used extensively in solving large scale linear least squares and low rank approximation problems [2, 5, 37].

## 2.2 Statistical Leverage Score and Leverage Score Sampling

Definition 1 [5] Given a matrix A ∈ R n × d with n &gt; d , let U denote the n × d matrix consisting of the d left singular vectors of A , and let U ( i, :) denote the i -th row of U , then the statistical leverage score of the i -th row of A is defined as ∥ ∥ ∥ U ( i, :) ∥ ∥ ∥ 2 for i ∈ { 1 , ..., n } .

$$2$$

Statistical leverage scores measure the non-uniformity structure of a matrix and a higher score indicates a heavier weight of the row contributing to the non-uniformity of the matrix. It has been widely used for outlier detection in statistical data analysis. In recent applications [5, 37], it also emerges as a fundamental tool for constructing randomized matrix sketches. Given a matrix A ∈ R n × d , a sketch of A is another matrix B ∈ R glyph[lscript] × d where glyph[lscript] is significantly smaller than n but still approximates A well, more specifically, ∥ ∥ A A T -B B T ∥ ∥ 2 ≤ ‖ ε A ‖ 2 2 . Theoretical accuracy guarantees have been derived for random sampling methods based on statistical leverage scores [37, 20].

Considering our setup which is to approximate a matrix for solving a least squares problem and also the computational efficiency, we adopt the following leverage score based sampling method:

Given a sketch size glyph[lscript] , define a distribution { p , ..., p i n } 3 with p i = ‖ U ( i, :) ‖ 2 2 d , the sketch is formed by independently and randomly selecting glyph[lscript] rows of A without replacement, where the i th row is selected with probability p i . Based on this, we are able to select the samples that contributes the most to a given dataset. The remaining problem is to embed it in a sequence of tasks and still generate promising approximations to solve the least squares problem. In order to achieve that, we make use of the concept of frequent directions.

## 2.3 Frequent Directions

Frequent directions extends the idea of frequent items in item frequency approximation problem to a matrix [18, 10, 34] and it is also used to generate a sketch for a matrix, but in a data streaming environment. As the rows of A ∈ R n × d are fed in one by one, the original idea of frequent directions is to first perform Singular Value Decomposition (SVD) on the first 2 glyph[lscript] rows of A and shrink the top glyph[lscript] singular values by the same amount which is determined by the ( glyph[lscript] +1) th singular value, and then save the product of the shrunken top glyph[lscript] singular values and the top glyph[lscript] right singular vectors as a sketch for the first 2 glyph[lscript] rows of A . With the next glyph[lscript] rows fed in, append them behind the sketch and perform the shrink and product. This process is repeated until reaching the final sketch ˆ A ∈ R glyph[lscript] × d for A ∈ R n × d . Different from the leverage score sampling sketching technique, a deterministic bound is guaranteed for the accuracy of the sketch: ∥ ∥ ∥ A A T -ˆ A A T ˆ ∥ ∥ ∥ 2 2 ≤‖ A -A k ‖ 2 F / glyph[lscript] ( -k ) with l &gt; k and A k denotes best rankk approximation of A [18, 10].

Inspired by the routine of frequent directions in a streaming data environment, our OLSS method is constructed as follows: First initialize a 'sketch' matrix ˆ A ∈ R glyph[lscript] × d and a corresponding ˆ B ∈ R glyph[lscript] × m . For the first task ( A 1 ∈ R n 1 × d , B 1 ∈ R n 1 × m ) , we randomly select glyph[lscript] rows of A and (the corresponding glyph[lscript] rows of) B without replacement according to the leverage score sampling defined above with probability distribution based on A 's leverage scores, then train the model on the sketch ( ˆ A B , ˆ ); after seeing Task 2, we append ( A 2 , B 2 ) to the sketch ( ˆ A B , ˆ ) respectively and again randomly select glyph[lscript] out of glyph[lscript] + n 2 data samples according to the leverage score sampling with the probability distribution based on the leverage scores of [ ˆ A ,A T T T 2 ] ∈ R ( glyph[lscript] + n 2 ) × d , and form a new sketch ˆ A ∈ R glyph[lscript] × d and ˆ B ∈ R glyph[lscript] × d , then train on it. This process is repeated until the end of the task sequence. We present the step by step procedure in Algorithm 1.

3 Since d = ‖ U ‖ 2 F = ∑ n i =1 ∥ ∥ U ( i, :) ∥ ∥ 2 2 , { p , ..., p 1 n } forms a probability distribution.

## 2.4 Main Algorithm

The original idea of leverage score sampling and frequent directions both have the theoretical accuracy bounds with the sketch on the error term ∥ ∥ ∥ A A T -ˆ A A T ˆ ∥ ∥ ∥ 2 . The bounds show that the sketch

ˆ A contains the relevant information used to form the covariance matrix of all the data samples A A T , in other words, the sketch captures the relationship among the data samples in the feature space (which is of dimension d ). For a sequence of tasks, it is common to have noisy data samples or interruptions among samples for different tasks. The continuous update of important rows in a matrix (data samples for a sequence of tasks), or the continuous effective forgetting of less useful rows may serve as a filter to remove the unwanted noise.

Different from most existing methods, Algorithm 1 does not work directly with the training model, instead it could be considered as data pre-processing which constantly extracts useful information from previous and current tasks. Because of its parallel construction, OLSS could be combined with all the aforementioned algorithms to further improve its performance.

## Algorithm 1 Online Leverage Score Sampling

Input: A sequence of tasks { ( A , B 1 1 ) , ..., ( A , B i i ) , ... } with A i ∈ R n i × d and B i ∈ R n i × m ; initialization of the model parameters; a space parameter glyph[lscript] i.e., number of samples to pass in the model for training. It can be set as n i or even smaller after receiving the i -th task, which avoids extra memory and computations during training.

Output: A trained neural network on a sequence of tasks.

- 1: Initialize a buffer set S = { ˆ A,B ˆ } where both ˆ A and ˆ B are empty.
- 2: while the i th task is presented do
- 3: if ˆ A and ˆ B are empty then
- 4: set ˆ = A A i and ˆ = B B i ,
- 5: else

$$& \nu. \quad \text{csc} \\ & 6 \colon \quad \text{set} \, \hat { A } = \begin{bmatrix} \hat { A } \\ A _ { i } \end{bmatrix} \text{and} \, \hat { B } = \begin{bmatrix} \hat { B } \\ B _ { i } \end{bmatrix}.$$

- 7: Perform SVD: [ U, Σ , V T ] = svd A ( ˆ ) .
- 8: Randomly select glyph[lscript] rows of ˆ A and ˆ B without replacement based on probability ‖ U j, : ‖ 2 2 / U ‖ ‖ 2 F for j ∈ { 1 , ..., n i + glyph[lscript] } (or j ∈ { 1 , ..., n i } when i = 1 ) and set them as ˆ A and ˆ B respectively.
- 9: Train the model with ˆ A ∈ R glyph[lscript] × d and ˆ B ∈ R glyph[lscript] × m .

Regarding the computational complexity, when n i is large, the SVD of ˆ A ∈ R ( n i + ) glyph[lscript] × d in Step 6 is computationally expensive which takes O (( n i + ) glyph[lscript] d 2 ) time. This procedure is for the computation of leverage scores which can be sped up significantly with various leverage score approximation techniques in the literature [5, 2, 29], such as through the randomized algorithm in [5], the leverage scores for ˆ A could be approximated in O (( n i + ) glyph[lscript] d log( n i + )) glyph[lscript] time.

However, one possible drawback of the above procedure is that the relationship represented in a covariance matrix is linear, so any underlying nonlinear connections among the data samples may not be fully captured in the sketch. Furthermore, the structure of the function f would also affect the information required to be kept in the sketch in order to perform well on solving the least squares problem in (2). As such, there may exist certain underlying dependency of a data sample's importance on the DNN model architecture. This remains a future research direction.

## 3 Experiments

We evaluate the performance of the proposed algorithm OLSS on three classification tasks used as benchmarks in related prior work.

- · Rotated MNIST [19]: a variant of the MNIST dataset of handwriten digits [16], the digits in each task are rotated by a fixed angle between 0 ◦ to 180 ◦ . The experiment is on 20 tasks and each task consists of 60 000 , training and 10 000 , testing samples.
- · Permutated MNIST [14]: a variant of the MNIST dataset [16], the digits in each task are transformed by a fixed permutation of pixels. The experiment is on 20 tasks and each task consists of 60 000 , training and 10 000 , testing samples.

- · Incremental CIFAR100 [28, 39]: a variant of the CIFAR object recognition dataset with 100 classes [15]. The experiment is on 20 tasks and each task consists of 5 classes; each task consists of 2 500 , training and 500 testing samples. Where, each task introduces a new set of classes; for a total number of 20 tasks, each new task concerns examples from a disjoint subset of 5 classes.

In the setting of [19] for incremental CIFAR100, a softmax layer is added to the output vector which only allows entries representing the 5 classes in the current task to output values larger than 0 . In our setting, we allow the entries representing all the past occurring classes to output values larger than 0 . We believe this is a more natural setup for continual learning.

For the aforementioned experiments, we compare the performance of the following algorithms:

- · A simple SGD predictor.
- · EWC [14], as discussed earlier in Section 2.
- · GEM [19], as discussed earlier in Section 2.
- · iCaRL [28], it classifies based on a nearest-mean-of-exemplars rule, keeps an episodic memory and updates its exemplar set continuously to prevent catastrophic forgetting. It is only applicable to incremental CIFAR100 experiment due to its requirement on the same input representation across tasks.
- · OLSS (ours).

In addition to these, experiments were also conducted using SI [39] and the same three tasks. However, no significant improvement in performance and a sensitivity to learning rate parameter choice was observed, with learning ability being relatively better than online EWC. As such we don't show SI performance in our plots. It can however be tested using our open sourced code 4 for this paper.

The competing algorithms SGD, EWC, GEM and iCaRL were implemented based on the publicly available code from the original authors of the GEM paper [19]; a plain SGD optimizer is used for all algorithms. The DNN used for rotated and permuted MNIST is an MLP with 2 hidden layers and each with 400 rectified linear units; whereas a smaller version of ResNet18 [13], with three times less feature maps across all layers is used for the incremental CIFAR100 experiment. We train 5 epochs with batch size 200 on rotated and permuted MNIST datasets and 10 epochs with batch size 100 on incremental CIFAR100. The regularization and memory hyper-parameters in EWC, iCaRL and GEM were set as described in [19]. The space parameter for our OLSS algorithm was set to be equal to the number of samples in each task. The learning rate for each algorithm was determined through a grid search on { 0 001 0 003 0 01 0 03 0 1 0 3 . , . , . , . , . , . , 1 0 . } . The final learning rates used in each experiment corresponding to the different algorithms was set as, rotated MNIST, SGD: 0 1 . , EWC: 0 3 . , GEM: 0 3 . and OLSS: 0 3 . ; permutated MNIST, SGD: 0 001 . , EWC: 0 1 . , GEM: 0 1 . and OLSS: 0 1 . and for incremental CIFAR100, SGD: 0 1 . , EWC: 0 1 . , GEM: 0 3 . , iCaRL: 0 01 . and OLSS: 1 0 . .

## 3.1 Results

To evaluate the performance of different algorithms, we examine

- · The average test accuracy (Figure 1 (left)), defined as 1 k ∑ k i =1 Acc ( task i ) after training x = k tasks.
- · Task 1's test accuracy (Figure 1 (right)), defined as Acc ( task 1) after training x = k tasks.
- · Wall clock time (Table 1).

As observed from Figure 1 (left) across the three benchmarks, OLSS achieves similar average task accuracy or slightly higher compared to GEM and clearly outperforms SGD, EWC and iCaRL. This demonstrates the the ability of OLSS for continuously selecting useful data samples with progressive learning to overcome the catastrophic forgetting issue. In terms of maintaining the performance of the earliest task (Task 1) after training a sequence of tasks, OLSS shows the most robust performance

4 The PyTorch code base implementing all the experiments presented here will be made publicly available on Github.

at par with GEM on rotated and permutated MNIST, and slightly worse than GEM as the number of tasks increases in case of incremental CIFAR100. However, both these methods, significantly outperform SGD, EWC and iCaRL.

In order to compare the computational time complexity across the methods, we report the walk clock time in Table 1. Noticeably, SGD is the fastest among all the algorithms, however performs the worst as observed in Figure 1, then followed by OLSS and EWC (only in the case of CIFAR100, EWC is relatively faster than OLSS). The algorithms iCaRL and GEM both demand much higher computational costs, with GEM being significantly slow compared to the rest. This behavior is expected due to the requirement of additional constraint validation and at certain occasions, a gradient projection step (in order to correct for constraint violations across data samples from previously learned tasks stored in the memory buffer) in GEM (see Section 3 in [19]). As such although the buffered replay-memory based approach in GEM prevents catastrophic forgetting, the computational cost becomes prohibitively slow to be performed online while training DNNs on sequential multi-task learning scenarios.

Based on the performance and computational efficiency on all three datasets, OLSS emerges as the most favorable among the current state of the art algorithms for continual learning.

Figure 1: Left : Evolution of average test accuracy across all the learned tasks after training on a sequence of tasks. (E.g., the accuracy value at Task = 10 is the average test accuracy on Task 1 -10 after training the model for 10 consecutive tasks.) Right : Evolution of test accuracy for the first task after training on a sequence of tasks. (E.g., the accuracy value at Task = 10 is the accuracy of Task 1 after training the model for 10 consecutive tasks.)

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00355v1-figure-2055ee1a-4b34-4a0f-b5d9-94a2c3242cd4.jpg)

Table 1: Wall Clock Time (s)

|       | ROTATED MNIST   | PERMUTED MNIST   |   I NCREMENTAL CIFAR100 |
|-------|-----------------|------------------|-------------------------|
| SGD   | 158             | 152              |                     780 |
| EWC   | 944             | 896              |                    1213 |
| GEM   | 8688            | 8846             |                   17868 |
| ICARL | -               | -                |                    2802 |
| OLSS  | 496             | 455              |                    1363 |

## 3.2 Discussions

The space parameter of OLSS ( glyph[lscript] in Algorithm 1) could be varied to balance its accuracy and efficiency. Here the choice of glyph[lscript] = n i (number of samples in current task) is selected such that the number of training samples would be standardized across all algorithms, enabling effective compression and extraction of data samples for OLSS in a straightforward comparison. However, it is to be noted that if glyph[lscript] = n i , OLSS indeed requires some additional memory in order to compute the SVD of concatenated sketch of previous tasks and the current task. Unless, the algorithm is run in an edge computing environment with limited memory on chip, this issue could be ignored.

On the other hand, GEM and iCaRL keep an extra episodic memory throughout the training process. Memory size was set to be 256 for GEM and 1280 for iCaRL by considering the accuracy and efficiency in the experiments. Variations on the size of the episodic memory would also affect their performance as well as the running time. As described earlier, GEM requires a constraint validation step and a potential gradient projection step for every update of the model parameters. As such the computational time complexity in this case is proportional to the product of the number of samples kept in the episodic memory, the number of parameters in the model and the number of iterations required to converge. In contrast, OLSS uses a SVD to compute the leverage scores for each task which can be achieved in a time complexity proportional to the product of the square of the number of features and the number of data samples. This is considerably less compared to GEM as shown in Table 1. The computational complexity can be further reduced with fast leverage score approximation methods like randomized algorithm in [5].

As shown in Figure 2, after training the whole sequence of tasks, both GEM and OLSS are able to preserve the accuracy for most tasks on rotated and permuted MNIST. Nevertheless, it is difficult to completely recover the accuracy of previously trained tasks on CIFAR100 for all algorithms. In case of synaptic consolidation based method like EWC, the loss function contains additional regularization or penalty terms for each previously trained tasks. These additional penalties are isolated from each other. As the number of tasks increases, it may loose the elasticity in consolidating the overlapping parameters, and as such show a steeper slope in the EWC plot of Figure 2.

Figure 2: Accuracy of each task after training sequentially on all tasks. (E.g., the accuracy value at Task = 10 is the accuracy of Task 10 after training the model on all tasks sequentially.)

![image](https://ac.marcodsn.me/arxiv-markdown-images/1908.00355v1-figure-61423c98-cc9a-4861-9561-0c3792deae1d.jpg)

## 4 Conclusions

We presented a new approach in addressing the continual learning problem with deep neural networks. It is inspired by the randomization and compression techniques typically used in statistical analysis. We combined a simple importance sampling technique - leverage score sampling with the frequent directions concept and developed an online effective forgetting or compression mechanism that preserves meaningful information from previous and current task, enabling continual learning across a sequence of tasks. Despite its simple structure, the results on classification benchmark experiments (designed for the catastrophic forgetting issue) demonstrate its effectiveness as compared to recent state of the art.

## References

- [1] M. K., Benna, and S. Fusi, Computational Principles of Synaptic Memory Consolidation . in Nature Neuroscience, 19(12), pp. 1697-1708, 2016.
- [2] M. B. Cohen, C. Musco and C. Musco, Input Sparsity Time Low-Rank Approximation via Ridge Leverage Score Sampling , in Proceedings of the 28th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 1758 - 1777, 2017.
- [3] P. Drineas, M. W. Mahoney and S. Muthukrishnan, Relative-error CUR Matrix Decomposition , in SIAM Journal on Matrix Analysis and Applications, 30, pp.844-881, 2008.
- [4] P. Drineas, M. W. Mahoney, S. Muthukrishnan and T. Sarlós, Faster Least Squares Approximation , in Numerische Mathematik, 117, pp.219-249, 2010.
- [5] P. Drineas, M. Magdon-Ismail, M. W. Mahoney and D. P. Woodruff, Fast Approximation of Matrix Coherence and Statistical Leverage , in Journal of Machine Learning Research, 13, pp. 3441-3472, 2012.
- [6] C. Finn, P. Abbeel and S. Levine, Model-Agnostic Meta-learning for Fast Adaptation of Deep Networks , in International Conference on Machine Learning (ICML), 2017.
- [7] R. M. French, Catastrophic Forgetting in Connectionist Networks , Trends in Cognitive Sciences, 1999.
- [8] S. Fusi, E.K. Miller, and M. Rigotti, Why Neurons Mix: High Dimensionality for Higher Cognition . in Current Opinion in Neurobiology, 37, pp.66-74, 2016.
- [9] M. Garnelo, J. Schwarz, D. Rosenbaum, F. Viola, D. J. Rezende, S. M. Ali Eslami and Y. W. Teh, Neural Processes , in Theoretical Foundations and Applications of Deep Generative Models Workshop, ICML, 2018.
- [10] M. Ghashami, E. Liberty, J. M. Phillips and D. P. Woodruff, Frequent Directions: Simple and Deterministic Matrix Sketching , in SIAM Journal of Computing, 45, pp. 1762 - 1792, 2016.
- [11] I. J. Goodfellow, M. Mirza, D. Xiao, A. Courville and Y. Bengio, An Empirical Investigation of Catastrophic Forgetting in Gradient-Based Neural Networks , arXiv, 2013.
- [12] D. Hassabis, D. Kumaran, C. Summerfield and M. Botvinick, Neuroscience-Inspired Artificial Intelligence , in Neuron Review, 95 (2), pp. 245-258, 2017.
- [13] K. He, X. Zhang, S. Ren, and J. Sun, Deep Residual Learning for Image Recognition , in Proceedings of the IEEE conference on computer vision and pattern recognition (CVPR), pp. 770-778, 2016.
- [14] J. Kirkpatrick, R. Pascanu, N. Rabinowitz, J. Veness, G. Desjardins, A. A. Rusu, K. Milan, J. Quan, T. Ramalho, A. Grabska-Barwinska, D. Hassabis, C. Clopath, D. Kumaran and R. Hadsell, Overcoming Catastrophic Forgetting in Neural Networks , in PNAS, 2017.
- [15] A. Krizhevsky, Learning Multiple Layers of Features from Tiny Images , in Technical Report, University of Toronto, 2009.
- [16] Y. LeCun, C. Cortes and C. J. Burges, The MNIST Database of Handwritten Digits , URL: http://yann.lecun.com/exdb/mnist/ , 1998.
- [17] Z. Li and D. Hoiem, Learning without Forgetting , in European Conference on Computer Vision (ECCV), pp. 614-629, 2016.
- [18] E. Liberty, Simple and Deterministic Matrix Sketching , in Proceedings of the 19th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 2013.
- [19] D. Lopez-Paz and Marc' Aurelio Ranzato, Gradient Episodic Memory for Continual Learning , in Proceedings of the 31st Conference on Neural Information Processing Systems (NeurIPS), 2017.
- [20] P. Ma, M. Mahoney and B. Yu. A statistical perspective on algorithmic leveraging , in Proceedings of International Conference on Learning Representations (ICML), 2014.
- [21] M. W. Mahoney, Randomized Algorithms for Matrices and Data , in Foundations and Trends in Machine Learning, 3, pp. 123-224, 2011.
- [22] J. L. McClelland, B. L. McNaughton and R. C. O'Reilly, Why There Are Complementary Learning Systems in the Hippocampus and Neocortex: Insights From the Successes and Failures of Connectionist Models of Learning and Memory , in Psychological Review, 102, pp. 419-457, 1995.

| [23] M. McCloskey and N. J. Cohen, Catastrophic Interference in Connectionist Networks: The Sequential Learning Problem , in the Psychology of Learning and Motivation, 24, pp. 104-169, 1989.              |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [24] C. V. Nguyen, Y. Li, T. D. Bui and R. E. Turner, Variational Continual Learning , International Conference on Learning Representations (ICLR), 2018.                                                   |
| [25] A. Nichol, J. Achiam and J. Schulman, On First-Order Meta-Learning Algorithms , CoRR, 2018.                                                                                                            |
| [26] R. Pang, B.J. Lansdell, and A.L. Fairhall, Dimensionality Reduction in Neuroscience . in Current Biology, 26(14), pp. R656-R660, 2016.                                                                 |
| [27] G. I. Parisi, R. Kemker, J. L. Part, C. Kanan and S. Wermter, Continual Lifelong Learning with Neural Networks: A Review , in Neural Networks, 2019.                                                   |
| [28] S.-A. Rebuffi, A. Kolesnikov, G. Sperl and C. H. Lampert, iCaRL: Incremental Classifier and Representa- tion Learning , in Proceedings of Conference on Computer Vision and Pattern Recognition, 2017. |
| [29] A. Rudi, D. Calandriello, L. Carratino and L. Rosasco, On Fast Leverage Score Sampling and Optimal Learning , in Advances in Neural Information Processing Systems, pp. 5677 - 5687, 2018.             |
| [30] A. A. Rusu, N. C. Rabinowitz, G. Desjardins, H. Soyer, J. Kirkpatrick, K. Kavukcuoglu, R. Pascanu and R. Hadsell, Progressive Neural Networks , arXiv:1606.04671, 2016.                                |
| [31] P. Ruvolo and E. Eaton, ELLA: An Efficient Lifelong Learning Algorithm , in Proceedings of the 30th International Conference on Machine Learning (ICML), 2013.                                         |
| [32] J. Schwarz, J. Luketina, W. M. Czarnecki, A. Grabska-Barwinska, Y. W. Teh, R. Pascanu and R. Hadsell, Progress &Compress: A Scalable Framework for Continual Learning , arXiv: 1805.06370, 2018.       |
| [33] H. Shin, J. K. Lee, J. Kim and J. Kim, Continual Learning with Deep Generative Replay , in Proceedings of the 31st Conference on Neural Information Processing Systems (NeurIPS), 2017.                |
| [34] D. Teng and D. Chu, Fast Frequent Directions for Low Rank Approximation , in IEEE Transactions on Pattern Analysis and Machine Intelligence, 41 (6), pp. 1279-1293, 2019.                              |
| [35] M. K. Titsias, J. Schwarz, A. G. de G. Matthews, R. Pascanu and Y. W. Teh, Functional Regularisation for Continual Learning using Gaussian Processes , arXiv:1901.11356, 2019.                         |
| [36] S. Thrun and T. Mitchell, Lifelong Robot Learning , in Robotics and Autonomous Systems, 15, pp. 25-46, 1995.                                                                                           |
| [37] D. Woodruff, Sketching as A Tool for Numerical Linear Algebra , in Foundations and Trends R © in Theoretical Computer Science, 10, pp.1-157, 2014.                                                     |
| F. Zenke, B. Poole and S. Ganguli, Continual Learning Through Synaptic Intelligence , in Proceedings of                                                                                                     |
| [39] the 34th International Conference on Machine Learning (ICML), 2017.                                                                                                                                    |
Dan Teng Sakyasingha Dasgupta
Continual Learning via Online Leverage Score Sampling
In order to mimic the human ability of continual acquisition and transfer of
knowledge across various tasks, a learning system needs the capability for
continual learning, effectively utilizing the previously acquired skills. As
such, the key challenge is to transfer and generalize the knowledge learned
from one task to other tasks, avoiding forgetting and interference of previous
knowledge and improving the overall performance. In this paper, within the
continual learning paradigm, we introduce a method that effectively forgets the
less useful data samples continuously and allows beneficial information to be
kept for training of the subsequent tasks, in an online manner. The method uses
statistical leverage score information to measure the importance of the data
samples in every task and adopts frequent directions approach to enable a
continual or life-long learning property. This effectively maintains a constant
training size across all tasks. We first provide mathematical intuition for the
method and then demonstrate its effectiveness in avoiding catastrophic
forgetting and computational efficiency on continual learning of classification
tasks when compared with the existing state-of-the-art techniques.