Experience Replay for Continual Learning

When a neural network learns a new task, it often suffers from "catastrophic forgetting"—the tendency to overwrite the weights responsible for previous knowledge with those needed for the current task. If you train a model on Task A and then Task B, its performance on Task A typically plummets.

The most effective countermeasure across diverse domains—from robotics to large language models—is Experience Replay (ER), also known as rehearsal. The intuition is simple: just as a student reviews old flashcards while learning new material, a model can maintain a small "memory" of past experiences to interleave with new data.

The Rehearsal Buffer as a Memory Anchor

The core mechanism of experience replay is a replay buffer: a fixed-size memory that stores a representative subset of historical data. During training on a new distribution, the model doesn't just see new samples; it sees a "mixed" batch containing both current data and samples drawn from this buffer.

This approach has proven remarkably robust across different modalities:

Beyond Raw Samples: Features and Prototypes

Storing raw data can be expensive or privacy-invasive. Researchers have developed more efficient "abstractions" of memory to achieve the same stabilizing effect.

One approach is Prototype Replay. Instead of keeping every image or sentence, the model stores "prototypes"—abstracted representations of a class or task. Jian-Ming Zhi proposed a hybrid framework that combines raw samples for recent trends with density-aware prototypes for long-term stable representations [Research on Incremental Learning Methods Based on Sample and Category Prototype Playback].

In distributed settings like Federated Learning, Ming Hu and colleagues introduced Knowledge Replay, where idle devices send intermediate features to a central server. This "reminds" the server of diverse data distributions it isn't currently seeing, boosting accuracy by up to 23% [KoReA-SFL: Knowledge Replay-based Split Federated Learning Against Catastrophic Forgetting].

Strategic Sampling and Curriculum Design

The success of replay depends heavily on what is kept in the buffer. Simple random sampling is common, but more sophisticated strategies can predict what the model is most likely to forget.

Scaling Replay for Real-Time Systems

For real-world deployment, replay must be computationally efficient. Charalampos Davalas and colleagues developed a framework that uses a "Drift Detector" to trigger training only when a distribution shift is detected, achieving state-of-the-art accuracy while using only 3% of the processing power of standard baselines [A rehearsal framework for computational efficiency in online continual learning].

At the petabyte scale, the bottleneck shifts to I/O. Bogdan Nicolae and Ian T. Foster have explored distributed rehearsal buffers that aggregate memory across a computing cluster. By using high-speed RDMA networking, these systems can provide the accuracy of retraining from scratch with the speed of incremental updates [Efficient distributed continual learning for steering experiments in real-time].

Why It Works: The Stability-Plasticity Dilemma

Experience replay addresses the fundamental "stability-plasticity dilemma" in neural networks. Plasticity allows a model to learn new information, while stability allows it to retain old information. By interleaving old and new data, replay forces the optimization landscape to find a solution that satisfies both constraints simultaneously.

Whether it is a robot self-correcting its vision in a new environment [Hermann Blum] or a solver learning new types of mathematical problems [Sahil Manchanda], the replay buffer acts as a persistent anchor to the past, ensuring that progress on new frontiers does not come at the cost of established knowledge.

Go deeper