Optimal Continual Learning has Perfect Memory and is NP-hard

Jeremias Knoblauch, Hisham Husain, Tom Diethe

Introduction

Continual Learning (CL) is notoriously difficult because of a phenomenon known as "catastrophic forgetting." When artificial neural networks learn new tasks, they tend to abruptly forget how to perform previous ones. While humans learn incrementally throughout their lives, AI models usually need to be retrained on all data simultaneously to maintain performance.

Sequential learning across multiple tasks.

This paper provides a rigorous theoretical explanation for why this happens: an optimal CL algorithm—one that never forgets—is mathematically equivalent to solving an NP-HARD problem and fundamentally requires perfect memory of past tasks. These findings explain why simple strategies like "experience replay" often outperform complex regularization techniques in practice.

The Problem: Limits of the Possible

The research community has developed dozens of strategies to fix catastrophic forgetting, including regularization, Bayesian priors, and memory buffers. However, the field has lacked a fundamental theoretical understanding of the "limits of the possible."

The authors ask a critical question: What computational properties must an optimal CL algorithm possess to avoid forgetting entirely?

Methods: The Set Intersection Framework

To answer this, the authors move away from specific neural network architectures and instead use the tools of set theory and computational complexity to analyze CL.

  1. Formalizing Optimality: They define an "optimal" CL algorithm as one that satisfies a performance criterion (like keeping loss below a certain threshold) for all tasks observed so far.
  2. Idealized CL: They introduce a simplified "oracle" version of CL where the algorithm knows exactly which parameters work for each task. This allows them to treat CL as a set intersection problem: finding a point in parameter space that lives in the intersection of "good" regions for Task 1, Task 2, ..., Task T.
Continual learning framed as finding the intersection of valid parameter sets.
  1. Complexity Reductions: To prove NP-Hardness, they show that finding this intersection is at least as hard as known NP-COMPLETE problems, such as determining if a set of tropical hypersurfaces or polytopes have a common intersection.
  2. Equivalence Sets: They define "perfect memory" not just as storing raw data, but as the ability to reconstruct at least one representative solution from every "equivalence class" of parameters that haven't been ruled out by previous tasks.

Key Insights and Ideas

  • CL is a Search Problem in Disappearing Spaces: Every new task provides a new constraint. To be optimal, you must find a tiny sliver of parameter space that satisfies every single constraint simultaneously.
  • The Hardness is Universal: The NP-Hardness isn't a quirk of neural networks; it's a property of the CL setting itself. Even for "comically simple" linear models with a basic error bound, the problem is computationally intractable.
  • Why Replay Wins: The paper provides a theoretically grounded confirmation for why methods using experience replay, episodic memory, and core sets usually beat regularization-based methods (like EWC). Replay-based methods are essentially trying to approximate "perfect memory," which the authors prove is a requirement for optimality. Regularization, by contrast, makes geometric assumptions about the parameter space that are often violated in the real world.
  • Heuristics are Inevitable: Since the optimal solution is NP-HARD, all existing CL algorithms should be viewed as polynomial-time heuristics. We shouldn't expect them to be perfect; we should evaluate them based on how well they approximate the NP-HARD intersection.

Key Results

  • Theorem 1 (Hardness): If the sets of valid parameters are complex enough (like tropical hypersurfaces or polytopes), finding an optimal CL solution is NP-HARD.
  • Theorem 2 (Memory): Under mild conditions, any optimal CL algorithm must have perfect memory. It cannot discard information about the "equivalence sets" of previous tasks without risking future failure.
  • Geometric Complexity: The authors show that even for simple linear models, the set of optimal solutions is an intersection of half-spaces (a polytope). Intersecting these over many tasks is what triggers the computational explosion.

Limitations and Future Work

  • The "Zero Forgetting" Constraint: The paper defines optimality as satisfying a criterion for all previous tasks. In practice, we often tolerate a small amount of forgetting. Future work could explore the complexity of "near-optimal" algorithms.
  • Approximation Guarantees: Since optimal CL is NP-HARD, the authors suggest the field should look toward the literature on approximation algorithms. Can we find CL heuristics that come with provable performance guarantees?
  • Task Distributions: The current proofs assume we don't know much about the relationship between tasks. If tasks are highly correlated or follow a specific distribution, the problem might become easier—a potential avenue for future theoretical research.

Summary updated

BibTeX
@inproceedings{knoblauch2020optimal,
  author = {Jeremias Knoblauch and Hisham Husain and Tom Diethe},
  title = {{Optimal Continual Learning has Perfect Memory and is NP-hard}},
  booktitle = {International Conference on Machine Learning},
  year = {2020},
  url = {https://openreview.net/forum?id=KU-lLxC1SyZ},
}
Figure