Continual learning models typically suffer from catastrophic forgetting unless they store massive amounts of old data. This paper introduces a novel method to create highly compact memory for logistic regression by matching the "Hessian" (curvature) of past losses using Probabilistic PCA. By storing learned memory vectors instead of raw data, the method achieves near-batch training accuracy using a tiny fraction of the memory.
The Challenge of Continual Learning
In continual learning (CL), a model learns a sequence of tasks over time. The fundamental challenge is catastrophic forgetting: as the model learns new information, it overwrites the weights that encoded past tasks.
To prevent this, researchers generally use two approaches:
- Weight Regularization: Penalize the model for changing weights that were important for past tasks. This is highly memory-efficient but often yields poor performance.
- Experience Replay: Store a subset of raw data from past tasks and mix it with new data. This performs much better but is highly memory-intensive, as the memory buffer grows with the number of tasks.
The holy grail of CL is to build a compact memory that achieves the performance of Experience Replay (or even full batch training) with the efficiency of weight regularization. While previous theoretical work proved that an "optimal" compact memory exists for simple models like logistic regression, computing it required access to all past data—defeating the purpose of continual learning. This paper bridges that gap by proposing a practical way to estimate this optimal memory on the fly.
Hessian-Matching via Probabilistic PCA
The authors build on the "Knowledge-adaptation prior" (K-prior), a framework that uses a small memory set to approximate the full-batch gradient of past tasks. Instead of storing raw data, the authors propose learning a set of unit-norm memory vectors and associated weights.
To update this memory as new tasks arrive without needing the old data, they formulate the problem as Hessian-matching. Essentially, they want the second-order derivatives (the Hessian) of the new memory to match the combined Hessian of the old memory and the new task data.
Because directly solving this via Singular Value Decomposition (SVD) can be numerically unstable, they cleverly reframe the Hessian-matching problem as Probabilistic Principal Component Analysis (PPCA). They solve this using an efficient Expectation-Maximization (EM) algorithm. The authors first derive this for linear regression and then mathematically extend it to binary and multi-class logistic regression.
Key Insights: Visualizing the Memory
- Gradient Reconstruction is All You Need: You don't actually need to store raw images to remember a task; you just need to accurately reconstruct the gradient of the loss from that task. By matching the Hessian, the learned memory vectors perfectly capture the geometric curvature of the past data distribution.
- Memories are "Merged" Features: When visualizing the learned memory vectors on image datasets (like USPS), they don't look like random noise or exact copies of training images. Instead, they look like distinct, merged archetypes of the data that evolve and compress as new tasks arrive.
- Shallow Methods, Deep Applications: While the math is constrained to logistic regression, the authors prove this is highly relevant for modern deep learning. By freezing a powerful foundation model (like a ViT) and applying this compact memory technique to the linear classification head, you can achieve state-of-the-art continual learning on complex datasets like ImageNet.
Performance and Results
The authors evaluated their method across a mix of toy, binary, and multi-class datasets, including Split-CIFAR and Split-ImageNet using frozen pre-trained feature extractors.
- Massive Efficiency Gains: On the massive Split-ImageNet-1000 benchmark, the proposed method achieved 60% accuracy using a memory size equivalent to just 0.3% of the data. Standard Experience Replay only achieved 30% accuracy with the same memory budget.
- Closing the Gap to Batch Training: By increasing the memory size to just 2% of the dataset on Split-ImageNet-1000, the method reached 74% accuracy, nearly matching the theoretical upper bound of full batch training (77.6%).
- Numerical Robustness: Compared to a vanilla SVD approach for updating memory, the PPCA/EM algorithm proved much more robust at preventing gradient reconstruction errors from accumulating over long sequences of tasks.
Limitations and Future Work
The primary limitation is that the mathematical formulation currently only applies to generalized linear models (like logistic regression) or the final layer of a neural network with a frozen feature extractor. It cannot yet be used to update the weights of deep, multi-layer networks end-to-end.
However, the authors view this as a vital stepping stone. By proving that highly compact, mathematically principled memory can be maintained for linear layers, they open a new pathway for finding compact memory solutions that allow large-scale foundation models to continually adapt to new tasks.
Summary updated