Train a network on task A until it is excellent, then train it on task B, and it will often fail task A completely. This is not a bug in one architecture or one optimiser. It is the default behaviour of gradient descent on a sequence of tasks, and it has a name: catastrophic forgetting.

Continual learning is the study of how to learn task after task without forgetting the earlier ones. It matters wherever data arrives over time and retraining from scratch is expensive, impossible, or forbidden: a robot that meets new rooms, a medical model that sees new hospitals, a personal assistant that learns new skills, or any system where old data can no longer be stored for privacy or cost reasons.

This article explains why forgetting happens, what the main families of fixes actually do, and where each one breaks down.

The core problem in one picture

Imagine the loss landscape for task A. Training finds a valley of parameters that solve A well. Now task B arrives, with its own landscape. Gradient descent on B walks downhill on B's landscape, with no memory of A's valley. If the two valleys are far apart, or if B's gradient points across A's valley, the walk leaves A's good region entirely.

That is the whole story, and every fix below is a different way of constraining, remembering, or replaying the walk.

Formally, suppose tasks arrive as datasets D1​,D2​,…,DT​ . After task t , we want parameters θ that do well on all tasks so far, not just the latest one:

θmin​s=1∑t​Ls​(θ)

The catch is that when we train on task t , we no longer have D1​,…,Dt−1​ , or we cannot afford to retrain on all of them. Continual learning is optimisation under that missing-data constraint.

Why forgetting is catastrophic, not gradual

Forgetting is not always slow decay. It can be sudden, for three reasons.

First, neural networks share parameters across tasks. A hidden unit that encodes a feature for task A is also free to be rewritten for task B. There is no built-in protection for old knowledge.

Second, the loss for task B says nothing about task A. A step that reduces B's loss by a lot while destroying A's performance looks exactly as good to the optimiser as a step that preserves both.

Third, representations drift. Even if the final layer could be relearned quickly, the features underneath may have moved so far that old decision boundaries no longer line up with them.

A useful diagnostic is the forgetting measure for a task. Let as,t​ be accuracy on task s after training task t . Forgetting on task s after all tasks is:

Fs​=t≥smax​as,t​−as,T​

In words: how much worse is the final model on task s than it was at its best point? High forgetting with high final accuracy on the latest task is the signature of catastrophic forgetting, not of a model that was simply too small.

Fix 1: Penalise movement away from old solutions

Regularisation methods keep the new parameters close to the old ones, but not equally in every direction. Some parameters matter a lot for task A; others barely matter. Moving an unimportant parameter is cheap, moving an important one is expensive.

Elastic Weight Consolidation (EWC) makes this precise with the Fisher information matrix. After task A, it estimates how sensitive A's loss is to each parameter, then adds a penalty during task B:

L(θ)=LB​(θ)+2λ​i∑​Fi​(θi​−θA,i​)2

Here θA​ is the solution after task A, Fi​ is the diagonal Fisher importance of parameter i for task A, and λ controls how strongly old knowledge is protected.

The intuition is a spring system. Each parameter gets a spring anchoring it to its old value, and the spring stiffness is its Fisher importance. Important parameters are held tight; unimportant ones are free to move and absorb the new task.

A minimal implementation sketch in PyTorch looks like this:

# After finishing task A, store the parameters and their Fisher importance. theta_old = {n: p.detach().clone() for n, p in model.named_parameters()} fisher = estimate_diagonal_fisher(model, task_a_loader) # E[grad^2] per parameter # During task B, add the EWC penalty to the ordinary loss. ewc_loss = 0.0 for n, p in model.named_parameters(): ewc_loss = ewc_loss + (fisher[n] * (p - theta_old[n]) ** 2).sum() loss = task_b_loss + (lam / 2.0) * ewc_loss 

This works surprisingly well when tasks are related and the quadratic approximation around θA​ is reasonable. It fails when tasks are very different, because no single point near θA​ can solve both, and a strong penalty then blocks learning of task B altogether. That trade-off is the stability-plasticity dilemma: too much stability and the model cannot learn anything new; too much plasticity and it forgets everything old.

EWC also has a practical weakness. The diagonal Fisher ignores interactions between parameters, and with many tasks the penalties accumulate and the model gradually stiffens. Variants such as Synaptic Intelligence estimate importance online during training, and Memory Aware Synapses use the sensitivity of the network output rather than the loss, but the core idea is the same: protect what mattered, free what did not.

Fix 2: Replay a little of the past

If you can store even a small buffer of old examples, replay is hard to beat. During training on task B, mix in a few examples from task A, sampled from a small episodic memory. The gradient then sees both tasks at once, and the walk cannot drift silently away from A's valley.

Replay works because it directly approximates the true objective: the sum of losses over all tasks so far. Its cost is memory and, sometimes, privacy. A buffer of raw images or records may be exactly what a deployment cannot keep.

Two refinements matter in practice. First, how the buffer is chosen: reservoir sampling keeps a roughly uniform sample over the stream, while herding or coreset selection keeps examples closest to class means. Second, how replay is combined with new data: simply mixing old and new examples in each batch is often enough, but if the buffer is tiny relative to the new task, old examples get swamped and forgetting returns.

Generative replay replaces the buffer with a generator trained on old tasks. Instead of storing real examples, the model generates synthetic ones and rehearses on them. This sidesteps raw data storage, but it inherits the generator's own forgetting problem: if the generator forgets task A, its replay teaches the wrong thing.

Fix 3: Grow the network, or isolate parameters

A third family avoids interference by construction. Instead of forcing one set of parameters to serve every task, give each task its own capacity: new units, new adapters, or a mask that selects a subnetwork per task.

Progressive networks add a new column of layers per task, with lateral connections to frozen earlier columns. Old knowledge is literally frozen, so forgetting is zero by construction, but the parameter count grows with every task.

Parameter isolation methods are more frugal. A binary mask per task selects which weights are active, or a small task-specific adapter is trained while the shared backbone stays fixed. This is closely related to modern parameter-efficient fine-tuning: if only a small adapter changes per task, the shared knowledge underneath is untouched.

The limitation is obvious: growth without bound is not continual learning in the long run, and isolation methods usually need to know which task an input belongs to at test time. That task identity assumption is often unrealistic. In the hardest setting, called class-incremental learning, the model must both recognise the task and classify correctly, without being told which task it is looking at.

Fix 4: Distil the old model into the new one

Knowledge distillation offers a middle path. Keep a copy of the model after task A, and during task B, ask the new model to match the old model's outputs on new-task inputs, as well as fitting the new labels. The old model's soft predictions carry information about old decision boundaries, even on inputs it never saw during task A.

Learning without Forgetting (LwF) is the classic form. If zold are the old model's logits and znew are the new model's logits on the same input, the distillation term penalises the difference between their softened distributions:

Ldistill​=−c∑​σ(zcold​/τ)logσ(zcnew​/τ)

where σ is the softmax function and τ is a temperature that softens both distributions.

Distillation is attractive when old data cannot be stored, because it needs only the old model, not the old data. Its weakness is that it only constrains behaviour on the new task's inputs. If new inputs never visit the regions where old knowledge lives, the old boundaries can still drift unnoticed.

Which fix should you reach for?

There is no single winner, and the right choice depends on the constraint that actually binds:

  • If you can store a small buffer and privacy allows it, start with replay. It is simple, strong, and directly targets the true objective.
  • If old data cannot be stored at all, start with EWC-style regularisation or distillation, and accept the stability-plasticity trade-off.
  • If task identity is known at test time and tasks are few, parameter isolation gives near-zero forgetting at the cost of growth.
  • If tasks arrive for a very long time, plan for capacity growth or periodic consolidation, because every fixed-capacity method eventually saturates.

In practice, the best systems combine methods: a small replay buffer plus a regularisation penalty, or adapters plus distillation. The combination matters less than measuring forgetting properly in the first place.

Limitations and common pitfalls

First, benchmarks can flatter a method. Permuted MNIST, where each task is the same digits with pixels shuffled, tests very little about representation reuse. Split CIFAR or split ImageNet, where each task introduces new classes, is a harder and more honest test, and class-incremental evaluation without task identity is harder still. Always check which setting a reported number comes from.

Second, hyperparameters do not transfer across task orders. A value of λ that works for two similar tasks can block learning entirely on a third, dissimilar task. Tune on a held-out task sequence, not on the test sequence.

Third, forgetting is not the only metric. Forward transfer, how much old tasks help new ones, and backward transfer, whether new tasks improve old ones, both matter. A method that prevents forgetting by freezing everything scores well on forgetting and terribly on learning.

Fourth, continual learning does not fix distribution shift within a task, label noise, or a bad base model. If the model never learned task A well, no penalty will preserve knowledge that was never there.

Finally, beware of the retraining baseline. In many deployments, the honest comparison is periodic retraining from scratch on all data seen so far. Continual learning wins when that is too expensive, too slow, or forbidden by data retention rules. When retraining is cheap and data can be kept, it is usually still the strongest and simplest option.

A practical checklist

  1. Define the setting: is task identity available at test time, and can old data be stored?
  2. Measure forgetting with the formula above, plus final accuracy on every task, not just the latest one.
  3. Start with replay if the constraints allow it; add EWC or distillation if they do not.
  4. Tune the stability-plasticity trade-off on a held-out task sequence.
  5. Compare against periodic retraining, and keep continual learning only where it actually wins.

Takeaway

Neural networks forget because gradient descent optimises only the task in front of it, on shared parameters, with no memory of earlier valleys. Regularisation protects important parameters, replay reintroduces old data, isolation removes interference, and distillation preserves old behaviour. None of these removes the stability-plasticity trade-off; they move it to a place you can live with. The art of continual learning is choosing which constraint to pay, and measuring honestly whether you paid it well.

Connect with me on LinkedIn: linkedin.com/in/umeshtharukaofficial