Improving Continual Learning by Accurate Gradient Reconstructions of the Past

Erik Daxberger, Siddharth Swaroop, Kazuki Osawa, Rio Yokota, Richard E Turner, José Miguel Hernández-Lobato, Mohammad Emtiyaz KhanTMLR 2023

Abstract

Weight-regularization and experience replay are two popular continual-learning strategies with complementary strengths: while weight-regularization requires less memory, replay can more accurately mimic batch training. How can we combine them to get better methods? Despite the simplicity of the question, little is known or done to optimally combine these approaches. In this paper, we present such a method by using a recently proposed principle of adaptation that relies on a faithful reconstruction of the gradients of the past data. Using this principle, we design a prior which combines two types of replay methods with a quadratic weight-regularizer and achieves better gradient reconstructions. The combination improves performance on standard task-incremental continual learning benchmarks such as Split-CIFAR, SplitTinyImageNet, and ImageNet-1000, achieving $>80\%$ of the batch performance by simply utilizing a memory of $<10\%$ of the past data. Our work shows that a good combination of the two strategies can be very effective in reducing forgetting.

Introduction: The Challenge of Catastrophic Forgetting

In continual learning, a model learns a sequence of tasks one after another. The ideal outcome is to perform as well as "Batch Joint" training, where all data from all tasks are available at once. However, deep neural networks suffer from catastrophic forgetting: as they learn a new task, they often overwrite the weights necessary for previous ones.

Researchers typically address this in two ways:

  1. Weight-regularization: Penalizing changes to "important" weights (e.g., Elastic Weight Consolidation). This is memory-efficient but often inaccurate.
  2. Experience Replay: Storing a small buffer of old examples to "rehearse." This is accurate but can be memory-intensive.

While many have tried to combine these, the combinations are often heuristic. This paper introduces a mathematically grounded framework to combine regularization and replay by framing the problem as a gradient reconstruction task.

Methods: A Principled Hybrid Approach

The authors build on the Knowledge-adaptation prior (K-prior), a framework suggesting that the best way to remember the past is to reconstruct the gradient of the past training data. They identify two specific sources of error in previous implementations: Memory Error (caused by missing data in the buffer) and Neural Network Error (caused by the model's inability to perfectly fit past data).

To address these, they propose a three-part "cocktail" called EWC+FR+Replay:

Comparison of previous continual learning methods with the proposed hybrid EWC+FR+Replay approach.
  • Modified EWC Weight Regularization: Uses a modified importance matrix that specifically accounts for the data not present in the memory buffer to avoid double-counting information.
  • Function Regularization (FR): Employs a distillation-like loss on the memory buffer to keep the model's outputs consistent with its past self.
  • Experience Replay: Uses actual labels for a subset of the memory buffer to correct for the model's past residuals.

By combining these, each component cancels out a specific type of mathematical error, leading to a much more faithful reconstruction of the past's gradients.

Key Results and Insights

The method was evaluated on Split-CIFAR, Split-TinyImageNet, and the large-scale ImageNet-1000 benchmark.

  • Approaching the Upper Bound: On Split-CIFAR, the method nearly matches "Batch Joint" performance when the memory size reaches 33% of the data.
  • Efficiency and Scalability: On ImageNet-1000, the method achieves >80% of batch performance while storing <10% of the past data. It successfully scaled to a ResNet-18 architecture, proving its viability for real-world tasks.
  • Complementary Strengths: A key insight is that EWC and Replay are mathematically complementary; EWC handles the "missing data" error, while Replay handles the "model fit" error.

Limitations and Future Work

The current work focuses on task-incremental learning, where the model knows which task it is performing at test time. Extending this to class-incremental learning (where task IDs are unknown) is a primary next step. Additionally, the authors suggest that more sophisticated "coreset" selection strategies for the memory buffer could further boost performance beyond the uniform random sampling used in this study.

Summary updated

BibTeX
@article{daxberger2023improving,
  author = {Erik Daxberger and Siddharth Swaroop and Kazuki Osawa and Rio Yokota and Richard E Turner and José Miguel Hernández-Lobato and Mohammad Emtiyaz Khan},
  title = {{Improving Continual Learning by Accurate Gradient Reconstructions of the Past}},
  journal = {Accepted by TMLR},
  year = {2023},
  url = {https://openreview.net/forum?id=b1fpfCjja1},
}
Figure