Fine-Grained Gradient Restriction: A Simple Approach for Mitigating Catastrophic Forgetting

Bo Liu, Mao Ye, Peter Stone, Qiang LiuarXiv 2024 · DOI

Introduction

In the field of Continual Learning (CL), neural networks are tasked with learning a sequence of distinct tasks without forgetting previously acquired knowledge. This requires a delicate balance between plasticity (the ability to integrate new information) and stability (the preservation of old information). A common failure mode is catastrophic forgetting, where new updates overwrite the weights essential for past tasks.

The Generalization Gap in Gradient Episodic Memory

A prominent solution is Gradient Episodic Memory (GEM), which stores a small subset of data from past tasks in an episodic memory buffer. During the training of a new task, GEM constrains the gradient update so that it does not increase the loss on the stored samples. However, because the buffer is a tiny fraction of the original dataset, a "generalization gap" exists: an update that appears safe on the buffer might still degrade performance on the full distribution of past tasks.

Proposed Method: Modular Gradient Episodic Memory (mGEM)

To address this gap, the authors propose Modular Gradient Episodic Memory (mGEM). Instead of a single global constraint, mGEM applies "fine-grained" restrictions to the update direction, effectively shrinking the search space to more conservatively protect past knowledge.

Comparison of search spaces for update directions in GEM vs. m-GEM.

The paper introduces two primary implementations:

  • Parameter-wise mGEM (p-mGEM): Constraints are applied independently to partitions of model parameters (e.g., specific layers).
  • Data-wise mGEM (d-mGEM): The episodic memory is split into multiple subsets, each requiring its own gradient constraint.

To ensure computational efficiency, the authors developed approx-GEM, which replaces the complex Quadratic Programming (QP) solver used in vanilla GEM with a closed-form solution using a diagonal matrix approximation. This allows the method to scale to large architectures like ResNet-18 with minimal overhead.

Experimental Results and Insights

The researchers evaluated mGEM across standard benchmarks (MNIST, Split CIFAR100) and challenging domain-shift datasets (Digit-Five, DomainNet).

The Pareto Frontier

A key contribution of this work is the analysis of the trade-off between forward transfer (learning speed) and backward transfer (retention). mGEM consistently pushes the Pareto frontier outward, allowing for better retention at the same level of learning performance compared to standard GEM.

The Pareto frontier of Forward Transfer (FWD) vs. Backward Transfer (BWD) for various mGEM configurations.

Key Findings:

  • Accuracy Improvements: On Split CIFAR100, mGEM variants improved average accuracy by nearly 2% over vanilla GEM.
  • Positive Backward Transfer: In complex domain-shift scenarios, certain mGEM configurations achieved positive backward transfer, where learning new tasks actually improved performance on previous ones.
  • Scalability: The approx-GEM variant maintains the performance gains of mGEM while remaining computationally competitive with standard GEM across various architectures including AlexNet and VGG.

Conclusion

mGEM provides a simple yet powerful refinement to memory-based continual learning. By recognizing and addressing the generalization gap through fine-grained constraints, it offers a more robust mechanism for maintaining stability without sacrificing the plasticity needed for sequential task acquisition.

Summary updated

BibTeX
@misc{liu2024fine,
  author = {Bo Liu and Mao Ye and Peter Stone and Qiang Liu},
  title = {{Fine-Grained Gradient Restriction: A Simple Approach for Mitigating Catastrophic Forgetting}},
  year = {2024},
  eprint = {2410.00868},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.00868},
}
Figure