<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>Learnability and Algorithm for Continual Learning</title></titleStmt>
			<publicationStmt>
				<publisher></publisher>
				<date>07/23/2023</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10426835</idno>
					<idno type="doi"></idno>
					<title level='j'>Proceedings of Fortieth International Conference on Machine Learning (ICML-2023)</title>
<idno></idno>
<biblScope unit="volume"></biblScope>
<biblScope unit="issue"></biblScope>					

					<author>Gyuhak Kim</author><author>Changnan Xiao</author><author>Tatsuya Konishi</author><author>Bing Liu</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[This paper studies the challenging continual learning (CL) setting of Class Incremental Learning (CIL). CIL learns a sequence of tasks consisting of disjoint sets of concepts or classes. At any time, a single model is built that can be applied to predict/classify test instances of any classes learned thus far without providing any task related information for each test instance. Although many techniques have been proposed for CIL, they are mostly empirical. It has been shown recently that a strong CIL system needs a strong within-task prediction (WP) and a strong out-of-distribution (OOD) detection for each task. However, it is still not known whether CIL is actually learnable. This paper shows that CIL is learnable. Based on the theory, a new CIL algorithm is also proposed. Experimental results demonstrate its effectiveness.]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1.">Introduction</head><p>Learning a sequence of tasks incrementally, called continual learning, has attracted a great deal of attention recently <ref type="bibr">(Chen &amp; Liu, 2018)</ref>. In the supervised learning context, each task consists of a set of concepts or classes to be learned. It is assumed that all tasks are learned in one neural network, which results in the key challenge of catastrophic forgetting (CF) because when learning a new task, the system has to modify the network parameters learned from old tasks in order to learn the new task, which may cause performance degradation for the old tasks <ref type="bibr">(McCloskey &amp; Cohen, 1989)</ref>. Two continual learning settings have been popularly studied: task incremental learning (TIL) (van de Ven &amp; Tolias, 2019) and class incremental learning (CIL).</p><p>In TIL, each task is an independent classification problem and has a separate model (the tasks may overlap). At test time, the task-id of each test instance is provided to locate the task-specific model to classify the test instance. Definition 1.1 (Task Incremental Learning (TIL)). TIL learns a sequence of tasks, 1, 2, ..., T . The training set of task k is</p><p>, where n k is the number of samples in task k &#8712; T = {1, 2, ..., T }, and x i k &#8712; X is an input sample and</p><p>) is its label. A TIL system learns a function f : X &#215; T &#8594; Y to assign a class label y &#8712; Y k to (x, k) (a test instance x from task k).</p><p>For CIL, a single model is built for all tasks/classes learned thus far (the classes in each task are distinct). At test time, no task-id is provided for a test instance. Definition 1.2 (Class Incremental Learning (CIL)). CIL learns a sequence of tasks, 1, 2, ..., T . The training set of task k is</p><p>, where n k is the number of samples in task k &#8712; T = {1, 2, ..., T }, and x i k &#8712; X is an input sample and</p><p>A CIL system learns a function (predictor or classifier) f : X &#8594; Y that assigns a class label y to a test instance x.</p><p>CIL is a more challenging setting because in addition to CF, it has the inter-task class separation (ICS) <ref type="bibr">(Kim et al., 2022b)</ref> problem. ICS refers to the situation that since the learner has no access to the training data of the old tasks when learning a new task, then the learner has no way to establish the decision boundaries between the classes of the old tasks and the classes of the new task, which results in poor classification accuracy. <ref type="bibr">Kim et al. (2022b)</ref> showed that a good within-task prediction (WP) and a good out-ofdistribution (OOD) detection for each task are necessary and sufficient conditions for a strong CIL model. Definition 1.3 (out-of-distribution (OOD) detection). Given the training set D = {(x i , y i ) n i=1 }, where n is the number of data samples, x i &#8712; X is an input sample and y i &#8712; Y is its class label. Y is the set of all classes in D and called the in-distribution (IND) classes. Our goal is to learn a function f : X &#8594; Y &#8746; {O} that can detect test instances that do not belong to any classes in Y (OOD)), which are assigned to class O, denoting out-of-distribution (OOD).</p><p>The intuition of the theory in <ref type="bibr">(Kim et al., 2022b)</ref> is that if OOD detection is perfect for each task, then a test instance will be assigned to the correct task model to which the test instance belongs for classification, i.e., within-task prediction (WP). However, <ref type="bibr">(Kim et al., 2022b)</ref> does not prove that CIL is learnable. To our knowledge, no existing work has reported a learnability study for CIL (see Sec. 2). This paper performs the CIL learnability study.</p><p>The proposed learnability proof requires two assumptions:</p><p>(1) OOD detection is learnable. Fortunately, this has been proven in a recent paper <ref type="bibr">(Fang et al., 2022)</ref>. (2) There is a mechanism that can completely overcome forgetting (CF) for the model of each task. Again, fortunately, there are many existing TIL methods that can eliminate forgetting, e.g., parameter-isolation methods such as HAT <ref type="bibr">(Serr&#224; et al., 2018)</ref> and SupSup <ref type="bibr">(Wortsman et al., 2020)</ref>, which work by learning a sub-network in a shared network for each task. The sub-networks of all old tasks are protected when training a new task. Orthogonal projection methods such as PCP <ref type="bibr">(Kim &amp; Liu, 2020)</ref> and CUBER <ref type="bibr">(Lin et al., 2022)</ref> can also overcome forgetting in the TIL setting.</p><p>CIL can be solved by a combination of [a] a TIL method that is able to protect each task model with no CF, and [b] a normal supervised learning method for WP and [c] an OOD detection method. [b] and [c] can be easily combined either (i) with an OOD detection model since it also learns the IND classes (see Definition 1.3) or (ii) a WP model that can also perform OOD detection. That is, for CIL, we simply replace the classification model built for each task in HAT/SupSup with a combined WP and OOD detection model.</p><p>Based on the theory, we propose a new replay-based CIL method that uses the combination of [a] and (ii) (two separate heads for each task, one for WP and the other for OOD detection based on the same feature extractor). This paper thus makes two main contributions:</p><p>(1). It performs the first learnability study of CIL. To the best of knowledge, no such a study has been reported so far.</p><p>(2). Based on the theory, a new CIL method, called ROW (Replay, OOD, and WP for CIL), is proposed. Experimental results show that it outperforms existing strong baselines.</p><p>It is interesting to note that our theory, including our earlier work in <ref type="bibr">(Kim et al., 2022b)</ref>, in fact, unifies OOD detection and continual learning as it covers both <ref type="bibr">(Kim et al., 2023)</ref>. Additionally, the theory is also applicable to open world learning because OOD detection and class incremental learning are two critical components of an open world learning system <ref type="bibr">(Liu et al., 2023)</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.">Related Work</head><p>To our knowledge, we are not aware of any paper that studies the learnability of CIL. Below, we survey the existing CL literature on both the theoretical and empirical sides.</p><p>On the theoretical side. <ref type="bibr">Pentina &amp; Lampert (2014)</ref> proposes a PAC-Bayesian framework to provide a learning bound on expected error by the average loss on the observed tasks. However, this work is not about CIL but about TIL. It focuses on knowledge transfer and assumes that all the tasks have the same input space and the same label space and the tasks are very similar. However, in CIL, every task has a distinct set of class labels. Furthermore, this work is not concerned with CF as earlier research in lifelong learning builds a separate model for each task. <ref type="bibr">Lee et al. (2021)</ref> studied the generalization error by task similarity. It is again about TIL. <ref type="bibr">Bennani et al. (2020)</ref> showed that a specific method called orthogonal gradient descent (OGD) gives a tighter generalization bound than SGD. As noted in Sec. 1, empirically, the CF problem for TIL has been solved <ref type="bibr">(Serr&#224; et al., 2018;</ref><ref type="bibr">Kim et al., 2022b)</ref>. Several techniques have also been proposed to carry out knowledge transfer <ref type="bibr">(Ke et al., 2020;</ref><ref type="bibr">2021;</ref><ref type="bibr">Lin et al., 2022)</ref>. Our work is entirely different as we study the learnability of CIL, which is a more challenging setting than TIL because of the additional difficulty of ICS <ref type="bibr">(Kim et al., 2022b)</ref> in CIL. In this work, we are not concerned with knowledge transfer, which is mainly studied for the TIL setting. Recently, <ref type="bibr">Kim et al. (2022b)</ref> showed that a good within-task prediction (WP) and a good OOD detection for each task are necessary and sufficient conditions for a strong CIL model. However, <ref type="bibr">Kim et al. (2022b)</ref> did not show that CIL is learnable. This paper performs this study. It also proposes a new CIL algorithm.</p><p>On the empirical side, a large number of algorithms have been proposed. They belong to several families. (1). Regularization-based methods mitigate CF by restricting the learned parameters for old tasks from being updated significantly in a new task learning using regularizations <ref type="bibr">(Kirkpatrick et al., 2017;</ref><ref type="bibr">Zenke et al., 2017)</ref> or knowledge distillation <ref type="bibr">(Li &amp; Hoiem, 2016;</ref><ref type="bibr">Zhu et al., 2021)</ref>. Many existing approaches have used similar approaches <ref type="bibr">(Ritter et al., 2018;</ref><ref type="bibr">Schwarz et al., 2018;</ref><ref type="bibr">Xu &amp; Zhu, 2018;</ref><ref type="bibr">Castro et al., 2018;</ref><ref type="bibr">Dhar et al., 2019;</ref><ref type="bibr">Lee et al., 2019;</ref><ref type="bibr">Ahn et al., 2019;</ref><ref type="bibr">Liu et al., 2020a)</ref>. (2). Replay-based methods alleviate CF by saving a small amount of training data from old tasks in a memory buffer and jointly train the model using the current data and the saved buffer data <ref type="bibr">(Rusu et al., 2016;</ref><ref type="bibr">Lopez-Paz &amp; Ranzato, 2017;</ref><ref type="bibr">Chaudhry et al., 2019a;</ref><ref type="bibr">Hou et al., 2019;</ref><ref type="bibr">Wu et al., 2019;</ref><ref type="bibr">Rolnick et al., 2019;</ref><ref type="bibr">Buzzega et al., 2020;</ref><ref type="bibr">Rajasegaran et al., 2020a;</ref><ref type="bibr">Liu et al., 2021;</ref><ref type="bibr">Cha et al., 2021;</ref><ref type="bibr">Yan et al., 2021;</ref><ref type="bibr">Wang et al., 2022b;</ref><ref type="bibr">Guo et al., 2022;</ref><ref type="bibr">Kim et al., 2022a)</ref>. Some methods in this family also study which samples in memory should be used in replay <ref type="bibr">(Aljundi et al., 2019)</ref> or which samples in the training data should be saved <ref type="bibr">(Rebuffi et al., 2017;</ref><ref type="bibr">Liu et al., 2020b)</ref>. (3). Pseudoreplay methods generate pseudo replay data for old tasks to serve as the replay data <ref type="bibr">(Kamra et al., 2017;</ref><ref type="bibr">Shin et al., 2017;</ref><ref type="bibr">Wu et al., 2018;</ref><ref type="bibr">Seff et al., 2017;</ref><ref type="bibr">Kemker &amp; Kanan, 2018;</ref><ref type="bibr">Hu et al., 2019;</ref><ref type="bibr">Rostami et al., 2019;</ref><ref type="bibr">Ostapenko et al., 2019)</ref>. <ref type="bibr">(Zhu et al., 2021)</ref> generates features instead of raw data. (4). Parameter-isolation methods train and protect a sub-network for each task <ref type="bibr">(Mallya &amp; Lazebnik, 2017;</ref><ref type="bibr">Abati et al., 2020;</ref><ref type="bibr">von Oswald et al., 2020;</ref><ref type="bibr">Rajasegaran et al., 2020b;</ref><ref type="bibr">Hung et al., 2019;</ref><ref type="bibr">Henning et al., 2021)</ref>. Several systems, e.g., HAT <ref type="bibr">(Serr&#224; et al., 2018)</ref> and SupSup <ref type="bibr">(Wortsman et al., 2020)</ref>, have largely eliminated CF. A limitation is that the task-id of each test instance must be provided. These methods are thus mainly used for TIL. (5). Orthogonal projection methods learn each task in an orthogonal space to other tasks to reduce task interference or CF <ref type="bibr">(Zeng et al., 2019;</ref><ref type="bibr">Kim &amp; Liu, 2020;</ref><ref type="bibr">Chaudhry et al., 2020;</ref><ref type="bibr">Lin et al., 2022)</ref>.</p><p>Our empirical part of the work is related to but also very different from the above methods. We use the replay data as OOD training data to fine-tune an OOD detection head for each task based on the features learned for the WP head and uses the TIL method HAT to overcome CF. Some existing methods have used a TIL method for CIL with an additional task-id prediction technique. iTAML <ref type="bibr">(Rajasegaran et al., 2020b)</ref>'s task-id prediction needs the test data come in batches and each batch must be from the same task, which is unrealistic as the test sample usually comes one after another. CCG <ref type="bibr">(Abati et al., 2020)</ref>, Expert Gate <ref type="bibr">(Aljundi et al., 2017</ref><ref type="bibr">), HyperNet (von Oswald et al., 2020)</ref> and PR-Ent <ref type="bibr">(Henning et al., 2021)</ref> either build a separate network or use entropy to predict the task-id. LMC <ref type="bibr">(Ostapenko et al., 2021)</ref> learns task specific knowledge via local modules capable of task-id prediction. However, they all perform poorly because none of the systems deal with the ICS problem, which is the key and is what our OOD detection is trying to tackle. In this line of work, the most closely related work to ours is MORE <ref type="bibr">(Kim et al., 2022a)</ref>, which builds a model for each task treating the replay data as OOD data. However, in inference, it considers only the IND classes of each task, but not OOD detector. Our method is more principled and outperforms MORE. The methods in <ref type="bibr">(Kim et al., 2022b)</ref> do not use replay data and perform worse.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.">Learnability of CIL</head><p>Before going to the learnability analysis, we first describe the intuition behind. <ref type="bibr">Kim et al. (2022b)</ref> showed that given a test sample, the CIL prediction probability for each class in a task is the product of two prediction probabilities: withintask prediction (WP) and task-id prediction (TP),</p><p>where X k,j is the domain of task k and class j of the task and x is an instance. The first probability on the right-handside (RHS) is WP and the second probability on the RHS is TP. However, as mentioned earlier, <ref type="bibr">Kim et al. (2022b)</ref> did not study whether CIL is learnable. We also note that <ref type="bibr">(Kim et al., 2022b)</ref> proved that TP and OOD are correlated and only differ by a constant factor. Based on the definition of OOD detection (Definition 1.3), the OOD detection model can also perform WP. In the recent work in <ref type="bibr">(Fang et al., 2022)</ref>, it is proven that OOD detection is learnable.</p><p>We show that if the learning of each task does not cause catastrophic forgetting (CF) for previous tasks, then CIL is learnable.<ref type="foot">foot_0</ref> Fortunately, CF can be prevented for each task as several existing task incremental learning (TIL) methods including but not limited to HAT <ref type="bibr">(Serr&#224; et al., 2018)</ref> and SupSup <ref type="bibr">(Wortsman et al., 2020)</ref> in the parameter-isolation family and PCP <ref type="bibr">(Kim &amp; Liu, 2020)</ref> and CUBER <ref type="bibr">(Lin et al., 2022)</ref> in the orthogonal projection family can ensure no CF <ref type="bibr">(Kim et al., 2022b)</ref>. HAT/SupSup basically trains a subnetwork as the model for each task. In learning each new task, all the sub-networks for the previous tasks are protected with masks so that their parameters will not be modified in backpropagation. Thus, in this section, we assume that all tasks are learned without catastrophic forgetting (CF).</p><p>We now discuss the learnability of class incremental learning (CIL). The notations for the following discussion are described in Tab. 1. Let X be a feature space, Y a label space, and H a hypothesis function space. Assume H is a ring, because we construct hypothesis functions by addition and multiplication in the proof of Theorem 3.3 and Theorem 3.7. We use</p><p>For a series of distributions D (X1,Y1) , . . . , D (X T ,Y T ) , we denote the mixture of the first k distributions as</p><p>, where the mixture weights &#960; 1 , . . . , &#960; T &gt; 0</p><p>Since continual learning tasks come one by one sequentially, we denote the hypothesis function that is found by an algorithm A after training the k-th task as</p><p>and is not well-defined for</p><p>Even if some implementation may predict a real value by h k (x &#8242; ), we regard it as non-sense at time k and only make sense until time k &#8242; .</p><p>For the risk function, we will meet</p><p>where z i,j k is the score function of the j-th class of the i-th task. The score function is any function that indicates which class the sample belongs to. For example, the score function could be the predicted logit of each class for a classification algorithm. We calculate</p><p>When we write R D &#945; (h) with D &#945; = (1-&#945;)D +&#945;O (where O denotes OOD and &#945; &#8712; [0, 1)), we require h to predict one additional OOD class as</p><p>where z o k is the score function of the OOD class. Definition 3.1 (Fully-Observable Separated-Task Closed-World Learnability). Given a set of distributions D, a hypothesis function space H, we say CIL is learnable if there exists an algorithm A and a sequence</p><p>We use &#1013; to represent the error rate, where the index n of &#1013; n represents the total number of samples. The equation lim n&#8594;+&#8734; &#1013; n = 0 means that the error rate decreases to 0 as n goes to +&#8734;. Definition 3.1, the risk function is calculated over D [1:k] at task k, which means the data of all the past tasks and the current task are observable for optimization. It is a desirable property for CIL to take expectation over D <ref type="bibr">[1:k]</ref> as it constructs a model that is equivalent to the model built with the full training data of all tasks. Generally, when an algorithm satisfies Definition 3.1, the system is already learnable because this is just the traditional supervised learning which can see/observe all the training data of all tasks and there is no OOD data involved (which means the closed-world). However, when we apply the algorithm A to solve for A(S) in practice, we usually cannot access all samples in S, which is partially-observable instead of fully-observable. That is the case for continual learning as it assumes that in learning the new/current task, the training data of the previous/past tasks is not accessible, at least a major part of it.</p><p>Due to the lack of full observations, we have to define A r k recursively. For any</p><p>The algorithm depends on implementation. In the following discussion, we assume that learning a new task does not interrupt the error bound of previous tasks. This is a valid assumption as existing algorithms <ref type="bibr">(Serr&#224; et al., 2018;</ref><ref type="bibr">Wortsman et al., 2020)</ref> achieve little or no forgetting. The version of Definition 3.1 for partial observations is as follows.</p><p>Definition 3.2 (Partially-Observable Separated-Task Closed-World Learnability). Given a set of distributions D, a hypothesis function space H, we say CIL is learnable if there exists an algorithm A and a sequence</p><p>In </p><p>The proof of Definition 3.4 is guaranteed by previous work <ref type="bibr">(Fang et al., 2022)</ref>, which studies the learnablity of OOD detection. It's obvious that when Definition 3.4 is satisfied, Definition 3.1 is satisfied, which is shown in Theorem 3.5. The proof is given in Appendix A. When we have no access to samples of past tasks in practice, we define A k recursively as in Eq. 2. The partial observable version of Definition 3.4 is stated below. In Definition 3.6, the risk function is over D k instead of D [1:k] because it's the partial observable case. Definition 3.6 (Partially-Observable Separated-Task Open-World Learnability). Given a set of distributions D, a hypothesis function space H, we say CIL is learnable if there exists an algorithm A and a sequence</p><p>where</p><p>Note that <ref type="bibr">Fang et al. (2022)</ref>  </p><p>The proof is given in Appendix A. Theorem 3.7 connects Definitions 3.6 to 3.4 and Theorem 3.5 connects Definitions 3.4 to 3.1, which is the desirable property of CIL. When all tasks have the same weight</p><p>&#960; [1:k] = T , which is positively correlated with the number of tasks.</p><p>Though Theorem 3.7 gives an upper bound to induce Definition 3.4 from Definition 3.6, the hypothesis function that satisfies Definition 3.4 is recursively derived from the previous tasks (see the proof). We can also observe that when tasks have different weights, the multiplier max k=1,...,T k t=1 &#960; [t:T ] &#960; [1:k] depends on the order of tasks. It is undesirable that the hypothesis function depends on the order of tasks. When we can acquire some replay data of past tasks and treat them as OOD data, we have the following corollary that gives an order-free hypothesis function. (h) = 0, and the loss function on all tasks is bounded by summation of the loss functions on every task i.e. Eq. 10 in Appendix, if we treat data of past tasks as OOD data, then Definition 3.4 holds and the upper bound &#1013; n is multiplied by max k=1,...,T k&#960;</p><p>The proof is given in Appendix A.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.">Proposed Method</head><p>The learnability in Definition 3.6 is defined over the OOD function of each task. By Definition 1.3 of OOD, an OOD function is capable of classification (i.e., WP) for IND in-stances and rejection for OOD instances (or TP as it can be defined using OOD and such TP differs from OOD by a constant factor <ref type="bibr">(Kim et al., 2022b)</ref>). As discussed early, we use the masks in HAT <ref type="bibr">(Serr&#224; et al., 2018)</ref> to protect each OOD model to ensure there is no forgetting. Following exactly this theoretical framework, an algorithm can be designed, which works quite well (see ROW (-WP) in Tab. 4). However, it is possible to do better by introducing a WP head so that we can use the OOD head for estimating only TP rather than for handling both WP and TP.</p><p>The proposed method ROW is a replay-based method. At each task k, the system receives dataset D k and leverages the replay data saved from previous tasks in the replay memory buffer M as the OOD data of the task to train an OOD detection head and also to fine-tune the WP head. Specifically, the model of each task has two heads: one for OOD (for computing TP) and one for WP. That is, we optimize the set of parameters (&#936; k , &#952; k , &#981; k ), where &#936; k is the parameter set of the feature extractor f k , &#952; k is the parameter set of OOD head h k , and &#981; k is the parameter set of the WP head (i.e., classifier) g k . The two task specific heads h k and g k receive feature u from the shared feature extractor f k and produce WP and TP probabilities, respectively. The training consists of three steps: 1) training the feature extractor f k and the OOD head h k using both IND instances in D k and OOD instances in M (i.e., the replay data), 2) fine-tuning a WP head g k for the task using D k based on only the fixed feature extractor f k , and 3) fine-tuning the OOD heads of all tasks that have been learned so far. Training steps 2 and 3 are fast as both are simply fine-tuning the single layer of the classifiers (details below). The outputs from the two heads are used to compute the final CIL prediction probability in Eq. 1. An overview of the training and prediction process is illustrated in Fig. <ref type="figure">1</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>1)</head><p>Training Feature Extractor and OOD Head. This step trains the OOD head h k for task k. Its feature extractor f k is also shared by the WP head (see below). An illustration of the training process is given in Fig. <ref type="figure">1(a)</ref>. Since OOD instances are any instances whose labels do not belong to task k, we leverage the task data D k as IND instances and the saved replay instances of tasks k &#8242; &#824; = k in the memory buffer M as OOD instances represented by an OOD class (in red) in the OOD head. The network h k &#8226;f k is trained to maximize the probability p(y|x, k) = softmaxh k (f (x, k; &#936; k ); &#952; k ) y for an IND instance x &#8712; D k and maximize the probability p(ood|x, k) for OOD instance x &#8712; M. Formally, this is achieved by minimizing the sum of cross-entropy losses</p><p>where N is the number of instances in D k . We utilize upsampling with the replay instances to achieve an equal number of samples as the current task data D k . The first loss is to discriminate the IND instances while the second loss is introduced to distinguish between IND and OOD instances.</p><p>To deal with forgetting, we use the HAT method <ref type="bibr">(Serr&#224; et al., 2018)</ref> (see Appendix B).</p><p>2) Fine-Tuning the WP Head. Given the feature extractor trained in the first step, we fix the feature extractor and fine-tune the WP head g k (i.e., the WP classifier) using only D k by adjusting the parameters &#981; k . This is achieved by minimizing the cross-entropy loss</p><p>WP probabilities for the classes of task k are just the output softmax probabilities.</p><p>3) Fine-Tuning the OOD Heads of All Tasks. The OOD head h k built in step 1) is biased because for early tasks, where the instances in M are less diverse, the OOD heads for them will be weaker than the OOD heads of later tasks when the instances in M are more diverse. To mitigate this bias, we fine-tune all OOD heads of all tasks after training each task using only the replay data in M. After training task k, we have M with replay instances of classes from task 1 to k. For each task k &#8242; &#8804; k, reconstruct a new IND data Dk &#8242; by selecting instances corresponding to task k &#8242; from M, and a new pseudo memory buffer M after removing the instances in Dk &#8242; . We then fine-tune every OOD head by minimizing the loss function</p><p>where</p><p>Although the TP probability can be defined simply using the fine-tuned OOD heads, it can be further improved, which we discuss next.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.1.">Distance-Based Coefficient</head><p>We can further improve the performance by incorporating a distance-based coefficient defined at the feature level into the output from the OOD head. The intuition is based on the observation that samples identified as OOD using a score function defined at the feature level are not recognized with a score function defined in the output level, and vice versa <ref type="bibr">(Wang et al., 2022a)</ref>. Their combination usually produces a better OOD detector.</p><p>After training task k, compute the means of the feature vectors per class of the task and the variance of the features. Denote the mean of class y by &#181; y and the variance by &#931; k = y &#931; y , where &#931; y is the variance of features of class y. Using Mahalanobis distance (MD), the coefficient of an instance x for task k is</p><p>The coefficient is large if the feature of a test instance x is close to one of the sample means of the task and small otherwise.</p><p>We finally define the TP probability for task k as</p><p>where Z is the normalizing factor and the maximum is taken over the softmax outputs of the IND classes j obtained by the OOD head h k . The max j operation can also be seen as the maximum softmax probability score <ref type="bibr">(Hendrycks &amp; Gimpel, 2016)</ref>.</p><p>With the WP and TP probabilities, we now make a CIL prediction based on Eq. 1.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.">Empirical Evaluation</head><p>Baselines. We compare the proposed ROW<ref type="foot">foot_1</ref> with 12 baselines. Five are exemplar-free (i.e., saving no previous data) methods and seven are replay-based methods. The exemplarfree methods are: HAT <ref type="bibr">(Serr&#224; et al., 2018)</ref>, OWM (Zeng</p><p>We could not make the recent system in <ref type="bibr">(Wu et al., 2022)</ref> using a pre-trained model as no code is released. We also do not include the existing parameter isolation methods that deal with CIL problems as they are very weak. <ref type="bibr">Hy-perNet (von Oswald et al., 2020)</ref> and PR <ref type="bibr">(Henning et al., 2021)</ref> find the task-id via an entropy function and Sup-Sup <ref type="bibr">(Wortsman et al., 2020)</ref> finds it via gradient update. They then make a within-task prediction. SupSup, PR, and iTAML <ref type="bibr">(Rajasegaran et al., 2020b)</ref> assume the test instances come in batches and all samples in a batch belong to one task. When tested per sample, HyperNet, SupSup, PR and iTAML achieve 22.4, 11.8, 45.2 and 33.5 on 10 tasks of CIFAR100, respectively, which are much lower than 51.4 of iCaRL. CCG <ref type="bibr">(Abati et al., 2020)</ref> has no code. The systems in <ref type="bibr">(Kim et al., 2022b)</ref> are also not included because they are quite weak as their contrastive learning does not work well with a pre-trained model. The results reported in their paper based on ResNet-18 are also weaker than ROW.</p><p>Datasets. We use three popular continual learning benchmark datasets. 1). CIFAR10 <ref type="bibr">(Krizhevsky &amp; Hinton, 2009)</ref>. This is an image classification dataset consisting of 60,000 color images of size 32x32, among which 50,000 are training data and 10,000 are testing data. It has 10 different classes. 2). CIFAR100 <ref type="bibr">(Krizhevsky &amp; Hinton, 2009)</ref>. This dataset consists of 50,000 training images and 10,000 testing images with 100 classes. Each image is colored and of size 32x32. 3). Tiny-ImageNet <ref type="bibr">(Le &amp; Yang, 2015)</ref>. This dataset has 200 classes with 500 training images of size 64x64 per class. The validation data has 50 samples per class. Since no label is provided for the test data, we use the validation set for testing as in <ref type="bibr">(Zhu et al., 2021)</ref>.</p><p>Backbone Architecture and Pre-Training. We use the backbone architecture of transformer DeiT-S/16 <ref type="bibr">(Touvron et al., 2021)</ref>. As pre-training models or feature extractors are increasingly used in all types of applications, including continual learning <ref type="bibr">(Wang et al., 2022c;</ref><ref type="bibr">Kim et al., 2022a;</ref><ref type="bibr">Wu et al., 2022)</ref>, we also take this approach. Following <ref type="bibr">(Kim et al., 2022a)</ref>, to ensure there is no information leak from pretraining to continual learning, the pre-trained model/network is trained using 611 classes of ImageNet after removing 389 classes which are similar or identical to the classes of CIFAR and Tiny-ImageNet. To leverage the strong performance of the pre-trained model while adapting to new knowledge, we fix the feature extractor and append trainable adapter modules of fully-connected networks with one hidden layer at each transformer layer <ref type="bibr">(Houlsby et al., 2019)</ref> except SLDA and L2P. <ref type="foot">3</ref> The number of neurons in each hidden layer is 64 for CIFAR10 and 128 for other datasets. Note that all baselines and ROW use the same architecture and the same pre-training model for fairness as using a pre-trained model improves the performance <ref type="bibr">(Kim et al., 2022a;</ref><ref type="bibr">Ostapenko et al., 2022)</ref>.</p><p>Note that we do not use the pre-trained models like CLIP <ref type="bibr">(Radford et al., 2021)</ref> or others trained using the full ImageNet data due to information leak both in terms of features and class labels because our experiment data have been used in training these pre-trained models. This leakage can seriously affect the results. For example, the L2P system using the pre-training model trained using the full ImageNet data performs extremely well, but after those overlapping classes are removed in pre-training, its performances drop greatly. In Tab. 2, we can see that it is in fact quite weak.</p><p>Training Details. For the replay-based methods, we follow the budget sizes of <ref type="bibr">(Rebuffi et al., 2017;</ref><ref type="bibr">Buzzega et al., 2020)</ref>. For our method, we use the memory budget strategy <ref type="bibr">(Chaudhry et al., 2019b)</ref> to save equal number of samples per class. Denote the budget size by |M|.</p><p>For CIFAR10, we split the 10 classes into 5 tasks with 2 classes per task. We refer the experiment as C10-5T. The memory budget size |M| is 200.</p><p>For CIFAR100, we conduct two experiments. We split the 100 classes into 10 and 20 tasks, where each task has 10 classes and 5 classes, respectively. We refer the experiments as C100-10T and C100-20T. We choose |M| = 2,000.</p><p>For Tiny-ImageNet, we conduct two experiments. We split the 200 classes into 5 tasks with 40 classes per task and 10 tasks with 20 classes per task. We refer the experiments as T-5T and T-10T, respectively. We save 2,000 samples in total for both experiments.</p><p>Following the random class order protocol of the existing methods <ref type="bibr">(Rebuffi et al., 2017;</ref><ref type="bibr">Lee et al., 2019)</ref>, we randomly generate 5 different class orders for each experiment and report the average accuracy over the 5 random orders.</p><p>For all the experiments of our system, we find a good set of learning rates and the number of epochs via validation data made of 10% of the training data. The hyper-parameters of our system is reported in Appendix C. For the baselines, we use the experiment setups as reported in their official papers. If we could not reproduce the result, we find the hyper-parameters via the validation set.  <ref type="bibr">Liu et al., 2020b)</ref>. This is also referred as backward transfer in other literature (Lopez-Paz &amp; Ranzato, 2017).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.1.">Results and Comparison</head><p>Average Classification Accuracy. Tab. 2 shows the average classification accuracy after the final task. The last column Average indicates the average performance of each method over the 5 experiments. Our proposed method ROW performs the best consistently. On average, ROW achieves 73.72% while the best replay baseline (MORE) achieves 71.59%. We observe that MORE is significantly better than the other baselines. This is because MORE actually builds an OOD model for each task, which is close to the proposed theory but less principled than ROW.</p><p>The baselines SLDA and L2P are proposed to leverage a strong pre-trained feature extractor in the original papers. SLDA freezes the feature extractor and only fine-tunes the classifier. It performs well for the simple experiment C10-5T, but is significantly poorer than ROW on all experiments. This is because the fixed feature extractor does not adapt to new knowledge. Our method updates the feature extractor via adapter modules to new knowledge and it is able to learn more complex problems. L2P trains a set of prompt embeddings. In the original paper, it uses a feature extractor that was pre-trained with ImageNet-21k which already includes the classes of the continual learning (CL) evaluation datasets (information leak). After we remove the classes similar to the datasets used in CL, its performance drops dramatically (60.47% on average over the 5 experiments) and much poorer than our ROW (73.72% on average).</p><p>We conduct additional experiments with the size of mem- ory buffer reduced by half to show the effectiveness of our method. The new memory buffer sizes for CIFAR10, CI-FAR100, and Tiny-ImageNet are 100, 1,000, and 1,000, respectively. Tab. 3 shows that our method ROW experiences little reduction in performance whereas the other replaybased baselines suffer from significant performance reduction. On average over the 5 experiments, ROW achieves 72.70% while previously with the original memory buffer, it achieved 73.72. In contrast, the second best baseline DER++ reduces from 66.89 to 62.16. MORE is also robust with small memory sizes, but its average accuracy is 71.44 which is still lower than ROW.</p><p>Average Forgetting Rate. We compare the forgetting rate of each system after learning the last task in Fig. <ref type="figure">2</ref>. The forgetting rates of the proposed method ROW are 7.05, 7.99, and 9.72 on C10-5T, C100-10T and C100-20T, respectively. iCaRL forgets less than ours on C10-5T and C100-20T as it achieves 4.95 and 8.31, respectively. However, iCaRL was not able to adapt to new knowledge effectively as its accuracies are much lower than ROW on the same experiments. The forgetting rate of SLDA on C10-5T 5.74, but a similar observation can be made as iCaRL. The average accuracy over the 5 experiments of ROW is 73.72 while that of iCaRL and SLDA are only 66.12 and 68.02, respectively. According to the forgetting rates, the best baseline (MORE) adapts to the new knowledge well, but it was not able to retain the knowledge as effectively as ROW. Its forgetting rates are 10.30, 22.96, and 22.90 on C10-5T, C100-10T, and C100-20T, respectively, and are much larger than ours. This results in lower performance of MORE than ROW.</p><p>It is important to note that our system actually has no forgetting due to the CF prevention by HAT. The 'forgetting' occurs not because it forgets the task knowledge, but because the classification becomes harder with more classes.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.2.">Ablation Experiments</head><p>We conduct an ablation study to measure the performance after each component is removed from ROW. We consider removing two components: WP head and the distance-based Tab. 4 shows the average classification accuracy. The model after removing WP also works greatly as it already outperforms most of the baselines on C10-5T and outperforms the baselines on C100-10T and 20T. In other words, using OOD head constructed following the theoretical framework is effective. The model is still functional after removing both components (WP and the distance-based coefficient by MD) as shown in the last row of the table (ROW (-WP-MD)).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.">Conclusion</head><p>To the best of our knowledge, there is still no reported study of learnability of class incremental learning (CIL). This paper performed such a study and showed that the CIL is learnable with some practically reasonable assumptions. A new CIL algorithm (called ROW) was also proposed based on the theory. Experimental results demonstrated that ROW outperforms strong baselines.</p><p>Proof of Theorem 3.7. Denote the algorithm that satisfies Definition 3.6 as A r k . Given any &#1013; n and S &#8764; D [1:k] , denote h k = A r k (S). Based on h k , we construct a hk that satisfies Definition 3.4.</p><p>For simplicity, we denote &#960; [k:k &#8242; ] = k &#8242; i=k &#960; i . For any O (X1,Y1) , . . . , O (X T ,Y T ) &#8712; D and any &#945; 1 , . . . , &#945; T &#8712; [0, 1), let</p><p>and plugging &#945; &#8242; k and O &#8242; (X k ,Y k ) into Definition 3.6, we have</p><p>Denote h k = arg max{. . . , z j k , . . . ; z o k }, where z j k is the score function of the j-th class of the k-th task, and z o k is the score function of the OOD class of the k-th task. Denote the label of the j-th class of the i-th task as y i,j . Denote the label of OOD class of the i-th task as y i,o . We define</p><p>By definition of hk , when hk makes a wrong prediction, there exists a h i &#8242; , i &#8242; &#8804; k that makes a mistake. We assume that the loss function satisfies the following inequality</p><p>l(h t (x), y t,o ) + l(h i (x), y i,j ),</p><p>Then we can decompose the risk function of hk ,</p><p>With the fact that for any density function p(x) defined on A and any B &#8834; A,</p><p>Plugging the above three equations into Eq. 9, we have</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>By assumption that inf</head><p>Therefore, we have max k=1,...,T</p><p>Proof of Corollary 3.8. Denote the algorithm that satisfies Definition 3.6 as A r k . Given any &#1013; n and S &#8764; D [1:k] , denote h k = A r k (S). Based on h k , we construct a hk that satisfies Definition 3.4.</p><p>For simplicity, we denote &#960;</p><p>i=k &#960; i . Different from proof of Theorem 3.7, when we can acquire replay data and therefore treat them as OOD data, we let</p><p>Denote h k = arg max{. . . , z j k , . . . ; z o k }, where z j k is the score function of the j-th class of the k-th task, and z o k is the score function of the OOD class of the k-th task. Denote the label of the j-th class of the i-th task as y i,j . Denote the label of OOD class the the i-th task as y i,o . We define</p><p>But when hk makes a wrong prediction, there exists a h i &#8242; , i &#8242; &#8804; i that makes a mistake. We assume that the loss function satisfies the following inequality</p><p>All the same as the proof of Theorem 3.7, we have</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Hard Attention to the Task (HAT)</head><p>In training the network h k &#8226; f k using the data of task k and the generated pseudo feature vectors, we employ the hard attention mask <ref type="bibr">(Serr&#224; et al., 2018)</ref> to prevent forgetting in the feature extractor.</p><p>The hard attention mask a k l is a trainable pseudo binary 0-1 vector at each layer l of task k. It is element-wise multiplied to the output of the layer as a k l &#8855; h l and blocks (for value of 0) or unblocks (for value of 1) the information flow from neurons of adjacent layers. Neurons with value 1 are important for the task and thus need to be protected while neurons with value 0 are not necessary for the task and can be freely modifed without affecting other tasks.</p><p>More specifically, we modify the gradients of parameters that are important in performing the previous tasks (1, &#8226; &#8226; &#8226; , k -1) during training task k so the important parameters for previous tasks are unaffected. The gradient of parameter w ij,l at ith row and jth column of layer l is modified as &#8711;w &#8242; ij,l = 1 -min a &lt;k i,l , a &lt;k j,l-1</p><p>where a &lt;k i,l is an accumulated attentions over previous tasks and is 1 if the hard attention of neuron i at layer l is ever used by any previous task &lt; k (see <ref type="bibr">(Serr&#224; et al., 2018)</ref> for details).</p><p>To encourage parameter sharing and sparsity in the number of activated masks, a regularization is introduced as L r = l,i a k i,l (1 -a &lt;k i,l ) l,i (1 -a &lt;k i,l ). The final objective to train a comprehensive task network without forgetting is</p><p>where L ood is the cross-entropy loss in Eq. 3.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C. Hyper-Parameters</head><p>For all the experiments, we use SGD with momentum value of 0.9 with batch size of 64. For C10-5T, we use learning rate 0.005 and train for 20 epochs. For C100-10T and 20T, we train for 40 epochs with learning rate 0.001 and 0.005 for 10T and 20T, respectively. For T-5T and 10T, we use the same learning rate 0.005, but train for 15 and 10 epochs for 5T and 10T, respectively. For fine-tuning WP and OOD head, we use batch size of 32 and use the same learning rate used for training the feature extractor. For fine-tuning WP and TP, we train for 5 epochs and 10 epochs, respectively.</p><p>datasets. SLDA fine-tunes only the classifier on top of the fixed pre-trained feature extractor as it does not have a protection mechanism. L2P uses a prompt pool with 23k entries. Since each method requires method-specific elements (e.g., task embedding for HAT), the number of entries required for each method is different. The number of entries for each model is reported in Tab. 5.</p><p>Our system saves the covariance matrices for computing the distance-based coefficient in Sec. 4.1. The covariances are saved for each task. Since each covariance is in size 384x384, the total entries for this step are 737.3k, 1.5M, 2.9M, 737.3k, and 1.5M for C10-5T, C100-10T, C100-20T, T-5T, and T-10T, respectively. The numbers are relatively small considering that some of the replay-based methods (e.g., iCaRL, HAL) require a teacher model the same size as the training model for knowledge distillation. More importantly, replay buffer requires the largest memory (e.g., for Tiny-ImageNet, saving 2,000 images of size 64x64x3 requires 24.6M entries). It is highly important that the system is robust to replay buffer size. ROW is shown to remain strong with small replay buffer sizes (see Tab. 3).</p><p>Our system ROW saves an additional classifier. WP head is of the same shape as the classifier of the standard baselines (e.g., iCaRL or DER++). OOD (or TP) head requires the same memory as WP with additional parameters for OOD class per task. The required memory is small. For instance, for C10-5T, using OOD head only introduces 5,775 additional entries.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>E. Societal Impact and Limitation</head><p>We do not see any negative societal impact as we use public domain datasets for the experiments and our algorithm is just like any normal supervised learning in nature. In practical use, if the training data of the application is biased, it could affect the model just like in any other supervised learning. We believe that this can be alleviated by checking any potential bias in the training data.</p><p>The current theoretical study is only applicable to offline CIL. In future work, we will extend our study to online CIL, where the task boundary may be blurry.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>F. Effect on Underrepresented Minorities</head><p>The existence of underrepresented samples in the current task does not affect our theory, but it will affect an actual implementation and give weaker results. The OOD detection method in our paper simply trains the system by considering the samples of the current task as in-distribution and the samples in the replay buffer as OOD of the current task. In case there is a set of underrepresented classes in the current task's dataset, one can use existing techniques proposed for the sample imbalance problem to alleviate the issue. However, this problem is not just relevant to our proposed method, but relevant to all existing OOD and CL methods, or even supervised learning methods.</p></div><note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="1" xml:id="foot_0"><p>The current learnability result only applies to offline CIL, but not to online CL, where the task boundary may be blurry.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="2" xml:id="foot_1"><p>https://github.com/k-gyuhak/CLOOD et al., 2019), SLDA<ref type="bibr">(Hayes &amp; Kanan, 2020)</ref>, PASS<ref type="bibr">(Zhu et al., 2021)</ref>, and L2P(Wang et al., 2022c). For the multihead method HAT, we make prediction by taking arg max over the concatenated logits from each task model as(Kim  et al., 2022b). The replay methods are: iCaRL<ref type="bibr">(Rebuffi et al., 2017)</ref>, A-GEM(Chaudhry et al., 2019a), EEIL<ref type="bibr">(Castro et al., 2018)</ref>, GD<ref type="bibr">(Lee et al., 2019)</ref> without external data, DER++<ref type="bibr">(Buzzega et al., 2020)</ref>, HAL<ref type="bibr">(Chaudhry et al., 2021)</ref>, and MORE(Kim et al., 2022a).</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="3" xml:id="foot_2"><p>For SLDA and L2P, we follow the original papers. SLDA fine-tunes only the classifier with a fixed feature extractor and L2P trains learnable prompts.</p></note>
		</body>
		</text>
</TEI>
