Practical Recommendations for Replay-Based Continual Learning Methods

Gabriele Merlin, Vincenzo Lomonaco, Andrea Cossu, Antonio Carta, Davide Bacciu

Abstract

Continual Learning (CL) seeks to enable artificial neural networks to learn from a stream of data without suffering from catastrophic forgetting. Among various strategies, replay-based methods—which store a subset of past data—have proven highly effective. However, the practical implementation of these methods involves numerous design choices regarding buffer size, sample selection, and data augmentation. This paper provides a systematic empirical evaluation of these factors, offering "battle-tested" recommendations for researchers and practitioners.

Introduction

Artificial Neural Networks (ANNs) typically struggle with sequential learning tasks. When trained on a new task, they often abruptly lose the knowledge acquired from previous ones, a phenomenon known as Catastrophic Forgetting. Continual Learning (CL) aims to mitigate this by allowing models to learn incrementally.

Replay-based methods are a cornerstone of CL, utilizing a memory buffer to "rehearse" past experiences while learning new information. Despite their success, the field lacks clear, practical guidelines on optimizing these systems. This study addresses this gap by providing an extensive empirical comparison of implementation subtleties, such as buffer capacity, task weighting, and the efficacy of data augmentation under strict memory constraints.

Evaluated Strategies and Methodology

The authors utilize the Avalanche framework to compare four distinct CL strategies across diverse benchmarks including Split-MNIST, Split-CIFAR-10, Split-TinyImagenet, and CORe50-NC. The strategies evaluated are:

  1. Replay (Baseline): Uses random sampling to fill and discard samples from the buffer.
  2. GDumb (Greedy Sampler and Dumb Learner): A baseline that ignores the training stream and trains exclusively on the samples currently in the memory buffer.
  3. iCaRL (Incremental Classifier and Representation Learning): A hybrid approach combining "herding" (selecting samples closest to class means) with distillation loss.
  4. GSS (Gradient-based Sample Selection): A complex method designed to maximize the diversity of gradients within the buffer.

The study investigates these through three experimental lenses: Memory Size, Weighting Policies (how many samples to keep per task), and Data Augmentation (applying transformations to buffered samples).

Key Insights and Practical Findings

The 1% Rule of Thumb

A significant finding for practitioners is that a memory buffer containing as little as 1% of the total training data is often sufficient to achieve reasonable performance across most benchmarks. This provides a clear heuristic for initial system design, suggesting that massive memory overhead is not always necessary for effective rehearsal.

Strategy Selection: iCaRL vs. Standard Replay

While standard Replay is robust, iCaRL emerges as the superior choice in "low-budget" scenarios where memory is extremely constrained (e.g., 200 samples for CIFAR-10). Its herding strategy ensures that the most representative samples are preserved. Conversely, more complex strategies like GSS often fail to justify their computational cost; GSS can take up to 10 times longer to execute than standard Replay without providing a commensurate boost in accuracy.

The Role of Data Augmentation

Data augmentation acts as a critical "force multiplier," particularly when the memory buffer is tiny. In regimes with only 20–50 samples, simple geometric transformations like rotations or crops significantly improve accuracy. For instance, on CIFAR-10 with a 20-sample buffer, rotation augmentation improved performance from approximately 19.8% to 20.5%.

Buffer Weighting Policies

The study explored seven different weighting policies to determine how to distribute buffer capacity among tasks. While a Balanced policy (equal samples per task) remains the most consistent and reliable performer, the "MiddleHigh" policy—which prioritizes recent and middle-distance tasks—showed promise. This suggests that while all past knowledge is valuable, there is a slight benefit to emphasizing more recent experiences, echoing biological episodic memory patterns.

Conclusion and Recommendations

Based on the empirical evidence, the authors offer the following recommendations for implementing replay-based CL:

  • Start Simple: Standard Replay with a 1% buffer size is a strong, efficient baseline.
  • Use iCaRL for Tight Constraints: If memory is severely limited, iCaRL's herding mechanism provides the best performance-to-memory ratio.
  • Prioritize Augmentation: Always implement data augmentation, especially in low-memory settings, to maximize the utility of stored samples.
  • Stick to Balanced Weighting: Unless there is a specific reason to do otherwise, maintaining a balanced buffer across all tasks is the most robust strategy.

Future work should explore more advanced augmentation techniques, such as those generated by GANs or VAEs, and extend weighting policy experiments to more complex, high-dimensional datasets like TinyImagenet.

Summary updated

BibTeX
@inproceedings{merlin2022practical,
  author = {Gabriele Merlin and Vincenzo Lomonaco and Andrea Cossu and Antonio Carta and Davide Bacciu},
  title = {{Practical Recommendations for Replay-Based Continual Learning Methods}},
  booktitle = {ICIAP Workshops},
  year = {2022},
  url = {https://openreview.net/forum?id=TySmHmuk3m},
}
Figure