Abstract
An important problem in machine learning is the ability to learn tasks in a sequential manner. If trained with standard first-order methods most models forget previously learned tasks when trained on a new task, which is often referred to as catastrophic forgetting. A popular approach to overcome forgetting is to regularize the loss function by penalizing models that perform poorly on previous tasks. For example, elastic weight consolidation (EWC) regularizes with a quadratic form involving a diagonal matrix build based on past data. While EWC works very well for some setups, we show that, even under otherwise ideal conditions, it can provably suffer catastrophic forgetting if the diagonal matrix is a poor approximation of the Hessian matrix of previous tasks. We propose a simple approach to overcome this: Regularizing training of a new task with sketches of the Jacobian matrix of past data. This provably enables overcoming catastrophic forgetting for linear models and for wide neural networks, at the cost of memory. The overarching goal of this paper is to provided insights on when regularization-based continual learning algorithms work and under what memory costs.
Introduction
In sequential machine learning, "catastrophic forgetting" occurs when a model trained on a sequence of tasks loses its ability to perform earlier tasks upon learning new ones. To mitigate this, regularization-based methods add a penalty to the loss function, discouraging parameter shifts that would degrade performance on previous tasks.
The ideal penalty utilizes the Hessian matrix of the loss, which identifies sensitive directions in the parameter space. However, for modern neural networks, the full Hessian is computationally prohibitive to store. Popular methods like Elastic Weight Consolidation (EWC) rely on a diagonal approximation of the Hessian, assuming parameter independence. This paper demonstrates that such approximations are often too weak for complex task sequences and introduces Regularization with Sketched Jacobians (RSJ) to provide a more robust, theoretically grounded alternative.
Methodology: Regularization with Sketched Jacobians
RSJ offers a middle ground between the simplicity of diagonal approximations and the prohibitive cost of the full Hessian. The approach is built on two key pillars:
- The Jacobian-Hessian Connection: The Hessian can be effectively approximated by the outer product of the Jacobian matrix (the first derivatives of the model's outputs).
- Sketching via Random Projections: To manage memory, RSJ uses a Gaussian random projection matrix to "sketch" the Jacobian. Instead of storing the full $N \times P$ matrix (where $N$ is the number of data points and $P$ is the number of parameters), RSJ stores a compressed version that preserves essential parameter interactions.
Using the Neural Tangent Kernel (NTK) framework, the authors prove that for sufficiently wide networks, RSJ keeps the model close to the optimal "joint training" solution—the performance achieved if all tasks were trained simultaneously.
Experimental Results
The method was evaluated on standard benchmarks including Permuted MNIST and Incremental MNIST. The latter is significantly more challenging as it requires the model to distinguish between all learned classes without task-specific identifiers at test time.
On the Incremental MNIST task, EWC's performance collapses as more tasks are added. In contrast, RSJ variants stay nearly on par with joint training. Similar advantages are seen in linear models where weight interactions are critical.
Discussion: Why Benchmarks Can Be Misleading
A significant insight from this work is the explanation of EWC's success on Permuted MNIST. The authors prove that if task features are nearly orthogonal—a condition often satisfied by Permuted MNIST—even simple $L_2$ or diagonal penalties can perform well. This suggests that Permuted MNIST may be a misleading benchmark for evaluating a method's ability to handle complex parameter interactions in real-world scenarios.
RSJ acknowledges the trade-off between memory and performance. While it requires more memory than EWC (storing $s$ vectors of size $P$), the paper provides a concrete bound on the error, showing it can be controlled by adjusting the sketch dimension $s$.
Conclusion
RSJ provides the first theoretical guarantees for continual learning in both linear models and wide neural networks. While the current implementation relies on the NTK regime and has a larger memory footprint than diagonal methods, it offers a provably stable path forward for sequential learning. Future work will focus on scaling these sketched approximations to massive, multi-billion parameter vision and language models.
Summary updated