Advanced techniques
Continual Learning and Catastrophic Forgetting
Study rehearsal, regularization, architectural isolation, and evaluation protocols for models trained on changing task streams.
By the end you can
- Explain catastrophic forgetting as interference during sequential training
- Compare replay, regularization, and parameter-isolation strategies
- Distinguish task-incremental, domain-incremental, and class-incremental settings
- Measure retained performance, forward transfer, and memory cost over time
The newest task can overwrite the path to older solutions
A model trained in sequence can improve on new data while losing ground on old. New gradients reuse parameters that already supported other behaviors, so ordinary optimization may overwrite useful solutions. When the loss of earlier capability is severe, it is called catastrophic forgetting.
What makes the setting hard depends on what is available at each stage. Some systems may store old examples. Others face strict retention limits. Task identity may be known at inference, or the model may have to tell all old and new classes apart without it. Changes to the input distribution and to the label space create further variants that should not be treated as interchangeable. Continual learning therefore needs a stream protocol, not merely a new optimizer. The protocol fixes task order, memory allowance, revisitation, evaluation times, and what the model knows at prediction time.
One method attacked the interference head on, by slowing learning exactly where it would do damage. Elastic weight consolidation “remembers old tasks by selectively slowing down learning on the weights important for those tasks”. Kirkpatrick and colleagues tested it on permuted MNIST and on ten Atari games “chosen randomly from those that are played at human level or above by DQN”.
The rest of this lesson runs on measurements rather than on that description. Every number below comes from a published continual-learning paper or from a named regulator. The subject turns on quantities: how much was lost, how much memory it took to keep, and what the loss depends on.
Sequential accuracy is incomplete unless retained capabilities are measured after every update.
Visual
Three ways to protect previous knowledge
Three families protect old knowledge, and most working systems mix them. Regularization keeps every parameter and constrains the important ones — the elastic weight consolidation route, which “remembers old tasks by selectively slowing down learning on the weights important for those tasks”. Replay keeps data. Isolation or expansion keeps parameters, reserving adapters, experts or subnetworks per task. Each family can be priced.
Isolation has a published price tag. PackNet fits several tasks into one network by pruning it between them, and Mallya and Lazebnik measured what the extra bookkeeping costs. On an ImageNet-trained VGG-16 of 537 MB, the per-task masks came to about 17 MB for one added task and about 34 MB for three. Four tasks in total, for a 1/16 increase in size. Storage is the cheap part.
The expensive part is capacity, and it drains along the stream. After the initial 50% pruning, about 67M of the 134M conv1_1–fc7 parameters were free. Task II consumed 16.75M, leaving 50.25M. Task III consumed about 13M, leaving about 37M. Nothing was lost to forgetting there. The network simply had less room for each task than for the one before, which is a different failure with a different fix.
Replay
Revisit stored, generated, or summarized old examples during new training.
Regularization
Penalize changes to parameters or outputs important for previous tasks.
Isolation or expansion
Reserve parameters, adapters, experts, or subnetworks for different tasks.
The strategy determines what resource is spent: memory, flexibility, or model capacity.
Comparison
Three continual-learning settings
How hard the problem is depends on what the model is told at prediction time, and that difference has been measured on one unchanged network. Fine-tuned naively, with no defense at all, it reached 84.32% (±0.99) task-incremental, 60.13% (±1.66) domain-incremental and 19.89% (±0.02) class-incremental on Split MNIST, over 20 seeds per cell. On Split CIFAR-100 the same three columns read 61.43% (±0.36), 18.42% (±0.33) and 7.71% (±0.18). Van de Ven and colleagues published the comparison in Nature Machine Intelligence in 2022. The data is the same and the training is the same. Only what the model is told at prediction time changes, and that alone moves accuracy by more than sixty points on Split MNIST.
Defenses do not close the gap uniformly. Elastic weight consolidation scored 99.06% (±0.15) on Split MNIST task-incrementally and 20.64% (±0.52) class-incrementally on the same data. That is indistinguishable, in practice, from the 19.89% of doing nothing at all. The authors state the pattern in one sentence: “With task-incremental learning, almost all tested methods performed well compared to the ‘none’ and ‘joint’ baselines, with domain-incremental learning the relative performances of many methods dropped considerably and with class-incremental learning they decreased even further.”
So the three settings below are not three flavors of one benchmark. A method that works in the first column may be worth nothing in the third. Reporting the first while deploying into the third is the most common way to overstate a continual learner.
Task-incremental
The task identity is available at inference and task-specific heads may be used.
- Easiest of the three settings
- Supports task-specific output spaces
- Requires reliable task routing
- Useful for clearly separated workflows
Domain-incremental
The task remains the same while input distributions change over time.
- Shared output space
- No task identity may be available
- Common in devices, seasons, and sites
- Closely linked to drift adaptation
Class-incremental
New classes arrive and the model must distinguish all classes without task labels.
- Strong interference and bias challenges
- Output space expands over time
- Replay is often important
- Evaluation must include all learned classes
Example
Metrics that reveal more than final average accuracy
A continual learner has to be judged across the whole task sequence, and the vocabulary for doing that was fixed by the GEM paper in 2017. Lopez-Paz and Ranzato fill a T×T matrix R whose entry is the test accuracy on task j after the model has finished training on task i. Three numbers come off it: ACC, backward transfer (BWT, the mean of R_T,i − R_i,i) and forward transfer (FWT, the mean of R_i−1,i − b̄_i). One line of the paper connects the matrix to this lesson's subject: “Large negative backward transfer is also known as (catastrophic) forgetting.”
On MNIST Rotations at five passes per task, a single predictor trained sequentially fell to ACC 0.43 with BWT −0.40. GEM held ACC 0.89 with BWT −0.02 — the same 0.89 that the same architecture reached when it was trained on shuffled i.i.d. data instead of a stream. One final average would have reported 0.43 and 0.89. The matrix explains that the difference is almost entirely retention.
A second family normalizes rather than differences. Kemker and colleagues built three benchmark protocols — data permutation, incremental class learning, multi-modal learning — and three normalized area-under-the-curve metrics, Ωbase, Ωnew and Ωall, each divided by αideal, the accuracy of the same network trained offline. That ideal was 62.1% on CUB-200 and 46.1% on AudioSet. That is what a perfect score on those sets actually means.
- Average accuracy (ACC): mean performance across all tasks learned so far — in the GEM formulation, the mean of the final row of the matrix R, one score per task after the whole stream has been seen.
- Forgetting: the drop from a task's best historical score to its current one, the quantity a single end-of-stream average is structurally unable to show.
- Backward transfer (BWT): whether later learning improves or harms earlier tasks, the mean of R_T,i − R_i,i — −0.40 for the sequential single predictor on MNIST Rotations, against −0.02 for GEM.
- Forward transfer (FWT): whether prior learning helps new tasks before or during adaptation, the mean of R_i−1,i − b̄_i.
- Memory footprint: stored examples, generators, adapters or task-specific parameters. GEM's CIFAR-100 sweep ran an episodic memory from 200 up to 5,120 examples, while PackNet's per-task masks cost about 17 MB against a 537 MB backbone.
- Update cost: the compute and time each new stage of learning takes, which changes the answer rather than just the bill. As the number of passes per task rose, the sequential single predictor's ACC fell 0.53, 0.49, 0.43 while its BWT went −0.08, −0.25, −0.40, reaching −0.40 at five passes.
Analogy
A notebook with limited pages
Several courses, one notebook, and each new subject goes down on top of the old notes. Writing over them causes forgetting. You could revisit selected pages, mark important formulas against overwriting, or reserve separate sections for new subjects. Replay, regularization and parameter isolation echo those choices.
Neural knowledge is not filed page by page. There is rarely one page for one skill, and protecting a parameter can help several tasks while constraining others. The notebook also misses the second cost the PackNet numbers made visible. Reserving sections does not only risk the old notes. It leaves the later subjects less room: 67M free parameters before the second task, about 37M after the third.
Continual learning manages interference under limited memory and capacity.
Key idea
Replay buffers are data products with governance obligations
Storing old examples can be highly effective. It can also violate retention limits, privacy rules or licensing constraints. The buffer can go unrepresentative too, keeping easy prototypes and dropping rare or recent cases. Generated replay avoids storing raw data, but introduces generator bias and its own forgetting problem.
Document the sampling policy, the retention period, the deletion behavior, the class coverage, and whether the buffer can be reconstructed. Continual learning should not become a hidden archive outside normal data governance.
In one setting this is no longer a recommendation from the literature. A manufacturer that intends to keep updating a deployed medical AI can file the update protocol in advance, as a predetermined change control plan. The US Food and Drug Administration set out how in a final guidance, whose availability it announced in the Federal Register on 4 December 2024. The guidance-document page from the Center for Devices and Radiological Health states the contents: “This guidance recommends that a PCCP describe the planned device modifications, the associated methodology to develop, validate, and implement those modifications, and an assessment of the impact of those modifications.” The plan is reviewed inside the 510(k), De Novo or PMA submission. That is, before the updating starts — not after something is noticed to have been forgotten.
Replay improves retention only if the remembered data is lawful, representative, and maintained.
Case
A fixed exemplar budget divided among a growing class list
A replay budget is usually fixed, so the share for each class shrinks as classes arrive. The buffer does not grow. iCaRL stored up to K = 2000 exemplars on incremental CIFAR-100 and up to K = 20000 on ImageNet, and split that allowance evenly, using “m = K/t exemplars (up to rounding) for each class”. At fifty classes each one keeps a fifth of what it held at ten. That is how a buffer that looked generous early stops covering the older classes.
The other half of the question is what a larger budget buys. Lopez-Paz and Ranzato measured exactly that on incremental CIFAR-100, 20 tasks of 5 classes. With an episodic memory of 200 examples, GEM reached ACC 0.487 and iCaRL 0.436. At 1,280 the pair read 0.579 and 0.494; at 2,560, 0.633 and 0.500; at 5,120, 0.654 and 0.508. A buffer 25.6× larger bought GEM 16.7 accuracy points and iCaRL 7.2 — real, monotone, and steeply diminishing. As they write: “Also seen in Table 2, the final ACC of GEM is an increasing function of the size of the episodic memory, eliminating the need to carefully tune this hyper-parameter.”
Put the two halves together and a replay budget becomes a decision with prices on both sides. The rule m = K/t says what each class gets. The sweep from 200 to 5,120 says what the next order of magnitude of storage is worth in accuracy, and for iCaRL over that range it was 7.2 points. That storage arrives with every retention and privacy obligation attached to it.
Figure
Steps
A task-stream evaluation protocol
The protocol should make forgetting visible at every stage. Every step below has a published instance to copy rather than an instruction to interpret.
Defining the stream can be as concrete as CORe50: 164,866 128×128 RGB-D images, being 11 recording sessions (8 indoor, 3 outdoor) × 50 domestic objects in 10 categories × about 300 frames, recorded at 20 fps with a Kinect 2.0, with sessions 3, 7 and 10 held out for test. Lomonaco and Maltoni also fixed three stream protocols by name — New Instances (NI), New Classes (NC), and New Instances and Classes (NIC) — the second defined this way: “New Classes (NC): new training patterns belonging to different classes become available in subsequent batches. In this case the model should be able to deal with the new classes without losing accuracy on the previous ones.” That NI/NC/NIC split is an independent naming of the same distinction the settings section teaches.
Step two, setting the memory and compute budgets, is where the replay sweep from 200 to 5,120 examples belongs. It is also where a deployment under the FDA guidance writes down its planned modifications and impact assessment in advance — the predetermined change control plan described in the governance callout above.
Steps three and four — evaluate after every task, then compare against naive sequential training — only discriminate if the benchmark is hard enough to separate methods. Kemker and colleagues documented the failure directly. Their incremental class learning started from half the classes (5 for MNIST, 100 for CUB-200, 50 for AudioSet), with one new class per session, and the ranking obtained on MNIST did not survive the move to real-world data: “In nearly every case, Ωall is greater for MNIST than on CUB-200 or AudioSet, demonstrating the need for alternative incremental learning benchmarks.”
Step six, order sensitivity, is not a precaution against a hypothetical. Mallya and Lazebnik ran all six orderings of three tasks with three runs each, and reported the effect of training order: “For example, the top-1 error increases from 16.00% to 18.34% to 19.91% for the Stanford Cars dataset as we delay its addition to the network.” Same dataset, same method, same budget. Three different results, produced by nothing but position in the queue. A single-order experiment cannot tell you which of those three numbers it happened to draw.
1. Define the stream
Specify task order, domain changes, class arrivals, and available task identity.
2. Set memory and compute budgets
Make replay and model expansion constraints explicit.
3. Evaluate after every task
Record the full task-by-task performance matrix.
4. Compare naive sequential training
Measure the forgetting problem before adding defenses.
5. Add one strategy family at a time
Separate replay, regularization, and isolation effects.
6. Test order sensitivity
Repeat with several task orders because sequence can change difficulty.
Visual
A dashboard for a changing task stream
Final average accuracy hides when and where knowledge was lost. The object that does not hide it is the full matrix R: test accuracy on task j after the model has finished task i, filled in as the stream runs. Current-task quality is its diagonal, R_i,i. Retained quality is its final row. Backward transfer is the gap between the two, the mean of R_T,i − R_i,i, and forward transfer reads across the row above the diagonal, as the mean of R_i−1,i − b̄_i.
Two numbers show why the whole matrix is worth keeping. A single predictor trained sequentially on MNIST Rotations reported ACC 0.43 and BWT −0.40. GEM reported 0.89 and −0.02, matching the 0.89 of the same architecture trained on shuffled i.i.d. data, which is the ceiling. Reported alone, the accuracies say one method is better. With BWT beside them, they say the weaker one learned each task and then lost it.
Two more panels sit outside the matrix. Memory and compute have to be tracked as first-class results, since the same method scores 0.487 or 0.654 depending only on the buffer it was given, and about 17 MB of masks per task on a 537 MB backbone is a real line item. Unknown-task behavior has to be tested explicitly too. The drop from 84.32% to 19.89% on Split MNIST was caused by nothing except removing the task identifier at prediction time.
- 1
Current-task quality
Measure how well the model learns the newest data.
- 2
Retained quality
Re-evaluate earlier tasks after every update.
- 3
Backward transfer
Record whether new learning helps or harms previous tasks.
- 4
Forward transfer
Compare adaptation speed on a new task with a from-scratch baseline.
- 5
Memory and compute
Track replay storage, update time, and inference growth.
- 6
Unknown-task behavior
Test routing or prediction when task identity is unavailable.
Key takeaways
- Catastrophic forgetting is interference with earlier capabilities during sequential training. On MNIST Rotations a sequentially trained single predictor ended at ACC 0.43 with backward transfer −0.40, against 0.89 and −0.02 for GEM.
- Task-, domain- and class-incremental settings make different inference assumptions. The same naively fine-tuned network scored 84.32%, 60.13% and 19.89% on Split MNIST purely because of them.
- Replay, regularization and parameter isolation spend different resources. Elastic weight consolidation fell to 20.64% class-incrementally on Split MNIST, while PackNet's isolation cost about 17 MB of masks per task on a 537 MB backbone and left about 37M free parameters by the third task.
- Continual evaluation requires the task-by-task matrix R — ACC, BWT and FWT read off it — rather than one final score.
- Task order, memory budget and update cost materially affect results. Stanford Cars top-1 error rose from 16.00% to 18.34% to 19.91% by arriving later, and GEM's ACC rose from 0.487 to 0.654 as the episodic memory grew from 200 to 5,120 examples.
- Replay buffers and generated memories require explicit privacy and retention governance. For devices under the FDA's final guidance, the planned modifications, their methodology and an impact assessment are filed in advance.