Skip to main content
Continual Learning

Continual Learning

The Catastrophic Forgetting Problem

Imagine you spent a year becoming fluent in French, then spent a year learning Mandarin, and when you tried to speak French again you could barely string a sentence together. That is catastrophic forgetting — and it is exactly what happens to neural networks. Unlike humans, who can (mostly) retain old skills while acquiring new ones, standard neural networks overwrite old knowledge when optimized for new data. The weights that encoded “how to recognize cats” get repurposed for “how to recognize medical X-rays,” and the cat knowledge evaporates. This is not an edge case. It is the fundamental obstacle to deploying ML models in the real world, where data distributions shift, new classes appear, and retraining from scratch every time is prohibitively expensive.
A common misconception is that fine-tuning with a small learning rate avoids catastrophic forgetting. It does not — it merely slows it down. Even with a learning rate 100x smaller, a model fine-tuned on task B will eventually lose task A performance. The learning rate controls the speed of forgetting, not whether it occurs.

Measuring Forgetting


Regularization-Based Methods

Elastic Weight Consolidation (EWC)

Synaptic Intelligence (SI)


Replay-Based Methods

Replay methods take a completely different approach from regularization: instead of constraining how the model changes, they maintain a small memory of past examples and mix them into training data for new tasks. This is directly inspired by the neuroscience theory of memory consolidation, where the hippocampus “replays” past experiences during sleep to transfer them to long-term cortical storage. The simplest version — experience replay — is often the strongest baseline. Before reaching for sophisticated methods like EWC or PackNet, always compare against replay with a reasonable buffer size. It is embarrassingly effective.
When using experience replay, how you select which examples to store matters more than the buffer size. Random selection is a decent default, but “herding” (storing examples closest to the class mean in feature space) or “k-center coreset” selection (maximizing coverage of the feature space) can improve results by 2-5% with the same buffer size. Also, balancing the buffer equally across classes prevents the model from becoming biased toward recently seen classes.

Experience Replay

Generative Replay

Generative replay is an elegant alternative to storing real examples: instead of maintaining a buffer, train a generative model (VAE, GAN, diffusion model) alongside the classifier. When learning a new task, the generator produces synthetic examples from previous tasks that are mixed into training. The generator itself must also be trained continually, so you are solving two continual learning problems at once — but the payoff is zero storage of real data, which matters in privacy-sensitive domains like healthcare.
Generative replay sounds appealing in theory, but in practice the quality of the generator matters enormously. If the generator produces low-fidelity samples (blurry images, mode collapse), the classifier trained on them will degrade. For simple datasets (MNIST, Fashion-MNIST), generative replay works well. For complex datasets (CIFAR-100, ImageNet), the generator itself becomes the bottleneck. Modern diffusion models have improved this significantly, but the compute cost of maintaining a diffusion model alongside your classifier may exceed the cost of simply storing a replay buffer.

Architecture-Based Methods

Architecture-based methods take the most direct approach to preventing forgetting: give each task its own parameters. The old parameters are literally frozen — they cannot be modified, so they cannot be forgotten. The challenge shifts from “how to avoid forgetting” to “how to share knowledge across tasks without running out of capacity.” Think of it like a library: regularization methods try to write new books without erasing old ones (hard). Replay methods keep photocopies of old books (memory cost). Architecture methods add new bookshelves for new topics, while allowing readers to reference old shelves (capacity cost). Each approach trades a different resource.

Progressive Neural Networks


Advanced Methods

Dark Experience Replay


Best Practices


Exercises

Implement and compare on Split-MNIST:
  • Fine-tuning (baseline)
  • EWC
  • Experience Replay
  • A-GEM
Plot accuracy matrix and compute all metrics.
Test EWC on different task orderings:
  • Easy to hard
  • Hard to easy
  • Random
How does order affect final performance?
Combine EWC with Experience Replay:
  • What’s the optimal combination?
  • Does it beat either method alone?

What’s Next?

Model Compression

Quantization and pruning techniques

Capstone Project

Apply all techniques in a complete project