Bayesian Nonparametric Weight Factorization for Continual Learning

Nikhil Mehta, Kevin J. Liang, Lawrence CarinarXiv 2020

Abstract

Naively trained neural networks tend to experience catastrophic forgetting in sequential task settings, where data from previous tasks are unavailable. A number of methods, using various model expansion strategies, have been proposed recently as possible solutions. However, determining how much to expand the model is left to the practitioner, and often a constant schedule is chosen for simplicity, regardless of how complex the incoming task is. Instead, we propose a principled Bayesian nonparametric approach based on the Indian Buffet Process (IBP) prior, letting the data determine how much to expand the model complexity. We pair this with a factorization of the neural network's weight matrices. Such an approach allows the number of factors of each weight matrix to scale with the complexity of the task, while the IBP prior encourages sparse weight factor selection and factor reuse, promoting positive knowledge transfer between tasks. We demonstrate the effectiveness of our method on a number of continual learning benchmarks and analyze how weight factors are allocated and reused throughout the training.

Introduction

Deep learning models typically struggle with continual learning, where a sequence of tasks is learned one after another. In these scenarios, models often suffer from catastrophic forgetting, where learning new information overwrites previously acquired knowledge. While regularization and model expansion are common strategies to mitigate this, expansion methods often rely on fixed, manual schedules (e.g., adding a set number of neurons per task). This "Expansion Dilemma" highlights the need for a principled approach where the model's growth is dictated by the complexity and requirements of the incoming data.

The IBP-WF Framework

To address these challenges, we introduce IBP-WF (Indian Buffet Process - Weight Factors). This framework leverages two core components: weight factorization and a Bayesian nonparametric prior.

Weight Factorization

Instead of learning a full weight matrix $W$ for every task, we decompose it into shared dictionaries and task-specific selection matrices: $W_t = W_a \Lambda_t W_b$. Here, $W_a$ and $W_b$ represent a library of weight factors shared across all tasks, while $\Lambda_t$ is a task-specific diagonal matrix that selects and weights these factors. This formulation allows the model to represent weights as a weighted sum of rank-1 matrices, facilitating both reuse and expansion.

The IBP-WF framework factorizes weight matrices and uses an IBP prior to manage growth and reuse across tasks.

The Indian Buffet Process Prior

The Indian Buffet Process (IBP) serves as the "Bayesian Nonparametric" engine. In this analogy, tasks (customers) select weight factors (dishes) from an infinite buffet. The IBP prior naturally encourages sparsity and the reuse of "popular" factors, promoting positive knowledge transfer. Crucially, it allows the number of factors to grow sublinearly, ensuring the model expands only as much as necessary based on the data.

Experimental Evaluation

We evaluated IBP-WF on standard benchmarks, including Split MNIST, Permuted MNIST, and Split CIFAR10.

Performance and Efficiency

IBP-WF demonstrates state-of-the-art performance, matching or exceeding non-replay baselines like EWC, SI, and MAS. On Permuted MNIST, IBP-WF achieved 97.5% accuracy in the challenging Incremental Class setting, significantly outperforming standard regularization methods.

Results on Split and Permuted MNIST show that IBP-WF achieves high accuracy with sublinear parameter growth compared to fixed expansion schedules.

A key advantage of IBP-WF is its parameter efficiency. As shown in the results, the model adds more factors during early tasks and fewer as it builds a robust library of reusable features. This "harmonic" growth contrasts with traditional methods that grow linearly with the number of tasks.

Task Inference and Knowledge Transfer

At test time, the model can infer the task ID by analyzing the distribution of activations in hidden layers. While this inference is highly accurate for MNIST (99.9%), performance on more complex datasets like CIFAR10 (43.6%) indicates a need for more sophisticated inference mechanisms for natural images.

Conclusion

IBP-WF provides a principled, data-driven solution to the expansion dilemma in continual learning. By combining weight factorization with the IBP prior, the model achieves a balance between stability and plasticity, effectively reusing knowledge while minimizing forgetting. Future work will explore improving task inference for complex datasets and enabling backward transfer by allowing controlled updates to shared factors.

Summary updated

BibTeX
@misc{mehta2020bayesian,
  author = {Nikhil Mehta and Kevin J. Liang and Lawrence Carin},
  title = {{Bayesian Nonparametric Weight Factorization for Continual Learning}},
  year = {2020},
  eprint = {2004.10098},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2004.10098},
}
Figure