Carousel Memory: Rethinking the Design of Episodic Memory for Continual Learning

Soobee Lee, Minindu Weerakoon, Jonghyun Choi, Minjia Zhang, Di Wang, Myeongjae Jeon

Introduction

Continual Learning (CL) enables models to learn from a non-stop stream of data. However, it faces the challenge of catastrophic forgetting, where learning new tasks causes the model to overwrite knowledge from previous ones. To combat this, researchers use Episodic Memory (EM)—a small RAM buffer that stores past samples for "replay." On resource-constrained devices, this buffer is often too small, leading to permanent data loss once it reaches capacity.

Carousel Memory (CarM) proposes a hierarchical memory management strategy that utilizes abundant on-device storage (SSD/HDD) as an extension of limited RAM. By treating the memory hierarchy as a revolving door for data, CarM significantly reduces forgetting without requiring additional high-cost memory.

Methodology: The CarM Architecture

CarM introduces a "plug-and-play" framework that sits beneath existing CL algorithms. It manages data flow through three core mechanisms:

  1. Hierarchical Storage: CarM maintains a large pool of past experiences in internal storage and a smaller, high-speed subset in RAM for active training.
  2. Scoring and Gating: A "gate function" decides which samples to swap. Using an Entropy-based policy, the system prioritizes keeping samples the model is currently "confused" about (high entropy) in RAM, while swapping out mastered samples to storage.
  3. Asynchronous Retrieval: To prevent slow storage I/O from bottlenecking training, CarM employs an asynchronous "swap worker." This worker fetches the next bundle of samples from storage in the background while the model trains on the current set.
Overview of the Carousel Memory (CarM) architecture, illustrating the interaction between model training, the scoring gate, and hierarchical storage.

Efficiency and Performance

A primary obstacle to using disk storage for training is latency. CarM addresses this by overlapping I/O operations with computation. As shown in the comparison of training modes, the asynchronous approach effectively hides latency, resulting in negligible training time overhead (typically 1-3%) compared to the significant delays of a synchronous approach.

Comparison of Synchronous vs. Asynchronous data swapping. The Async mode hides I/O latency by overlapping data retrieval with model training.

Evaluations across benchmarks like CIFAR-100 and ImageNet-1000 show that CarM delivers massive accuracy gains. For example, when added to the DER++ algorithm on Tiny-ImageNet, CarM improved final accuracy by 28.4%. Notably, a model using CarM with a tiny RAM buffer can outperform standard models with much larger buffers because it can "carousel" through a far greater variety of historical data.

Key Insights: The Distillation Conflict

The authors also identified a "distillation conflict." While many CL methods rely on knowledge distillation (learning from the model's own past predictions), CarM reveals that having access to a large volume of real past data in storage makes heavy distillation less necessary and sometimes even harmful. Access to ground-truth historical data is almost always superior to relying on "soft" guesses from previous model versions.

Conclusion

Carousel Memory demonstrates that the "RAM bottleneck" in continual learning can be overcome by rethinking memory hierarchy. By leveraging existing storage and hiding latency through asynchrony, CarM provides a practical path for deploying robust, long-term learning systems on edge and IoT hardware.

Summary updated

Abstract

Continual Learning (CL) is an emerging machine learning paradigm that aims to learn from a continuous stream of tasks without forgetting knowledge learned from the previous tasks. To avoid performance decrease caused by forgetting, prior studies exploit episodic memory (EM), which stores a subset of the past observed samples while learning from new non-i.i.d. data. Despite the promising results, since CL is often assumed to execute on mobile or IoT devices, the EM size is bounded by the small hardware memory capacity and makes it infeasible to meet the accuracy requirements for real-world applications. Specifically, all prior CL methods discard samples overflowed from the EM and can never retrieve them back for subsequent training steps, incurring loss of information that would exacerbate catastrophic forgetting. We explore a novel hierarchical EM management strategy to address the forgetting issue. In particular, in mobile and IoT devices, real-time data can be stored not just in high-speed RAMs but in internal storage devices as well, which offer significantly larger capacity than the RAMs. Based on this insight, we propose to exploit the abundant storage to preserve past experiences and alleviate the forgetting by allowing CL to efficiently migrate samples between memory and storage without being interfered by the slow access speed of the storage. We call it Carousel Memory (CarM). As CarM is complementary to existing CL methods, we conduct extensive evaluations of our method with seven popular CL methods and show that CarM significantly improves the accuracy of the methods across different settings by large margins in final average accuracy (up to 28.4%) while retaining the same training efficiency.
BibTeX
@misc{lee2021carousel,
  author = {Soobee Lee and Minindu Weerakoon and Jonghyun Choi and Minjia Zhang and Di Wang and Myeongjae Jeon},
  title = {{Carousel Memory: Rethinking the Design of Episodic Memory for Continual Learning}},
  year = {2021},
  eprint = {2110.07276},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2110.07276},
}
Figure