Hessian Aware Low-Rank Weight Perturbation for Continual Learning

Jiaqi Li, Rui Wang, Yuanhao Lai, Changjian Shui, Sabyasachi Sahoo, Charles X. Ling, Shichun Yang, Boyu Wang, Christian Gagné, Fan Zhou

Abstract

Continual learning aims to learn a series of tasks sequentially without forgetting the knowledge acquired from the previous ones. In this work, we propose the Hessian Aware Low-Rank Perturbation (HALRP) algorithm for continual learning. By modeling the parameter transitions along the sequential tasks with the weight matrix transformation, we propose to apply the low-rank approximation on the task-adaptive parameters in each layer of the neural networks. Specifically, we theoretically demonstrate the quantitative relationship between the Hessian and the proposed low-rank approximation. The approximation ranks are then globally determined according to the marginal increment of the empirical loss estimated by the layer-specific gradient and low-rank approximation error. Furthermore, we control the model capacity by pruning less important parameters to diminish the parameter growth. We conduct extensive experiments on various benchmarks, including a dataset with large-scale tasks, and compare our method against some recent state-of-the-art methods to demonstrate the effectiveness and scalability of our proposed method. Empirical results show that our method performs better on different benchmarks, especially in achieving task order robustness and handling the forgetting issue.

Introduction

In the field of Artificial Intelligence, Continual Learning (CL) represents the challenge of enabling models to learn tasks sequentially without suffering from Catastrophic Forgetting (CF). Standard neural networks typically overwrite weights optimized for previous tasks when learning new ones, leading to a sharp decline in performance on earlier data. This creates a "stability-plasticity dilemma": models must be plastic enough to acquire new knowledge but stable enough to retain old information.

Existing approaches generally fall into three categories: regularization, expansion, and replay. However, these often suffer from performance degradation over long task sequences, "parameter explosion," or privacy concerns. HALRP introduces a middle ground by modeling task transitions as efficient low-rank weight updates guided by second-order Hessian information.

Methodology: Hessian Aware Low-Rank Perturbation

The core of the HALRP framework is Low-Rank Weight Perturbation (LRWP). Rather than retraining the entire weight matrix $W$ for a new task, the method decomposes the weights into a shared base and task-specific components:

$$W_{new} = R \cdot W_{base} \cdot S + B$$

  • $W_{base}$: The knowledge from the initial task, which remains frozen to prevent forgetting.
  • $R, S$: Small task-private diagonal matrices that scale rows and columns.
  • $B$: A sparse, low-rank matrix capturing task-specific nuances.
Schematic of the HALRP framework showing weight decomposition and low-rank perturbation.

Hessian-Guided Rank Selection

The novelty of HALRP lies in its "Hessian Aware" rank selection. Not all layers in a network are equally sensitive to updates. Using Theorem 1, the authors relate the change in the model's loss function to the Hessian matrix (the curvature of the loss landscape). By approximating the Hessian using the gradient's outer product, the algorithm calculates a sensitivity score for every layer. This allows for a global allocation of parameters, assigning higher ranks to sensitive layers where updates significantly improve performance and lower ranks to robust layers to maintain efficiency.

Experimental Setup

HALRP was evaluated across a diverse set of benchmarks to test its versatility and scalability:

  • CIFAR100-Split & SuperClass: Standard classification split into 10 or 20 tasks.
  • Permuted MNIST (P-MNIST): 10 tasks with randomly shuffled pixels.
  • Five-dataset: A heterogeneous mix including MNIST, FashionMNIST, and SVHN.
  • Omniglot Rotation: A massive test involving 100 sequential tasks.
  • TinyImageNet: A large-scale dataset split into 20 or 40 tasks.

Results and Discussion

HALRP demonstrates state-of-the-art performance across all tested benchmarks. On CIFAR100-Split, it outperformed existing methods like GPM and WSN by 1% to 3%. Its advantage is even more pronounced in data-scarce environments; with only 5% of training data available per task, HALRP maintained a lead of approximately 8% over competitors.

Performance comparison across P-MNIST, Five-dataset, Omniglot, and TinyImageNet benchmarks.

Key Insights

  • Scalability and Efficiency: In the 100-task Omniglot benchmark, HALRP maintained high accuracy while requiring significantly less GPU memory (under 4GB) compared to expansion methods like APD, which can require up to 80GB.
  • Order Robustness: The method shows remarkably low performance disparity regardless of the order in which tasks are presented.
  • Minimal Forgetting: Backward transfer statistics were near zero or positive, indicating that learning new tasks occasionally improved performance on older ones.

Conclusion

HALRP provides a mathematically grounded solution to catastrophic forgetting by leveraging Hessian information to guide low-rank weight updates. While the method currently relies on a strong base model from the first task and involves the computational overhead of SVD during task transitions, its superior accuracy and parameter efficiency make it a robust candidate for real-world continual learning applications. Future work may extend this approach to modern architectures like Transformers and Large Language Models.

Summary updated

Abstract

Continual learning aims to learn a series of tasks sequentially without forgetting the knowledge acquired from the previous ones. In this work, we propose the Hessian Aware Low-Rank Perturbation algorithm for continual learning. By modeling the parameter transitions along the sequential tasks with the weight matrix transformation, we propose to apply the low-rank approximation on the task-adaptive parameters in each layer of the neural networks. Specifically, we theoretically demonstrate the quantitative relationship between the Hessian and the proposed low-rank approximation. The approximation ranks are then globally determined according to the marginal increment of the empirical loss estimated by the layer-specific gradient and low-rank approximation error. Furthermore, we control the model capacity by pruning less important parameters to diminish the parameter growth. We conduct extensive experiments on various benchmarks, including a dataset with large-scale tasks, and compare our method against some recent state-of-the-art methods to demonstrate the effectiveness and scalability of our proposed method. Empirical results show that our method performs better on different benchmarks, especially in achieving task order robustness and handling the forgetting issue. A demo code can be found at https://github.com/lijiaqi/HALRP.
BibTeX
@article{li2024hessian,
  author = {Jiaqi Li and Rui Wang and Yuanhao Lai and Changjian Shui and Sabyasachi Sahoo and Charles X. Ling and Shichun Yang and Boyu Wang and Christian Gagné and Fan Zhou},
  title = {{Hessian Aware Low-Rank Weight Perturbation for Continual Learning}},
  journal = {IEEE Trans. Knowl. Data Eng.},
  year = {2024},
  doi = {10.1109/tkde.2024.3419449},
}
Figure