Sparse Coding in a Dual Memory System for Lifelong Learning

Fahad Sarfraz, Elahe Arani, Bahram Zonooz

Introduction

Deep Neural Networks (DNNs) typically struggle with "lifelong learning," where they must acquire new knowledge sequentially without forgetting previous tasks. This phenomenon, known as catastrophic forgetting, arises from the stability-plasticity dilemma: the model must be plastic enough to learn new information but stable enough to preserve existing weights. Standard DNNs utilize dense, overlapping representations, meaning that updates for a new task often interfere with the parameters optimized for prior ones.

The SCoMMER Framework

To address these challenges, the authors propose SCoMMER (Sparse Coding in Multiple-Memory Experience Replay), a framework inspired by neurobiological principles of sparse coding and memory consolidation. SCoMMER integrates three core components:

  1. Sparse Activations via k-WTA: Instead of traditional ReLU activations, SCoMMER employs a "k-Winners-Take-All" (k-WTA) mechanism. Only the top-$k$ filters with the highest activations are permitted to propagate signals. This forces the network to develop specialized, non-overlapping subnetworks for different tasks, reducing interference.
  2. Semantic Dropout: This mechanism uses class-wise activity counters to align sparse codes semantically. Semantically similar classes (e.g., "cat" and "dog") are encouraged to share activation patterns, facilitating forward transfer, while dissimilar classes (e.g., "car" and "dog") use distinct units to prevent interference.
  3. Dual-Memory System: SCoMMER maintains a Working Memory for rapid learning, a Long-Term Memory (updated via Exponential Moving Average of working memory weights) for stable knowledge consolidation, and an Episodic Memory buffer for rehearsal.
The SCoMMER architecture illustrating the interaction between episodic, long-term, and working memory, alongside k-WTA and Semantic Dropout.

Experimental Setup

SCoMMER was evaluated on sequential versions of CIFAR-10 and CIFAR-100 (S-CIFAR10/100) and the more complex Generalized Class Incremental Learning (GCIL) benchmark. GCIL introduces realistic challenges such as recurring classes and long-tail distributions, testing the model's ability to handle class imbalance and re-exposure.

Results and Discussion

SCoMMER demonstrates superior performance, particularly in memory-constrained scenarios. On S-CIFAR100 with a minimal buffer of 200 samples, SCoMMER achieved 40.25% accuracy, outperforming established baselines like CLS-ER (35.23%) and DER++ (29.60%).

A critical advantage of SCoMMER is its stability. Heatmap analysis reveals that the Long-Term Memory effectively consolidates knowledge, maintaining higher accuracy on early tasks compared to the Working Memory. For instance, after learning five tasks, the Long-Term Memory retains significantly higher performance on Task 1 than the rapidly changing Working Memory.

Heatmaps comparing task-wise performance in Working Memory vs. Long-Term Memory. The Long-Term Memory (right) shows superior stability and retention of early tasks compared to Working Memory (left).

Furthermore, the model mitigates "recency bias"—the tendency to favor the most recently learned classes—by providing more uniform prediction probabilities across the entire task history.

Conclusion

SCoMMER successfully leverages biological inspiration to solve the stability-plasticity dilemma in continual learning. By combining sparse coding with a dual-memory consolidation process, it achieves state-of-the-art results with minimal memory overhead. Future research may extend these principles to larger architectures like Transformers or multi-modal learning environments.

Summary updated

BibTeX
@inproceedings{sarfraz2023sparse,
  author = {Fahad Sarfraz and Elahe Arani and Bahram Zonooz},
  title = {{Sparse Coding in a Dual Memory System for Lifelong Learning}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2023},
  doi = {10.1609/aaai.v37i8.26161},
}
Figure