Task Agnostic Continual Learning Using Online Variational Bayes

Chen Zeno, Itay Golan, Elad Hoffer, Daniel Soudry · DOI

Abstract

Catastrophic forgetting—the tendency of neural networks to overwrite previous knowledge when learning new data—remains a significant hurdle for AI agents in dynamic environments. While most continual learning research assumes explicit task boundaries are provided during training, real-world scenarios often lack such signals. We introduce Bayesian Gradient Descent (BGD), a method for task-agnostic continual learning that treats weights as probability distributions. By leveraging online Variational Bayes, BGD automatically scales learning rates based on weight uncertainty, effectively preserving critical knowledge without requiring task-specific labels or boundary information.

The Challenge of Task-Agnostic Learning

Standard neural networks excel at static tasks but struggle with a sequence of changing data distributions. In "task-aware" setups, algorithms like Elastic Weight Consolidation (EWC) or Synaptic Intelligence (SI) are told exactly when a task changes, allowing them to freeze important weights. However, in realistic settings—such as a robot navigating a changing environment—distribution shifts are often gradual or unannounced.

Taxonomy of continual learning scenarios.

As shown in the taxonomy above, the "task-agnostic" scenario represents a more challenging and realistic frontier where the model must manage its own knowledge retention without external guidance.

Bayesian Gradient Descent (BGD)

BGD reformulates training as a Bayesian inference problem. Instead of point-estimate weights, the model maintains a distribution for each weight, typically a diagonal Gaussian defined by a mean $\mu$ and a standard deviation $\sigma$.

Key Mechanisms:

  1. Online Variational Bayes: The posterior distribution from the previous training step serves as the prior for the current step, creating a natural mechanism for continuous integration of information.
  2. Uncertainty-Driven Learning Rates: BGD derives a closed-form update rule where the learning rate for each weight is proportional to its variance ($\sigma^2$). Weights with low uncertainty (small $\sigma$) are updated slowly to protect "consolidated" knowledge, while high-uncertainty weights (large $\sigma$) adapt quickly to new data.
  3. The "Labels Trick": In class-incremental scenarios (e.g., learning digits 0-1 then 2-3), BGD can infer task context by observing which labels are present in a training batch. This simple heuristic prevents the model from erroneously updating output heads for unseen classes, significantly improving performance in class-learning settings.

Experimental Results

The authors evaluated BGD against standard optimizers and state-of-the-art task-aware methods across benchmarks like Permuted MNIST, Split MNIST, and complex vision datasets (CIFAR10/100).

Performance comparison on Permuted MNIST.

On the Permuted MNIST benchmark with 10 tasks, BGD maintained an average accuracy of approximately 93%, significantly outperforming standard optimizers like Adam (~80%) and SGD (~78%) which suffered from rapid forgetting. Notably, BGD achieved these results without any knowledge of task boundaries, performing on par with "task-aware" competitors like Synaptic Intelligence (SI) and Variational Continual Learning (VCL).

Conclusion and Limitations

BGD demonstrates that task-agnostic continual learning is achievable by treating weight uncertainty as a fundamental signal for plasticity. While the method effectively mitigates catastrophic forgetting and scales to deep architectures like VGG, it introduces a computational trade-off. BGD requires roughly 10x more computation due to Monte Carlo sampling and doubles the memory footprint to store both means and variances. Future work may explore non-Gaussian distributions or more efficient covariance approximations to further enhance flexibility and efficiency.

Summary updated

BibTeX
@misc{zeno2018task,
  author = {Chen Zeno and Itay Golan and Elad Hoffer and Daniel Soudry},
  title = {{Task Agnostic Continual Learning Using Online Variational Bayes}},
  year = {2018},
  eprint = {1803.10123},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1803.10123},
}
Figure