Learning curves for continual learning in neural networks: Self-knowledge transfer and forgetting

1 INTRODUCTION . As deep learning develops for a single task , it enables us to work on more complicated learning frameworks where the model is sequentially trained on multiple tasks , e.g. , transfer learning , curriculum learning , and continual learning . Continual learning deals with the situation in which the learning machine can not access previous data due to memory constraints or privacy reasons . It has attracted much attention due to the demand on applications , and fundamental understanding and algorithms are being explored ( Hadsell et al. , 2020 ) . One well-known phenomenon is catastrophic forgetting ; when a network is trained between different tasks , naive training can not maintain performance on the previous task ( McCloskey & Cohen , 1989 ; Kirkpatrick et al. , 2017 ) . It remains unclear in most cases under what conditions a trained model ’ s performance improves or deteriorates in continual learning . Understanding its generalization performance is still limited ( Pentina & Lampert , 2014 ; Bennani et al. , 2020 ; Lee et al. , 2021 ) . For single-task training , however , many empirical and theoretical studies have succeeded in characterizing generalization performance in over-parameterized neural networks and given quantitative evaluation on sample-size dependencies , e.g. , double descent ( Nakkiran et al. , 2020 ) . For further development , it will be helpful to extend the analyses on single-task training to sequential training on multiple tasks and give theoretical backing . To deepen our understanding of continual learning , this study shows a theoretical analysis of its generalization error in the neural tangent kernel ( NTK ) regime . In more detail , by extending a statistical mechanical analysis of kernel ridge-less regression on single-task training ( Bordelon et al. , 2020 ) to continual learning , we investigate the learning curve , i.e. , the dependence of generalization error on sample size or number of tasks . We focus on the continual learning with explicit task boundaries . Suppose that the model continually learns data generated by two similar teacher functions , which we call target functions , from one task to another . All input samples are generated from the same distribution in an i.i.d . manner , and each task has output samples ( labels ) generated by its own target function . In the NTK regime , the training of the network becomes independent among heads , and learning is formulated as a regression of each head on a corresponding target function . Our main contributions are summarized as follows . First , we revealed characteristic transitions from negative to positive transfer depending on the target similarity . More similar targets above a specific critical value can achieve positive knowledge transfer ( i.e. , better prediction on the subsequent task than training without the first task ) . Compared to this , backward transfer ( i.e. , prediction on the previous task ) has a large critical value , and subtle dissimilarity between targets causes negative transfer . The error can rapidly increase , which clarifies that catastrophic forgetting is literally catastrophic ( Section 4.1 ) . Second , we considered continual learning of the same target function . Even for the continual learning in iterative tasks , the trained model ’ s performance improves or deteriorates in a non-monotonic way . This depends on the sample size of each task ; for equal sample sizes , we can guarantee that the generalization error monotonically decreases from task to task ( Section 4.2 for two tasks & Section 5 for more tasks ) . Unbalanced sample sizes , however , deteriorates generalization ( Section 4.3 ) . We refer to these improvement and deterioration of generalization as self-knowledge transfer and forgetting , respectively . Finally , we empirically confirmed that self-knowledge transfer and forgetting actually appear in continual learning of multi-layer perceptron ( MLP ) and ResNet-18 ( Section 5.1 ) . Thus , this study sheds light on fundamental understanding and the universal behavior of continual learning in over-parameterized learning machines . 2 RELATED WORK . Method of analysis . As an analysis tool , we use the replica method originally developed for statistical mechanics . Statistical mechanical analysis enables us typical-case evaluation , that is , the average evaluation over data samples or parameter configurations . It sometimes provides us with novel insight into what the worst-case evaluation has not captured ( Abbaras et al. , 2020 ; Spigler et al. , 2020 ) . The replica method for kernel methods has been developed in Dietrich et al . ( 1999 ) , and recently in Bordelon et al . ( 2020 ) ; Canatar et al . ( 2021 ) . These recent works showed excellent agreement between theory and experiments on NTK regression , which enables us to quantitatively understand sample-size dependencies including implicit spectral bias , double descent , and multiple descent . Continual learning . Continual learning dynamics in the NTK regime that we investigate was first formulated by Bennani et al . ( 2020 ) ; Doan et al . ( 2021 ) , though the evaluation of generalization remains unclear . They derived an upper bound of generalization via the Rademacher complexity , but it includes naive summation over single tasks and seems conservative . In contrast , our typical-case evaluation enables us to find such rich behaviors as negative/positive transfer and self-knowledge transfer/forgetting we newly find . The continual learning in the NTK regime belongs to so-called single-head setting ( Farquhar & Gal , 2018 ) , and it allows the model to revisit the previous classes ( target functions ) in subsequent tasks . This is complementary to earlier studies on incremental learning of new classes and its catastrophic forgetting ( Ramasesh et al. , 2020 ; Lee et al. , 2021 ) , where each task includes different classes and does not allow the revisit . Note that the basic concept of continual learning is not limited to incremental learning but allows the revisit ( McCloskey & Cohen , 1989 ; Kirkpatrick et al. , 2017 ) . Under the limited data acquisition or resources of memory , we often need to train the same model with the same targets ( but different samples ) from task to task . Therefore , the setting allowing the revisit seems reasonable . 3 PRELIMINARIES . 3.1 NEURAL TANGENT KERNEL REGIME . We summarize conventional settings of the NTK regime ( Jacot et al. , 2018 ; Lee et al. , 2019 ) . Let us consider a fully connected neural network f = uL given by ul = σwWlhl−1/ √ Ml−1 + σbbl , hl = φ ( ul ) ( l = 1 , ... , L ) , ( 1 ) where we define weight matrices Wl ∈ RMl×Ml−1 , bias terms bl ∈ RMl , and their variances σ2w and σ2b . We set random Gaussian initialization Wl , ij , bl , i ∼ N ( 0 , 1 ) and focus on the mean squared error loss : L ( θ ) = ∑N µ=1 ‖yµ − f ( xµ ) ‖2 , where the training samples { xµ , yµ } Nµ=1 are composed of inputs xµ ∈ RD normalized by ‖xµ‖2 = 1 and labels yµ ∈ RC . The set of all parameters is denoted as θ , and the number of training samples is N . Assume the infinite-width limit for hidden layers ( Ml →∞ ) , finite sample size , and depth compared with the width . The gradient descent dynamics with a certain learning rate then converges to a global minimum sufficiently close to the random initialization . This is known as the NTK regime , and the trained model is explicitly obtained as f ( c ) ( x′ ) = f ( c ) 0 ( x ′ ) + Θ ( x′ , X ) Θ ( X ) −1 ( y ( c ) − f ( c ) 0 ( X ) ) ( c = 1 , ... , C ) . ( 2 ) We denote the NTK matrix as Θ , arbitrary input samples ( including test samples ) as x′ , and the set of training samples as X . The indices of f mean 0 for the model at initialization and c for the head of the network . Entries of NTK Θ ( x′ , x ) are defined by∇θf0 ( x′ ) ∇θf0 ( x ) > . We write Θ ( X ) as an abbreviation for Θ ( X , X ) . The trained network is equivalent to a linearized model around random initialization ( Lee et al. , 2019 ) , that is , f ( c ) = f ( c ) 0 +∇θf ( c ) 0 ∆θ with ∆θ = θ − θ0 = C∑ c=1 ∇θf ( c ) 0 ( X ) > Θ ( X ) −1 ( y ( c ) − f ( c ) 0 ( X ) ) . ( 3 ) While over-parameterized models have many global minima , the NTK regime ’ s dynamics implicitly select the above θ , which corresponds to the L2 min-norm solution . Usually , we ignore f0 by taking the average over random initialization . The trained model ( 2 ) is then equivalent to the kernel ridge-less regression ( KRR ) . NTK regime also holds in various architectures including ResNets and CNNs ( Yang & Littwin , 2021 ) , and the difference only appears in the NTK matrix . Although we focus on the fully connected network in synthetic experiments , the following NTK formulation of continual learning and our theoretical results hold in any architecture under the NTK regime . Continual learning . We denote the set of training samples in the n-th task as ( Xn , yn ) ( n = 1 , 2 , ... , K ) , a model trained in a sequential manner from task 1 to task n as fn and its parameters as θn . That is , we train the network initialized at θn−1 for the n-th task and obtain fn . Assume the number of tasks K is finite . The trained model within the NTK regime is then given as follows ( Bennani et al. , 2020 ; Doan et al. , 2021 ) : fn ( x ′ ) = fn−1 ( x ′ ) + Θ ( x′ , Xn ) Θ ( Xn ) −1 ( yn − fn−1 ( Xn ) ) , ( 4 ) θn − θn−1 = ∇θf0 ( Xn ) > Θ ( Xn ) −1 ( yn − fn−1 ( Xn ) ) . ( 5 ) We omit the index c because each head is updated independently . The model fn completely fits the n-th task , i.e. , yn = fn ( Xn ) . The main purpose of this study is to analyze the generalization performance of the sequentially trained model ( 4 ) . At each task , the model has an inductive bias of KRR in the function space and L2 min-norm solution in the parameter space . The next task uses this inductive bias as the initialization of training . The problem is whether this inductive bias helps improve the generalization in the subsequent tasks . Remark ( independence between different heads ) . For a more accurate understanding of the continual learning in the NTK regime , it may be helpful to remark on the heads ’ independence , which previous studies did not explicitly mention . As in Eq . ( 2 ) , all heads share the same NTK , and f ( c ) depends only on the label of its class y ( c ) . While the parameter update ( 3 ) includes information of all classes , the c-th head can access only the information of the c-th class1 . For example , suppose that the n-th task includes all classes except 1 , i.e. , { 2 , ... , C } . Then , the model update on the the class 1 at the n-th task , i.e. , f1n − f1n−1 , becomes ∇θf ( 1 ) 0 ( x′ ) ( θn − θn−1 ) = ∇θf ( 1 ) 0 ( x ′ ) ∑ c=2 ∇θf ( c ) 0 ( Xn ) > Θ ( Xn ) −1 ( y ( c ) n − f ( c ) n−1 ) = 0 because ∇θf ( c ) 0 ∇θf ( c′ ) > 0 = 0 ( c 6= c′ ) in the infinite-width limit ( Jacot et al. , 2018 ; Yang , 2019 ) . Thus , we can deal with each head independently and analyze the generalization by setting C = 1 without loss of generality . This indicates that in the NTK regime , interaction between different heads do not cause knowledge transfer and forgetting . One may wonder if there are any non-trivial knowledge transfer and forgetting in such a regime . Contrary to such intuition , we reveal that when the subsequent task revisits previous classes ( targets ) , the generalization shows interesting increase and decrease . 1We use the term ” class ” , although the regression problem is assumed in NTK theory . Usually , NTK studies solve the classification problem by regression with a target y ( c ) = { 0 , 1 } .

Summary: This paper studies the generalization/transfer behavior of the continual learning/sequential learning under the neural tangent kernel (NTK) regime. It gives the formulation of the generalization error between two tasks in forwarding and backward ways and analyzes the influences of target similarity and sample sizes. Then the self-knowledge transfer case with the same target function is studied, which shows the universality of the catastrophic forgetting and the influence of the sample size. The results are then generalized to many tasks.