Learning Bayesian Sparse Networks with Full Experience Replay for Continual Learning

Dong Gong, Qingsen Yan, Yuhang Liu, Anton van den Hengel, Qinfeng Javen Shi · DOI

Introduction

Deep neural networks suffer from catastrophic forgetting: when trained on a sequence of tasks, they tend to overwrite weights learned for earlier tasks to accommodate new information. Existing approaches like regularization, experience replay, and dynamic architectures often fail to manage network capacity efficiently, leading to significant interference between tasks.

The proposed SNCL (Sparse neural Network for Continual Learning) framework addresses this by treating model capacity as a finite resource. By encouraging sparsity early on, the model "reserves" parameters for future learning, preventing the "painting into a corner" effect common in dense networks.

Conceptual comparison of SNCL against standard approaches. SNCL manages model capacity by learning compact representations for each task, leaving room for future growth.

Methodology: The SNCL Framework

SNCL integrates three core components to mitigate forgetting and representation drift:

  1. Variational Bayesian Sparsity (VBS): Instead of activating the entire network for every task, SNCL uses a Bayesian prior to enforce sparsity. It identifies and utilizes the most compact set of neurons necessary for the current task, effectively preserving the remaining capacity for future learning.
  2. Full Experience Replay (FER): Traditional experience replay only stores input-label pairs. FER extends this by archiving logits (raw scores) and intermediate layer features. During rehearsal, the model is penalized if its current internal representations for old data drift from the original "thought process" captured during initial training.
  3. Loss-aware Reservoir Sampling (LRS): To maximize the utility of the limited replay buffer, LRS selects a diverse set of samples based on their training loss values. This ensures the buffer contains both "easy" and "hard" examples, providing a more balanced curriculum for rehearsal.
The SNCL architecture. It combines Variational Bayesian Sparsity (VBS) to manage neuron activation with Full Experience Replay (FER) to anchor intermediate features and logits.

Key Insights

  • Sparsity as Resource Management: By being "lazy" and using fewer neurons for early tasks, the model avoids exhausting its capacity, which reduces interference when new tasks are introduced.
  • Deep Supervision via FER: Anchoring intermediate features provides supervision throughout the network's depth, not just at the output layer. This is critical for maintaining stable representations in deep architectures like ResNets.
  • Robustness through Flat Minima: Analysis shows that SNCL tends to converge to "flatter" regions of the loss landscape. These regions are inherently more robust to the parameter shifts that occur during sequential training, leading to better generalization.

Experimental Results

SNCL was evaluated on standard benchmarks including Sequential CIFAR-10, Tiny ImageNet, and MNIST-360.

  • Performance: On Sequential CIFAR-10 with a small 200-sample buffer, SNCL achieved 66.16% accuracy, outperforming the strong Dark Experience Replay (DER) baseline (61.93%).
  • Scalability: With a larger buffer (5120 samples), SNCL reached 90.41%, approaching the upper bound of joint training (92.20%) where the model sees all data at once.
  • Task-Agnostic Robustness: In the MNIST-360 setup—where task boundaries are undefined—SNCL improved state-of-the-art performance by 13%, demonstrating its effectiveness for real-world streaming data.

Conclusion

SNCL demonstrates that combining Bayesian sparsity with comprehensive representation anchoring significantly mitigates catastrophic forgetting. While current sparsity is managed at the neuron level, future work exploring structured or element-wise sparsity could further optimize resource allocation in complex continual learning scenarios.

Summary updated

BibTeX
@inproceedings{gong2022learning,
  author = {Dong Gong and Qingsen Yan and Yuhang Liu and Anton van den Hengel and Qinfeng Javen Shi},
  title = {{Learning Bayesian Sparse Networks with Full Experience Replay for Continual Learning}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2022},
  doi = {10.1109/cvpr52688.2022.00021},
}
Figure