Manuscript Offprint
arXiv:2610.39323Class-aware Latent Attention Replay (CLAR): Class Incremental Hazard Diagnosis for Resilient AI in the Manufacturing Industrial Internet
Abstract
Artificial Intelligence (AI) systems provide critical computation services in the Manufacturing Industrial Internet (MII), and their resilience depends on timely diagnosis of hazards across the data, AI pipeline, and cyber-physical layers. During operation, new hazard types keep emerging with only a few samples each, hazards co-occur, and the diagnosis model runs on memory-constrained computation nodes. Replay-based class-incremental learning (CIL) can learn new hazard classes while revisiting a small memory of past samples, but existing methods assume single-label, balanced streams, store high-dimensional raw samples, and select them independently of the classifier. We propose Class-aware Latent Attention Replay (CLAR), which combines a dual buffer that stores mostly compact latent representations with a few raw samples, an Attention Leverage Score (ALS) that upper-bounds the classifier logit and guides class-balanced reservoir sampling, and an exponential-moving-average teacher that slows latent-space drift. For an idealized buffer model, we prove that the buffer is class-balanced and follows an ALS-weighted class distribution, and that below a critical per-class capacity, ALS-guided replay has a lower replay-gradient error than class-balanced uniform replay. In the case study, On hazard diagnosis data from an MII testbed, CLAR achieves the highest mean average weighted F1 score among the evaluated replay methods with the same buffer size.
1 Introduction
The Manufacturing Industrial Internet (MII) connects manufacturing equipment, physical processes, systems, and networks through ubiquitous sensors, actuators, and computing units [1,2]. The data collected via the MII enable AI models that deliver computation services such as quality modeling, process variation analysis, and fault diagnosis [3]. In this context, an AI system consists of three interconnected layers [2,4]: (i) the data layer, i.e., the manufacturing data collected via the MII; (ii) the AI pipeline layer, where the data are processed by deployed AI pipelines, such as data augmentation, standardization, and deep neural network (DNN) classifiers [5]; and (iii) the
cyber-physical layer, i.e., the Fog-Cloud computing infrastructure that supports communication and computation. Each execution of an AI pipeline on a batch of data at a computation node constitutes a computation task, e.g., predicting the quality of the products produced by one machine.
Manufacturing decisions, such as accepting a printed part or adjusting a process setting, rely on the outputs of these computation tasks, so the AI system has to deliver reliable computation services continuously throughout production. Hazards in any of the three layers threaten this reliability. Sensor contamination and low signal-to-noise ratio corrupt the data layer, model singularity destabilizes the AI pipeline layer, and fog node or communication failures disrupt the cyber-physical layer [2]. The resulting performance degradation leads to incorrect quality predictions, faulty process decisions, and economic losses. AI resilience refers to the ability of the AI system to withstand, respond to, and recover from such hazards [2,6]. Recovery requires a mitigation action that matches the root cause, so accurate root-cause diagnosis is the prerequisite for resilience. Diagnosis can use information that the MII already collects after each computation task: the supervised learning performance of the deployed pipelines and the runtime metrics of the computation node, such as CPU utilization and memory consumption [2]. Hazard diagnosis therefore becomes a multimodal, multi-label classification problem over these two modalities.
Diagnosis models of this kind are trained offline on a fixed set of hazard types. In operation, the MII keeps changing: new machines, process settings, and software updates introduce hazard types that were absent from the training data, and known hazard types reappear later. A resilient AI system thus needs a diagnosis model that keeps learning from the stream of computation tasks, which raises five challenges. (i) New hazard classes emerge over time and previously seen classes recur, and retraining from scratch on all historical data is computationally prohibitive. (ii) Normal operation dominates the stream, so each hazard class has only a few samples. (iii) Several hazards can affect the same computation task, making the problem multi-label. (iv) The runtime metrics are high-dimensional multivariate time series, which, together with the tabular performance metrics, form multimodal samples. (v) The diagnosis model runs on resource-constrained computation nodes, which strictly limits its memory.
Class-Incremental Learning (CIL) addresses the first challenge by updating a model with new classes as they appear [7,8]. Its central difficulty is catastrophic forgetting: training on new classes overwrites the knowledge of earlier classes and degrades their accuracy [9]. Replay-based methods counter forgetting by storing a small memory of past samples and revisiting them while learning new classes [10,11]. Three limitations restrict their use for hazard diagnosis in the MII. First, most methods assume single-label streams with balanced and sufficient samples per class, while hazard data are multi-label, highly imbalanced, and scarce. Second, they store past samples in raw form; a raw sample in our case study contains about values, so a fixed memory budget holds only a few exemplars per hazard class. Third, they select samples to store by random, class-count, gradient, or class-mean criteria, which are independent of the class-specific parameters that the classifier uses to make its decisions.
To address these limitations, we propose Class-aware Latent Attention Replay (CLAR), a class-incremental hazard diagnosis framework for AI systems in the MII. The key idea of CLAR is to keep the memory of past hazards predominantly in the compact latent space of the diagnosis model and to let the class-specific attention parameters of the classifier decide which samples are worth remembering. The contributions of this work are as follows.
• We formulate class-incremental hazard diagnosis for AI systems in the MII as a multi-label, multimodal CIL problem over a sequential stream of tasks with recurring classes, severe class imbalance, and a strict memory budget.
• We propose a latent-dominant dual replay buffer that stores many compact latent representations and a few raw samples per hazard class, which multiplies the number of buffer slots per class within the same memory budget.
• We propose the Attention Leverage Score (ALS), an attention-induced Mahalanobis-type norm that upper-bounds the magnitude of the classifier logit, and use it to tilt class-balanced reservoir sampling toward samples that strongly drive the classifier under imbalanced, multi-label streams.
• We show that ALS-guided sampling keeps a class-balanced buffer whose content follows an ALS-weighted class distribution, decompose its replay-gradient error into sampling variance and selection bias, and characterize, for an idealized model, the per-class capacities below which it has a lower replay-gradient error and a smaller upper bound on the expected squared margin deviation than class-balanced uniform replay.
- We evaluate CLAR on hazard data from an MII testbed, where it achieves the highest mean average weighted F1 score among the evaluated methods with a smaller configured buffer.
The remainder of this paper is organized as follows. Section 2 reviews CIL, replay-based CIL, and few-shot CIL. Section 3 formulates the problem and presents CLAR. Section 4 analyzes ALS-guided sampling theoretically. Section 5 reports the case study, and Section 6 concludes the paper.
2.1 Class-Incremental Learning
Continual learning trains a model on a sequence of tasks, where each task provides a new set of training data and the data of earlier tasks become unavailable [7]. CIL is the setting of continual learning in which new tasks introduce new classes and the model has to classify a test sample among all classes seen so far, without being told which task the sample comes from [8,12]. This setting is the most challenging one, because the model has to separate classes that were never trained together, in addition to learning each task. It matches applications where new categories emerge during deployment, such as new defect types in visual inspection or new fault types in machinery diagnosis [13].
Two related phenomena make CIL difficult. Catastrophic forgetting occurs when gradient updates for new classes change the parameters that encode earlier classes, so the accuracy on earlier classes drops sharply [9]. Avoiding it requires stability, whereas learning new classes requires plasticity, and the trade-off between the two is known as the stability-plasticity dilemma [14]. At the output layer, forgetting appears as task-recency bias: since the training data of each task are dominated by the newest classes, the classifier assigns higher scores to recent classes and misclassifies samples of earlier classes as recent ones [15, 16]. Practical streams add further difficulties. In online CIL, each sample is observed once in a single pass [17]. In blurry CIL, classes recur across tasks [18]; in manufacturing, for example, a sensor fault can reappear after maintenance or when a process setting is reused. In multi-label CIL, samples carry several labels and the label distribution is long-tailed [19].
CIL methods fall into three families [7]. Architecture-based methods expand the network for each new task and freeze or isolate the parameters of earlier tasks [20,21]. Since the parameters that encode earlier classes are left untouched by later updates, forgetting is avoided by construction. The model size, however, grows with the number of tasks, which becomes prohibitive on memory-constrained computation nodes. Regularization-based methods add a penalty to the training loss that discourages changes to the knowledge of earlier tasks. The penalty can act on parameters, e.g., a squared distance between the current and previous parameters weighted by their estimated importance for earlier tasks [22,23], or on outputs, e.g., a distillation loss between the predictions of

Figure 1: Overview of the incremental diagnosis model, MII testbed, and the CLAR framework.
the current model and of a frozen copy, acting as a teacher, on the new data [24,25]. Parameter penalties accumulate over tasks and progressively restrict the capacity to learn new classes, and output penalties are only as informative as the new data are about earlier classes, so their effect weakens under large distribution shifts between tasks. Both variants train on new-class data alone, which leaves task-recency bias unaddressed [8,15]. Replay-based methods, the third family, address this gap by revisiting samples of earlier classes; as they are the basis of this work, we review them separately.
2.2 Replay-Based Class-Incremental Learning
Replay-based methods maintain a memory buffer, a fixed-capacity store of past samples. When the model learns a new task, samples drawn from the buffer are trained together with the new data, so the training objective approximates the objective over all classes seen so far and the classifier keeps observing earlier classes [10,11]. The design of a replay method answers two questions: which samples to store (memory update) and which stored samples to replay (memory retrieval) [17].
For memory update, Experience Replay (ER) [10] uses reservoir sampling [26], which keeps a uniform random subset of the stream by admitting the -th sample with probability proportional to . Under an imbalanced stream, a uniform subset inherits the imbalance and minority classes nearly vanish from the buffer. Class-Balancing Reservoir Sampling (CBRS) [27] therefore applies reservoir sampling within each class and reserves equal space for every class, and partitioning reservoir sampling extends this idea to
multi-label streams [19]. These strategies choose samples at random within a class. Informativeness-driven strategies select samples by gradient diversity [28], by diversity and uncertainty [18], or by proximity to the class mean in the feature space, as in the herding selection [29] of iCaRL [11]. Feature-space criteria become unreliable as the feature extractor is fine-tuned on new classes, since the embedding of stored samples drifts. For memory retrieval, Maximally Interfered Retrieval (MIR) [30] replays the stored samples whose loss would increase most under the upcoming update, and ASER [31] ranks stored samples by adversarial Shapley values.
Most replay methods store raw inputs. Latent replay stores intermediate representations of a network, which are much smaller and therefore fit more exemplars into the same memory [32,33]. To keep the stored representations valid, these methods freeze or slowly update the layers below the replay layer, which limits the adaptation of the feature extractor to new classes. In summary, existing replay methods select samples independently of the class-specific parameters of the classifier, mostly assume single-label streams, and trade memory efficiency against feature adaptation.
2.3 Few-Shot Class-Incremental Learning
When new classes arrive with only a handful of labeled samples, CIL becomes Few-Shot Class-Incremental Learning (FS-CIL) [34]. Industrial faults are a typical example, since hazards and defects occur rarely compared with normal operation. Prototype-based approaches compute a center, or prototype, for each class from its few sam-ples and classify new samples by their distance to the prototypes [35, 36]. Feature-space-based approaches reserve room in the embedding space for future classes with virtual prototypes [37], which provides forward compatibility, i.e., new class prototypes can be added with little disturbance to the existing representations. For industrial fault diagnosis, Forward-Back Compatible Representation (FBCR) [13] combines such feature-space reservation with replay. All these approaches depend on a stable feature extractor: once the representation space drifts during incremental updates, the prototypes and reserved regions become outdated and the diagnosis accuracy degrades.
3 Methodology
This section formalizes class-incremental hazard diagnosis for an AI system in the MII (Section 3.1), states the key idea of CLAR (Section 3.2), describes the diagnosis model that CLAR updates over time (Section 3.3), and presents the components of CLAR and its training procedure (Sections 3.4–3.7).
3.1 Problem Setting
Samples and labels. For the AI system defined in Section 1, each completed computation task yields one diagnosis sample with two modalities [2]. The supervised learning performance of the deployed pipelines on the processed batch, such as accuracy, precision, and F1 score, is reported to the Cloud as a tabular vector . The runtime metrics recorded by the computation node during execution, such as CPU utilization, memory consumption, and data transmission volume, form a multivariate time series with time stamps, runtime metrics, and channels. The raw sample with index in task is
These modalities are complementary: hazards in the data and AI pipeline layers mainly alter the supervised learning performance, whereas resource-related hazards mainly alter the runtime behavior. Each hazard class corresponds to one root cause factor of AI system failure [2], such as sensor contamination or pipeline singularity. Since hazards can co-occur, the label of is a binary vector , where indicates the presence of hazard class and indicates normal operation.
Tasks and incremental classes. The samples arrive as a sequential data stream , where each task collects the samples of one operational phase, is the base task, and with is an incremental task. Let for some be the hazard classes present in task , the classes seen up to task , and the new classes introduced by task . A task can introduce zero or more new classes, and classes can recur, so in general for .
Each task is partitioned into disjoint training and test sets, with . While learning task , the model can access and a memory of fixed capacity, and the training data of earlier tasks are unavailable. The objective is that the model obtained after task diagnoses all classes in accurately on the cumulative test set . The model must therefore acquire the classes in (plasticity) while retaining the classes in (stability).
Assumptions. Following the challenges in Section 1, we assume that (i) the stream is heavily imbalanced toward normal operation, with only a few samples per hazard class; (ii) samples are high-dimensional and multimodal; (iii) hazards may co-occur, i.e., the problem is multi-label; (iv) tasks can introduce zero or more new classes and earlier classes can recur; and (v) the memory available for storing past samples is strictly limited.
3.2 Overview of CLAR
CLAR is a replay-based class-incremental framework. Its key idea is to keep the memory of past hazards predominantly in the compact latent space of the diagnosis model, and to let the class-specific geometry learned by the classifier decide which samples are worth remembering. Three components realize this idea, each addressing the assumptions in Section 3.1, as shown in Fig. 2: (i) a latent-dominant dual replay buffer (Section 3.4) stores many compact latent representations and a few raw samples, which addresses the memory budget for high-dimensional samples (assumptions (ii) and (v)); (ii) an ALS-guided class-balanced sampling strategy (Section 3.5) keeps the buffer balanced across hazard classes under an imbalanced, multi-label stream with recurring classes, and favors samples with a high ALS, i.e., samples that strongly drive the classifier response (assumptions (i), (iii), and (iv)); Section 4 analyzes when this selection improves replay; (iii) a teacher-anchored latent space (Section 3.6) constrains the encoders through distillation from a slowly updated teacher, which encourages stored latent representations to stay compatible with the evolving model.
The three components depend on each other. The latent buffer stays useful only while the latent space remains close to the space in which its representations were stored, which is the role of the teacher, and the sampling strategy reads the parameters of the classifier, so the quality of memory selection improves as the classifier learns. The diagnosis model itself follows the generic architecture of modality-specific encoders and class-specific attention used for root cause diagnosis in [2]. CLAR applies to any encoder–classifier model with class-wise parameters.
3.3 Incremental Hazard Diagnosis Model
The incremental hazard diagnosis model has two stages: a multimodal feature extractor, which maps a raw sample to a low-dimensional latent representation, and an attention-based classifier, which maps the latent representation

Figure 2: Overview of CLAR. After each computation task, the AI system in the MII yields the supervised learning performance and the runtime metrics . The diagnosis model encodes both modalities into a latent representation and scores each hazard class with class-specific attention parameters (). The CLAR components (shaded) are the dual replay buffer, the ALS-guided class-balanced sampling, which uses () to admit samples, and the EMA teacher, which anchors the latent space through . Dashed arrows denote replay.
to hazard class scores. This design follows the common strategy in multimodal learning of encoding each modality with a modality-specific encoder and fusing the results in a shared latent space [2,38,39].
Multimodal feature extractor. Encoding into a low-dimensional space serves two purposes. First, a raw sample is high-dimensional, and a classifier trained directly on raw samples from a few hazardous samples per class overfits easily. Second, compact representations are cheap to store, which enables the latent buffer of Section 3.4. Modality-specific encoders map each modality to a latent representation,
which are concatenated into the latent representation of dimension ,
Any modality-specific encoder can be used. Following [2], we use variational autoencoders (VAEs) [40]: an LSTM-based VAE for the time-series modality, whose step-wise outputs are aggregated over time, and a standard VAE for the tabular modality. For modality , the encoder outputs a Gaussian approximate posterior with parameters , whose mean is used as ; the decoders are used only for training (Section 3.6).
Attention-based classifier. For each seen class , the classifier holds a trainable attention vector , which weights the latent dimensions relevant to class , and a trainable attention matrix , which
models the interactions between them. The logit of class is
where is the diagonal matrix formed by , and the predicted probability of class is with the sigmoid function . Each class is scored with its own parameters, which suits the multi-label setting and mirrors the root-cause-specific attention heads of [2]; a new class is accommodated by adding a pair when it first appears. We refer to as the learned attention geometry, since it determines how the classifier responds to each region of the latent space; CLAR reuses it to select samples for the buffer (Section 3.5).
3.4 Latent-Dominant Dual Replay Buffer
In replay-based CIL, a memory buffer is a fixed-capacity store of past training samples that are trained together with the data of each new task (Section 2). Under a strict memory budget, storing raw samples alone leaves very few exemplars per hazard class: in our case study, one raw sample is about 260 times larger than the 150 latent representations of the latent buffer combined. Storing latent representations alone is insufficient as well, because the encoders keep being updated and need raw inputs of earlier classes to preserve their representation.
CLAR therefore maintains a dual replay buffer with two complementary roles. The latent buffer stores many latent representations and gives the classifier broad coverage of each earlier class at low cost. The raw buffer stores a few raw samples , which are re-encoded by the current encoders during training and keep the encoders exposed to earlier classes. To keep the buffer class-balanced, both and are partitioned by hazard class into and , with per-class quotas and , where denotes the capacity. The quotas are recomputed whenever new classes appear; the floor can leave up to slots of each buffer unused, and positive quotas require to stay below the capacity. We call the buffer latent-dominant because latent representations make up most of its slots; in bytes, the few raw samples still dominate. Only hazardous samples are stored, since normal samples are abundant in every task, and a multi-label sample can belong to several partitions at the same time.
3.5 ALS-Guided Class-Balanced Sampling
The sampling strategy, referred to as ALS-CBRS, decides which samples enter each partition of the buffer. While a partition is below its quota, every new sample of that class is inserted. Once the partition is full, a new sample of class replaces a randomly chosen stored sample with probability
where is the quota of the corresponding buffer and is the cumulative number of class- samples observed so far.
The reservoir factor is the admission probability of reservoir sampling [26] applied within each class, as in CBRS [27]. With , it keeps each partition a uniform random sample of the class- samples observed so far. The second factor scales this probability by the response of the classifier to the sample, measured by the Attention Leverage Score
where , and makes positive definite. The term keeps the latent dimensions that class attends to, and weights them by the interactions learned in , so the ALS is a Mahalanobis-type norm in the metric induced by the attention geometry of class .
The ALS is directly tied to the classifier. Rewriting Eq. (3.5) as and applying the Cauchy-Schwarz inequality gives
where the second inequality holds because . The bound holds for every sample, every class, and every , with near-equality when is aligned with and is small. For a given sample norm, a large logit magnitude for class thus requires a large ALS, so the ALS measures
Algorithm 1 ALS-CBRS buffer update after task
Require: , , , ,
1: if then
2: ; recompute
3: Evict random items from partitions over their quota
4: end if
5: for all hazardous do
6:
7: for all with do
8:
9: for all do
10: if , else
11: Draw
12: if then
13: Insert into
14: else if then
15: Replace a random item of with
16: end if
17: end for
18: end for
19: end for
how strongly a sample can drive the class- output in the classifier's own geometry.
Finally, the scaled and shifted sigmoid maps the non-negative ALS to . The standard sigmoid maps non-negative inputs to , whereas lets weakly responding samples have an admission probability close to zero. The two factors play distinct roles. The per-class quotas keep the buffer balanced across hazard classes for any admission factor (Proposition 1), and the ALS factor tilts the content of each partition toward samples with a high ALS. Section 4 characterizes the resulting buffer and derives when this tilt improves replay over class-balanced uniform replay. It is applied to and with their respective quotas at the end of each task, using the updated encoders and classifier (Algorithm 1).
3.6 Teacher-Anchored Training Objective
When the encoders are updated on new hazard classes, the latent space shifts. This representation drift has two consequences: the classifier loses the representation of earlier classes, and the latent representations in , which were produced by earlier encoders, drift away from the representations that the current encoders produce. CLAR counters the drift with a teacher model whose parameters are an exponential moving average (EMA) of the parameters of the diagnosis model (the student) [41]. After training on task , the teacher is updated as
with momentum coefficient , so the teacher changes slowly and provides a stable reference for the latent space. The student is trained on the training pool , where is a class-balanced set of raw samples retrieved from , with three loss terms.
Weighted multi-label classification loss. The classifier is trained on the classification pool , which contains the latent representations of the current mini-batch, encoded by the current encoders, and an equal number of latent representations retrieved from . To counter class imbalance, a weighted binary cross-entropy is used,
where , and the positive weight is the ratio of negative to positive samples of class c in the training pool of task t.
VAE loss. The encoders and decoders are trained with the negative evidence lower bound of each modality, which consists of a reconstruction loss and a Kullback–Leibler (KL) divergence toward the standard normal prior [2,40],
(3.12)
averaged over the training pool, where is the reconstruction by the decoder of modality m. This term keeps the latent space informative about both modalities and, through the retrieved raw samples, about earlier hazard classes.
Latent distillation loss. Knowledge distillation [24,25] is applied in the latent space of each encoder by penalizing the divergence between the posteriors of the student and the teacher,
(3.13)
averaged over the training pool.
Overall objective. The student minimizes
where and balance representation learning and stability against diagnosis accuracy.
Algorithm 2 Incremental training of CLAR on task
1: Retrieve class-balanced from ;
2: Add for each
3: repeat for each mini-batch of size from
4: Encode the mini-batch into by Eq. (3.4)
5: from
6: Update by a gradient step on in Eq. (3.14)
7: until early stopping
8: Update the teacher by Eq. (3.9); update by Algorithm 1
3.7 Incremental Training Procedure
On the base task , the diagnosis model is trained with , the teacher is initialized as a copy of the trained model, and the buffer is filled with Algorithm 1. Each incremental task then follows Algorithm 2. Raw samples are retrieved once per task and appended to the training set, so they contribute to all three loss terms; latent representations are retrieved for every mini-batch and contribute to .
4 Theoretical Analysis of ALS-CBRS
This section analyzes, for an idealized model of the buffer update and of training, what ALS-CBRS stores and when its selection benefits learning. The results describe a mechanism that can explain the role of ALS-guided replay, which provide guarantees for this model. The full adaptive training procedure of CLAR is assessed empirically in Section 5. We consider one partition , which can be or , with quota , and compare ALS-CBRS with its uniform counterpart, i.e., class-balanced reservoir sampling with the same quota, obtained by setting in Eq. (3.6) and referred to as CBRS below [27]. Proofs are given in the Appendix.
4.1 Class Balance
Proposition 1 (Class balance). Under Algorithm 1, after every buffer update, for every and for both and .
Every class observed at least times thus occupies exactly slots, however frequent it is in the stream, and a rarer class keeps all of its samples. Class balance therefore follows from the per-class quotas and holds for any admission factor, including . The ALS factor determines which samples occupy the slots. For multi-label data, balance refers to the partition sizes: a sample in can carry further labels, so the label counts over the whole buffer still reflect co-occurrence.
4.2 Replay Law of ALS-CBRS
Fix class , a quota , and the parameters used by Algorithm 1, i.e., the encoders and . We treat these parameters, and hence the gate below, as fixed and independent of the arrivals analyzed; in Algorithm 1 the gate is learned partly from the same task's samples that it scores, so this independence is an idealization (Section 4-D). Let the class- samples arrive as independent and identically distributed (i.i.d.) pairs , where is the latent representation and the label vector, and let count the arrivals. Define the ALS gate and its mean as
By Eq. (3.6), the first arrivals fill the partition, and afterward the -th arrival replaces a uniformly chosen entry with probability . The ALS-weighted class distribution is defined by
Lemma 1 (Replay law). Every sample admitted after the partition is full has law . Each entry of the initial fill survives the first arrivals with probability
and the total variation distance between the law of and is at most . In particular, converges in distribution to i.i.d. draws from as .
Lemma 1 states precisely what favoring high-ALS samples means: in the long run, each partition is a sample from the class distribution reweighted by , whereas CBRS ( ) keeps a uniform sample of . For finite streams, entries of the initial fill, which enter without ALS, persist with probability . CBRS gives , and ALS-CBRS gives for large , so a gate with a small mean refreshes the partition more slowly. With only a few samples per hazard class, is small and part of each partition originates from the initial fill; the results below hold at every finite and account for this effect.
4.3 Replay-Gradient Error and Margin Stability
To relate the stored samples to learning, consider an output class , for instance , and hold and the encoders fixed. The logit in Eq. (3.5) is then linear in the attention vector,
where denotes the attention vector treated as the optimization variable. Let be the weighted binary cross-entropy of Eq. (3.11) for class with logit and a fixed weight . The population and replay objectives are
(4.5)
where is a twice differentiable convex term that collects the remaining training loss, such as the loss on the current task, held fixed and common to both sampling rules. The replay term contributes the Hessian with and , whose rank is at most ; for , the curvature condition of Theorem 1 therefore relies on , and we keep it as an assumption of the analysis. Let and minimize and , respectively. The replay gradient at is governed by
with the statistics
(4.7)
Here, and are the gradient variances under uniform and ALS-weighted selection, and is the selection bias.
Theorem 1 (Replay-gradient error and margin stability). Suppose , and are interior minimizers, and on the segment between and almost surely, with a deterministic common to both sampling rules. Let , and let be the mean-squared error of the replay gradient of ALS-CBRS after arrivals and that of CBRS. Then
Moreover, for a test sample and a decision threshold , the margin satisfies
and the same bound with holds for CBRS.
Corollary 1 (Critical capacity). Under Theorem 1, suppose and define
If , then for every , and the margin bound in Eq. (4.9) is smaller for ALS-CBRS whenever . If , then for all sufficiently large . If , then for every exactly when .
4.4 Implications for CLAR
Theorem 1 splits the replay-gradient error into a sampling variance and a squared selection bias . CBRS is unbiased, and ALS-CBRS trades a bias for a change in variance. By Corollary 1, in the limit , a capacity with an advantage over CBRS exists exactly when (the exact finite-stream criterion is given in Appendix D), i.e., when : the ALS gate has to favor samples whose replay gradients lie close to the class-average gradient. This is the precise sense in which ALS-selected samples are informative for replay: they represent the gradient of their class with less variance. Lemma 1, Theorem 1, and Corollary 1 hold for any fixed gate with values in and a positive mean. The logit bound in Eq. (3.8) motivates the ALS gate and leaves the sign of the covariance open, so the analysis characterizes when gated replay helps, and whether the ALS gate meets the condition is a property of the data and the learned attention geometry that can be estimated at training checkpoints. Through Eq. (4.9), a smaller replay-gradient error gives a smaller upper bound on the expected squared deviation of the classification margin of each test sample, which relates the sampling rule to the stability of the decision boundaries of earlier hazard classes.
Per-class capacity and the dual buffer. Holding the gradient statistics fixed, the limiting advantage over CBRS, , grows as decreases. In CLAR, the quotas and shrink as hazard classes accumulate, so ALS selection matters most when many classes share a small buffer. The two buffers play complementary roles: the latent-dominant design enlarges and thereby reduces the variance term under any sampling rule, while ALS selection gains most in partitions with a small quota, such as those of the raw buffer.
Scope. The analysis holds the encoders, , and the ALS gate fixed and independent of the analyzed arrivals, assumes i.i.d. arrivals within a class, a fixed quota and class weight, and a curvature bound common to both rules, optimizes one attention vector with the remaining loss held fixed, and compares ALS-CBRS with CBRS at the same quota. CLAR departs from this model in four ways: the gate is learned partly from the samples it scores; the parameters change between tasks, a drift that the teacher-anchored latent space (Section 3.6) is designed to slow; the whole network is trained jointly with several interacting partitions, and multi-label samples couple the partitions of co-occurring classes; and quotas change when classes appear, where random eviction keeps a uniformly chosen subset and thus preserves the composition of a
partition in expectation. The analysis concerns the replay gradient and the margin deviation, and the diagnosis performance along the incremental sequence is assessed empirically in Section 5.
5 Experiments
5.1 MII Testbed and AI System
We evaluate CLAR on hazard diagnosis data from the MII testbed of [2], whose AI system provides product quality modeling for an Aerosol Jet Printing (AJP) process as its computation service. The manufacturing data come from a real AJP dataset of 95 samples, each with six in situ process variables in time-series format (atomizer gas flow, sheath gas flow, current, nozzle X-coordinate, nozzle Y-coordinate, and nozzle vibration) and a binary quality label (conforming or nonconforming). Four synthetic time-series variables with negligible predictive power are added, giving ten input variables. Five AJP machines are simulated, each with its own ground-truth DNN model that labels samples generated by augmenting the 95 original samples (time warping, pooling, convolution, and others), which yields 500 samples per machine. A multivariate time-series DNN pipeline [5] is trained for each machine, and the top three pipelines of each machine are deployed on five fog nodes (Raspberry Pi computers) coordinated by a Cloud server. A computation task is the quality prediction for a batch of data from one machine, executed on one computation node.
Hazards are injected by varying the levels of the root cause factors of [2] in the data and AI pipeline layers, as summarized in Table I. Hazards in the cyber-physical layer, i.e., failed fog nodes and communication channels, prevent the computation task from completing and leave the supervised learning performance missing, so they are trivially identifiable [2]; we therefore consider the five root cause factors whose computation tasks complete successfully.
5.2 Diagnosis Dataset
The diagnosis dataset consists of 4,705 successfully executed computation tasks, each forming one sample as defined in Section 3.1. The supervised learning performance is a 92-dimensional vector that concatenates 9 core performance metrics (accuracy, precision, and F1 score of the top three pipelines) with 83 additional features. The runtime metrics form a tensor of shape , which records 10 hardware variables, including CPU temperature, memory consumption, and data transmission volume, over 500 time stamps for the 500 data samples of the processed batch. Each sample is labeled with the hazard classes in Table I, and several hazards can co-occur in the same computation task.
Table I: Hazard classes and the corresponding root cause factors [2].
| Class | Layer | Root cause factor and simulation |
|---|---|---|
| Class 0 | Data | Sensor contamination or failure: % of contaminated or failed sensors among the ten inputs |
| Class 1 | Data | Low signal-to-noise ratio (SNR): random noise injected at controlled scales |
| Class 2 | Data | Distribution change of input variables: Gaussian mixture data with controlled KL divergence |
| Class 3 | Data | Class imbalance: nonconforming-to-conforming ratio within a data batch |
| Class 4 | AI pipeline | Pipeline singularity: % of pipelines forced to produce identical predictions |
5.3 Class-Incremental Protocol
The dataset is highly imbalanced and sparse: only 273 of the 4,705 samples contain at least one hazard, and the remaining samples represent normal operation. The base task is built from the most frequent label configuration to initialize the feature extractor and the classifier. Among all three-label subsets, {Class 0, Class 3, Class 4} has the largest support, and the base task contains all hazardous samples of these classes. The remaining classes enter the incremental tasks in the order given by the class schedule , i.e., Class 2 appears before Class 1.
The task-allocation hyperparameter sets the number of hazardous samples per incremental task, which yields five incremental tasks and six tasks in total. Since only two new classes appear after the base task, most incremental tasks introduce zero new classes and revisit classes that have already been seen, which reflects the sparse and irregular emergence of new hazards in the MII (assumption (iv)). Normal samples are added to each task according to the imbalance ratio, i.e., the number of normal samples per hazardous sample, which is for the base task and for the incremental tasks.
5.4 Implementation Details
CLAR follows Algorithm 2 with mini-batch size , which is small owing to the size of the raw samples. The loss weights in Eq. (3.14) are and , and the EMA momentum in Eq. (3.9) is . Training on each task stops early when the relative change in falls below 0.005 for 5 epochs without improvement.
All replay methods are configured with comparable memory budgets. The baselines have a capacity of 50
raw samples and retrieve 40 of them per task. CLAR has a capacity of 49 raw samples in and 150 latent representations of dimension in ; with five classes, and , so at most 45 raw slots are occupied. One raw sample contains values, whereas the whole latent buffer contains values, i.e., 0.38% of one raw sample. At equal numerical precision, the configured capacity of CLAR is therefore about 2.0% smaller than that of the baselines (about 490 MB compared with 500 MB in 32-bit floating point) and provides about four times as many slots. Since a multi-label sample can occupy several partitions, the number of distinct stored samples can be smaller than the number of slots. Latent representations are retrieved for every mini-batch with , which avoids re-encoding large raw tensors at each step.
5.5 Baselines
All baselines use the diagnosis model of Section 3.3, i.e., the same multimodal feature extractor and attention-based classifier, so that the comparison isolates the replay design of Sections 3.4 and 3.5. No Replay trains on each task sequentially without a buffer and serves as the reference for forgetting. Experience Replay (ER) [10] updates a raw buffer by reservoir sampling and retrieves raw samples for every mini-batch. Class-Balancing Reservoir Sampling (CBRS) [27] applies reservoir sampling within each class, and can be viewed as ALS-CBRS with and a raw buffer only. iCaRL [11] selects exemplars by herding in the feature space and appends them to the training set of each task, and FBCR [13] combines virtual prototypes with class-center-based exemplar selection. The baselines thus differ from CLAR in how samples are selected (random, class-balanced random, or by feature-space centers, compared with ALS-guided selection in CLAR) and in how they are stored (raw samples, compared with the latent-dominant buffer of CLAR).
5.6 Evaluation Metrics
After training on task , the model is evaluated on the test sets of all tasks seen so far. Since normal samples dominate the data, accuracy is uninformative, and we use the weighted F1 score. Let be the number of occurrences of class in the test set of task , and let be the F1 score of class for the model trained up to task and evaluated on task , with class-wise predictions obtained by thresholding under the same protocol for all methods. The weighted F1 score is
We report the average weighted F1 (AvgF1), forgetting (), and backward transfer (BWT) after the final task
Table II: Performance with and (mean std over 5 runs). Buffer capacity: 50 raw samples for the baselines; 49 raw samples () and 150 latent representations () for CLAR. The best value in each column is in bold.
| Method | ||||||
|---|---|---|---|---|---|---|
| AvgF1 | Forgetting | BWT | AvgF1 | Forgetting | BWT | |
| No Replay | 0.8932 0.0194 | 0.0071 0.0038 | 0.0468 0.0118 | 0.8855 0.0183 | 0.0131 0.0129 | 0.0382 0.0186 |
| iCaRL | 0.8871 0.0144 | 0.0058 0.0026 | 0.0428 0.0062 | 0.8891 0.0060 | 0.0062 0.0042 | 0.0426 0.0096 |
| ER | 0.9069 0.0090 | 0.0191 0.0125 | 0.0349 0.0159 | 0.8937 0.0200 | 0.0306 0.0102 | 0.0254 0.0153 |
| CBRS | 0.8831 0.0316 | 0.0394 0.0350 | 0.0145 0.0318 | 0.8918 0.0190 | 0.0269 0.0096 | 0.0330 0.0190 |
| FBCR | 0.9007 0.0214 | 0.0152 0.0129 | 0.0490 0.0226 | 0.8926 0.0230 | 0.0199 0.0125 | 0.0394 0.0227 |
| CLAR | 0.9248 0.0174 | 0.0120 0.0096 | 0.0073 0.0111 | 0.9338 0.0130 | 0.0092 0.0070 | 0.0161 0.0093 |


Figure 3: Weighted F1 score per task for (left) and (right).
T [42,43],
AvgF1 measures the final diagnosis performance over all tasks, F measures the largest drop from the best past performance, and BWT measures the net change of earlier tasks between learning them and the end of the stream. All results are the mean and standard deviation over 5 independent runs.
5.7 Results
Table II and Fig. 3 summarize the results.
Diagnosis performance. CLAR achieves the highest mean AvgF1 under both imbalance levels. For , CLAR reaches , which exceeds the strongest baseline, ER ( ), by 0.0179. For , CLAR reaches , which exceeds the strongest baseline, again ER ( ), by 0.0401. The advantage of CLAR thus grows with the imbalance of the incremental tasks. From to 15, the AvgF1 of CLAR changes by +0.0090, while the changes of the baselines range from -0.0132 (ER) to +0.0087 (CBRS), so CLAR remains stable over the tested range of imbalance. Since the base-task imbalance is fixed and only two levels are tested, this result supports robustness within the tested conditions. The raw-only replay baselines remain close to No Replay (0.8932 and 0.8855), and iCaRL and CBRS fall slightly below it for , which indicates that a few raw exemplars per class bring limited benefit when hazard classes are scarce and multi-label; the latent-dominant buffer of CLAR addresses exactly this regime.
Forgetting. iCaRL attains the lowest forgetting in both settings (0.0058 and 0.0062), and No Replay also forgets little for (0.0071). Both, however, have low AvgF1, so their low forgetting reflects limited learning of the incremental classes. CLAR has the lowest forgetting among the methods with AvgF1 above 0.90 (0.0120 and 0.0092), and its forgetting decreases as the imbalance grows, whereas the forgetting of ER increases from 0.0191 to 0.0306. Among the methods with AvgF1 above 0.90, CLAR thus combines the highest AvgF1 with the lowest forgetting.
Backward transfer. All methods, including No Replay, show positive BWT, i.e., the performance on earlier tasks improves on average after later tasks. This follows from the protocol, in which most incremental tasks revisit classes that have already been seen and thus provide additional training samples for earlier classes. CLAR shows the smallest BWT in both settings (0.0073 and 0.0161). Combined with its highest AvgF1, this is consistent with CLAR reaching high performance on each task when it is first learned and changing it little afterward, whereas the baselines start lower on each task and gain more from revisited classes. BWT is therefore read together with AvgF1 and forgetting.
Overall assessment. CLAR provides the highest mean diagnosis performance under both imbalance levels with competitive forgetting and the smallest net backward change, with a smaller configured buffer than the raw-replay baselines. iCaRL achieves the lowest forgetting at a lower AvgF1, which shows that the preferred method depends on the metric of interest. These results support the CLAR framework as a whole under the evaluated memory and imbalance constraints; the contribution of the ALS gate alone is isolated by an ablation with , as suggested by Corollary 1.
5.8 Discussions
The empirical evaluation of the proposed framework provides deep insights into its continual learning capabilities, parameter dynamics, and representational stability under severe class imbalance. Figure 4 illustrates the per-class

Figure 4: Class 1 per-class F1 Score Comparison across 5 benchmark runs, showing the mean standard deviation for imbalance ratio of 10. Class 1 is introduced as a new class at task index .
F1 score comparison for Class 1, which is a new class introduced in the incremental learning process, specifically at Task 3, across five benchmark runs under an imbalance ratio of 10. As observed, CLAR significantly outperforms other continual learning baselines, including ER, iCARL, CBRS, and FBCR, achieving a much higher F1 score and maintaining robust performance. CLAR's dual-replay mechanism and attention formulation enable rapid and stable acquisition of Class 1 without degrading prior knowledge.
To understand the internal mechanisms of the attention based classifier, Figure 5 visualizes the learned class-specific attention parameters after the final task across hazard classes 0 through 4. The trainable per-class attention vectors (top row) isolate critical feature dimensions, while the per-class interaction matrices (bottom row) capture complex cross-dimensional
weightings and feature geometries. This dual formulation allows the model to compute class-aware logits via , tailoring the decision space specifically to the unique feature correlations of each hazard class.
Further diagnostic validation is provided in Figure 6, which plots the Attention Logit Score (ALS) against the final logit values for all classes after the final task. The clear separation between hazard-free samples (gray points) and hazardous samples (red points) relative to the decision threshold (, corresponding to a 0.5 probability) confirms that the attention-based scoring function reliably discriminates hazardous instances.
Finally, Figure 7 examines the representational consistency during incremental training across all hazard classes. By visualizing current streaming samples (blue circles), batch-wise retrieved raw samples from (green diamonds), and retrieved latent representations from (orange triangles), we observe a strong spatial overlap across modalities. This alignment highlights the effectiveness of the dual-replay memory buffer in preserving feature distribution consistency, preventing representation drift, and ensuring stable continual learning throughout the entire training lifecycle.
6 Conclusion
This work proposed Class-aware Latent Attention Replay (CLAR), a class-incremental hazard diagnosis framework that supports resilient AI systems in the MII. CLAR addresses newly emerging and recurring hazard classes, high-dimensional multimodal samples, severe class imbalance, multi-label co-occurrence, and limited memory through three coupled components: a latent-dominant dual replay buffer, ALS-guided class-balanced sampling, and a teacher-anchored latent space. The ALS links sample selection to the classifier through an upper bound on the logit magnitude. For an idealized model of the buffer update, the analysis showed that ALS-CBRS keeps a class-balanced buffer that follows an ALS-weighted class distribution, and that it has a lower replay-gradient error and a smaller upper bound on the expected squared margin deviation than class-balanced uniform replay whenever the per-class capacity lies below a critical value determined by the gate and the gradient statistics of the class.
On hazard data from an MII testbed with and , CLAR achieved the highest mean AvgF1 (0.9248 and 0.9338) among all methods with a configured buffer about 2% smaller than those of the raw-replay baselines. Its forgetting (0.0120 and 0.0092) was the lowest among methods with comparable diagnosis performance, while iCaRL forgot less at a lower AvgF1. All methods showed positive BWT, and CLAR showed the smallest one, reflecting high initial performance on each task with little subsequent change. These results highlight the value of evaluating incremental diagnosis with complementary metrics. Future work will estimate
Plot 4B (Parameter Architecture) — Run 0 Task 5

Figure 5: Plot of parameters of the classifier illustrating the learned class-specific attention parameters for after the final task across classes 0 through 4. The top row displays the trainable per-class attention vectors (visualized as bar plots across feature dimensions), which scale feature activations independently. The bottom row shows heatmaps of the per-class attention matrices , capturing complex feature interaction geometries and cross-dimensional weightings for each hazard class.
Plot 4C (ALS vs Logit Diagnostics) — Run 0 Task 5

Figure 6: Plot of ALS vs. Logit diagnostics. Gray points represent hazard-free samples, while red points denote hazardous samples for class c. The decision boundary is established at logit = 0 (corresponding to a classification threshold of 0.5)

Figure 7: Plot of Training samples used to train the incremental hazard diagnosis model. Illustrating representational consistency during incremental training (Algorithm 2). Current streaming training samples are marked in blue circles (Stream), batch-wise retrieved raw samples from are shown as green diamonds, and retrieved latent representations from are shown as orange triangles. The spatial overlap between the modalities highlights the consistency and alignment maintained by the dual-replay memory buffer across classes.
these gradient statistics at training checkpoints to verify the critical capacity empirically, examine the separation of class clusters in the latent space, and extend CLAR to cyber-physical layer hazards and to the diagnosis of hazard severity levels.
References
[1] Xiaoyu Chen, Lening Wang, Canran Wang, and Ran Jin. Predictive offloading in mobile-fog-cloud enabled cyber-manufacturing systems. In 2018 IEEE Industrial Cyber-Physical Systems (ICPS), pages 167–172, 2018.
[2] Yingyan Zeng, Ismini Lourentzou, Xinwei Deng, and Ran Jin. Fair: Facilitating artificial intelligence resilience in manufacturing industrial internet. arXiv preprint arXiv:2503.01086, 2025.
[3] Jorge F Arinez, Qing Chang, Robert X Gao, Chengying Xu, and Jianjing Zhang. Artificial intelligence in advanced manufacturing: Current status and future outlook. Journal of Manufacturing Science and Engineering, 142(11):110804, 2020.
[4] Xiaoyu Chen and Ran Jin. AdaPipe: A recommender system for adaptive computation pipelines in cyber-manufacturing computation services. IEEE Transactions on Industrial Informatics, 17(9):6221–6229, 2020.
[5] Parshin Shojaee, Yingyan Zeng, Xiaoyu Chen, Ran Jin, Xinwei Deng, and Chuck Zhang. Deep neural network pipelines for multivariate time series classification in smart manufacturing. In 2021 4th IEEE International Conference on Industrial Cyber-Physical Systems (ICPS), pages 98–103, 2021.
[6] Craig Poulin and Michael B Kane. Infrastructure resilience curves: Performance measures and summary metrics. Reliability Engineering & System Safety, 216:107926, 2021.
[7] Matthias De Lange, Rahaf Aljundi, Marc Masana, Sarah Parisot, Xu Jia, Aleš Leonardis, Gregory Slabaugh, and Tinne Tuytelears. A continual learning survey: Defying forgetting in classification tasks. IEEE transactions on pattern analysis and machine intelligence, 44(7):3366–3385, 2021.
[8] Marc Masana, Xialei Liu, Bartlomiej Twardowski, Mikel Menta, Andrew D Bagdanov, and Joost van de Weijer. Class-incremental learning: Survey and performance evaluation on image classification. IEEE Transactions on Pattern Analysis and Machine Intelligence, 45(5):5513–5533, 2023.
[9] Michael McCloskey and Neal J Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. In Psychology of Learning and Motivation, volume 24, pages 109–165. 1989.
[10] Arslan Chaudhry, Marcus Rohrbach, Mohamed Elhosseiny, Thalaiyasingam Ajanthan, P Dokania, P Torr, and M Ranzato. Continual learning with tiny episodic memories. In Workshop on Multi-Task and Lifelong Reinforcement Learning, 2019.
[11] Sylvestre-Alvise Rebuffi, Alexander Kolesnikov, Georg Sperl, and Christoph H Lampert. icarl: Incremental classifier and representation learning. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pages 2001–2010, 2017.
[12] Gido M van de Ven, Tinne Tuytelears, and Andreas S Tolias. Three types of incremental learning. Nature Machine Intelligence, 4(12):1185–1197, 2022.
[13] Shen Yan, Haidong Shao, Xudong Wang, and Jie Wang. Few-shot class-incremental learning for system-level fault diagnosis of wind turbine. IEEE/ASME Transactions on Mechatronics, 2024.
[14] Martial Mermillod, Aurélia Bugaiska, and Patrick Bonin. The stability-plasticity dilemma: Investigating the continuum from catastrophic forgetting to age-limited learning effects. Frontiers in Psychology, 4:504, 2013.
[15] Yue Wu, Yinpeng Chen, Lijuan Wang, Yuancheng Ye, Zicheng Liu, Yandong Guo, and Yun Fu. Large scale incremental learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 374–382, 2019.
[16] Saihui Hou, Xinyu Pan, Chen Change Loy, Zilei Wang, and Dahua Lin. Learning a unified classifier incrementally via rebalancing. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 831–839, 2019.
[17] Zheda Mai, Ruiwen Li, Jihwan Jeong, David Quispe, Hyunwoo Kim, and Scott Sanner. Online continual learning in image classification: An empirical survey. Neurocomputing, 469:28–51, 2022.
[18] Jihwan Bang, Heesu Kim, YoungJoon Yoo, Jung-Woo Ha, and Jonghyun Choi. Rainbow memory: Continual learning with a memory of diverse samples. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 8218–8227, 2021.
[19] Chris Dongjoo Kim, Jinseo Jeong, and Gunhee Kim. Imbalanced continual learning with partitioning reservoir sampling. In European Conference on Computer Vision, pages 411–428, 2020.
[20] Andrei A Rusu, Neil C Rabinowitz, Guillaume Desjardins, Hubert Soyer, James Kirkpatrick, Koray Kavukcuoglu, Razvan Pascanu, and Raia Hadsell. Progressive neural networks. arXiv preprint arXiv:1606.04671, 2016.
[21] Jaehong Yoon, Eunho Yang, Jeongtae Lee, and Sung Ju Hwang. Lifelong learning with dynamically expandable networks. arXiv preprint arXiv:1708.01547, 2017.
[22] James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, et al. Overcoming catastrophic forgetting in neural networks. Proceedings of the national academy of sciences, 114(13):3521–3526, 2017.
[23] Friedemann Zenke, Ben Poole, and Surya Ganguli. Continual learning through synaptic intelligence. In International Conference on Machine Learning, pages 3987–3995, 2017.
[24] Zhizhong Li and Derek Hoiem. Learning without forgetting. IEEE transactions on pattern analysis and machine intelligence, 40(12):2935–2947, 2017.
[25] Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
[26] Jeffrey S Vitter. Random sampling with a reservoir. ACM Transactions on Mathematical Software (TOMS), 11(1):37–57, 1985.
[27] Aristotelis Chrysakis and Marie-Francine Moens. Online continual learning from imbalanced data. In International Conference on Machine Learning, pages 1952–1961. PMLR, 2020.
[28] Rahaf Aljundi, Min Lin, Baptiste Goujaud, and Yoshua Bengio. Gradient based sample selection for online continual learning. In Advances in Neural Information Processing Systems, volume 32, 2019.
[29] Max Welling. Herding dynamical weights to learn. In Proceedings of the 26th annual international conference on machine learning, pages 1121–1128, 2009.
[30] Rahaf Aljundi, Eugene Belilovsky, Tinne Tuytelears, Laurent Charlin, Massimo Caccia, Min Lin, and Lucas Page-Caccia. Online continual learning with maximal interfered retrieval. In Advances in Neural Information Processing Systems, volume 32, 2019.
[31] Dongsub Shim, Zheda Mai, Jihwan Jeong, Scott Sanner, Hyunwoo Kim, and Jongseong Jang. Online class-incremental continual learning with adversarial Shapley value. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 9630–9638, 2021.
[32] Lorenzo Pellegrini, Gabriele Graffieti, Vincenzo Lomonaco, and Davide Maltoni. Latent replay for real-time continual learning. In IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pages 10203–10209, 2020.
[33] Tyler L Hayes, Kushal Kafle, Robik Shrestha, Manoj Acharya, and Christopher Kanan. REMIND your neural network to prevent catastrophic forgetting. In European Conference on Computer Vision, pages 466–483, 2020.
[34] Songsong Tian, Lusi Li, Weijun Li, Hang Ran, Xin Ning, and Prayag Tiwari. A survey on few-shot class-incremental learning. Neural Networks, 169:307–324, 2024.
[35] Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. Advances in neural information processing systems, 30, 2017.
[36] Andrei A Rusu, Dushyant Rao, Jakub Sygnowski, Oriol Vinyals, Razvan Pascanu, Simon Osindero, and Raia Hadsell. Meta-learning with latent embedding optimization. arXiv preprint arXiv:1807.05960, 2018.
[37] Da-Wei Zhou, Han-Jia Ye, Liang Ma, Di Xie, Shiliang Pu, and De-Chuan Zhan. Few-shot class-incremental learning by sampling multi-phase tasks. IEEE Transactions on Pattern Analysis and Machine Intelligence, 45(11):12816–12831, 2022.
[38] Jiquan Ngiam, Aditya Khosla, Mingyu Kim, Juhan Nam, Honglak Lee, and Andrew Y Ng. Multimodal deep learning. In International Conference on Machine Learning, pages 689–696, 2011.
[39] Tadas Baltrušaitis, Chaitanya Ahuja, and Louis-Philippe Morency. Multimodal machine learning: A survey and taxonomy. IEEE Transactions on Pattern Analysis and Machine Intelligence, 41(2):423–443, 2019.
[40] Diederik P Kingma and Max Welling. Auto-encoding variational Bayes. arXiv preprint arXiv:1312.6114, 2013.
[41] Antti Tarvainen and Harri Valpola. Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. In Advances in Neural Information Processing Systems, volume 30, 2017.
[42] David Lopez-Paz and Marc'Aurelio Ranzato. Gradient episodic memory for continual learning. In Advances in Neural Information Processing Systems, volume 30, 2017.
[43] Arslan Chaudhry, Puneet K Dokania, Thalaiyasingam Ajanthan, and Philip HS Torr. Riemannian walk for incremental learning: Understanding forgetting and intransigence. In European Conference on Computer Vision, pages 532–547, 2018.
[44] John von Neumann. Various techniques used in connection with random digits. In Monte Carlo Method, volume 12 of National Bureau of Standards Applied Mathematics Series, pages 36–38. 1951.
Appendix
A Proof of Proposition 1
The quotas never increase, because is nondecreasing in . A partition of a new class starts empty with . An arrival of class increases by one if and leaves it unchanged otherwise, so with a fixed quota, by induction over arrivals. When the quota decreases from to , eviction leaves entries, and the induction continues with .
B Proof of Lemma 1 and Exact Replay Error
For a measurable set and , conditioning on admission gives
which is the acceptance-rejection identity [44]. The process can therefore be represented by independent replacement events with probabilities , independent uniform slot choices, and independent replacement samples with law . A fixed slot is replaced at arrival with probability , which gives Eq. (4.3); hence the number of surviving initial entries satisfies . Couple with a partition initialized with i.i.d. entries from and subjected to the same replacements. The coupled partition keeps the law , and the two partitions coincide once every initial entry has been replaced, so the total variation distance is at most . Since diverges, , which proves convergence.
Lemma 2 (Exact replay error). Let be a statistic with , with means and and covariance traces and under and , and let and . Then
where , , , and as .
Proof. For slot , let . Conditional on the replacement schedule, the slots are independent, with law for surviving initial entries and otherwise. Hence . For , two distinct initial entries both survive with probability , so for , and . Expanding the second moment of gives Eq. (B.1) with , where the last term vanishes for . The identities and identify with . Since , its square lies between and , which gives the bounds. Finally, implies in probability, and boundedness gives .
C Proof of Theorem 1
In Eq. (4.6), the residual factor is bounded by , and . Hence is square integrable under and, since , under . Lemma 2 with , , and gives the limit in Eq. (4.8). For CBRS, and , so Eq. (B.1) equals for every .
For the margin, let . The curvature condition and give
Since , the common term cancels and , so . Finally, , and the Cauchy-Schwarz inequality gives Eq. (4.9). The same argument applies to CBRS.
D Proof of Corollary 1
Lemma 2 with gives
If , then , and yields
for , since there. The margin bounds inherit this ordering whenever . As , the difference tends to , which is positive for . For the second form of , a change of measure gives
and substitution into Eq. (4.10) completes the proof. At a finite , Eq. (D.1) gives the exact criterion if and only if .