A Model or 603 Exemplars: Towards Memory-Efficient Class-Incremental Learning

Da-Wei Zhou, Qi-Wei Wang, Han-Jia Ye, De-Chuan Zhan

In the rapidly evolving field of machine learning, Class-Incremental Learning (CIL) stands as a critical challenge: how can a model learn new concepts over time without suffering from "catastrophic forgetting" of what it previously knew?

Traditionally, researchers have fought this by saving a small "memory" of representative images (exemplars) from old classes. Recently, a new trend has emerged: saving entire versions of the model from previous time steps. While these model-based methods show impressive accuracy, they often cheat the system by not counting the massive memory footprint of these stored weights.

A new paper from ICLR 2023, "A Model or 603 Exemplars: Towards Memory-Efficient Class-Incremental Learning," tackles this head-on, proposing a fairer way to measure progress and a clever new architecture to maximize every byte of memory.

TL;DR

This paper introduces a fair evaluation framework for CIL by unifying model parameters and stored data into a single memory budget. The authors propose MEMO (Memory-efficient Expandable MOdel), which shares generalized shallow layers across tasks and only expands specialized deep layers, outperforming state-of-the-art methods under strict memory constraints.

What Problem Does This Paper Address?

The core issue is unfair comparison. In CIL, you have a limited memory budget. You can use that budget to store images (exemplars) or model weights (backbones).

Previous "model-based" methods like DER (Dynamically Expandable Representation) achieved high accuracy by adding a new backbone for every new task. However, they didn't count these extra backbones against their memory limit. The authors point out a startling trade-off: one ResNet32 model takes up as much memory as 603 CIFAR-100 images.

If you give an older method like iCaRL an extra 603 images instead of an extra model, its performance jumps significantly. This paper asks: given a fixed total budget, what is the best way to allocate it between models and data?

Methods

The researchers approached this through two main contributions:

  1. Fair Comparison Framework: They align all methods to the same total memory budget $S_{total} = S_{model} + S_{exemplars}$. By varying this budget, they can see which strategies work best at different scales.
  2. MEMO (Memory-efficient Expandable MOdel): The authors analyzed how different layers of a neural network behave during incremental learning. They found that shallow layers learn "generalized" features that don't change much between tasks, while deep layers learn "specialized" features that are highly task-specific.
Figure 4: MEMO strikes a trade-off between exemplar and model buffer by sharing generalized blocks.

Instead of saving a whole new backbone for every task, MEMO shares the generalized blocks and only creates a new specialized block for each new task. This "partial expansion" saves significant memory, which is then re-allocated to store more exemplars, providing the best of both worlds.

Datasets

The authors evaluated their approach on standard CIL benchmarks:

  • CIFAR-100: 100 classes of small images.
  • ImageNet-100/1000: Large-scale image classification datasets.
  • ASC (Aspect Sentiment Classification): A natural language processing dataset used to verify that their findings generalize beyond computer vision.

Key Insights and Ideas

  • The "Intersection" Point: The paper reveals that model-based methods aren't always superior. As shown in Figure 1, there is an intersection point: saving models is less effective when the total budget is tight, but becomes more effective as the budget grows.
Figure 1: The average accuracy of different methods by varying memory size from small to large. The start point corresponds to the memory size of exemplar-based methods with benchmark backbone (WA (Zhao et al., 2020), iCaRL (Rebuffiet al., 2017), Replay (Chaudhry et al., 2019)), and the endpoint corresponds to the memory cost of model-based methods with benchmark backbone (DER (Yan et al., 2021) and MEMO (our proposed method)). We align the memory cost by using the small model for model-based methods or adding exemplars for exemplar-based methods. ‘Base’ stands for the number of classes in the first task, and ‘Inc’ represents the number of classes in each incremental new task. See Section 4.1 and 4.2 for more details.
  • Not All Layers are Equal: Using Centered Kernel Alignment (CKA), the authors proved that shallow features across different task-specific backbones are highly similar (redundant), while deep features are diverse. This justifies sharing the "generalized" base of the network.
  • Stability-Plasticity Trade-off: Freezing the specialized blocks of old tasks turns them into "unforgettable checkpoints." Interestingly, whether you should freeze the generalized blocks depends on the initial task size; if the first task is large enough (e.g., >20 classes), freezing the base helps stability.

Key Results

MEMO consistently outperformed existing SOTA methods like iCaRL, WA, and DER when compared under the same memory budget.

  • Efficiency: On CIFAR-100, MEMO achieved higher accuracy than DER while using significantly less model memory, allowing it to store thousands more exemplars.
  • Scalability: The performance gap often widened as more tasks were added, proving that MEMO's memory-saving strategy scales better than full-model expansion.
  • Generalization: The layer-wise shift observations held true for Vision Transformers (ViT) and BERT, suggesting that the "share shallow, expand deep" principle is a fundamental characteristic of deep learning in incremental settings.

Limitations and Future Work

While MEMO is a significant step forward, the authors note a few areas for further exploration:

  • Scope: The study focuses primarily on methods that use extra memory (exemplars or model buffers). It doesn't deeply explore "data-free" CIL methods.
  • Orthogonal Techniques: The paper doesn't integrate advanced model compression like pruning or quantization. The authors suggest that combining MEMO with these techniques is a promising direction for even more extreme memory efficiency.
  • Ethical Constraints: Storing exemplars can raise privacy concerns in sensitive applications (e.g., medical data). Future work might need to balance memory efficiency with privacy-preserving learning.

By forcing a "fair fight" between algorithms, this paper provides a much-needed reality check for the CIL community and offers a practical, efficient path forward for deploying AI in resource-constrained, ever-changing environments.

Summary updated

BibTeX
@inproceedings{zhou2023model,
  author = {Da-Wei Zhou and Qi-Wei Wang and Han-Jia Ye and De-Chuan Zhan},
  title = {{A Model or 603 Exemplars: Towards Memory-Efficient Class-Incremental Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=S07feAlQHgM},
}
Figure