Latent spectral regularization for continual learning

Emanuele Frascaroli, Riccardo Benaglia, Matteo Boschini, Luca Moschella, Cosimo Fiorini, Emanuele Rodolà, Simone Calderara · DOI

Continual Learning (CL) aims to enable artificial neural networks to learn from a stream of tasks sequentially. However, these models typically suffer from "catastrophic forgetting," where learning new information leads to the abrupt loss of previously acquired knowledge. While rehearsal-based methods—which store a small subset of past data in a buffer to "replay" during training—have become the standard approach to mitigate this, they often fail to maintain distinct boundaries between classes over time.

The Challenge of Latent Entanglement

The authors identify a critical failure mode in existing rehearsal methods: as the model encounters new tasks, the latent representations (the internal features) of different classes begin to drift and overlap. This "latent entanglement" makes it increasingly difficult for the final classification layer to distinguish between old and new classes, even when old samples are replayed from memory. This phenomenon can be quantified using "Label-Signal Variation," which the authors prove grows steadily in standard rehearsal methods, indicating that the model's internal "map" becomes increasingly disorganized.

CaSpeR-IL: A Geometric Solution

To address this, the authors propose CaSpeR-IL (Continual Spectral Regularizer for Incremental Learning). Unlike traditional regularizers that focus on the absolute coordinates of latent vectors, CaSpeR-IL focuses on the intrinsic geometry of the latent space, making it invariant to rotations or translations.

The method operates in three primary stages:

  1. Latent Geometry Graph (LGG): For each training batch, a k-Nearest Neighbor (k-NN) graph is constructed where nodes represent latent vectors and edges represent the similarity between them.
  2. Spectral Partitioning: Using spectral graph theory, the model computes the normalized Laplacian of this graph. A key property of the Laplacian is that its eigenvalues reflect the connectivity of the graph; specifically, the number of eigenvalues near zero corresponds to the number of distinct clusters.
  3. Eigengap Maximization: CaSpeR-IL introduces a loss function designed to minimize the first $g$ eigenvalues (where $g$ is the number of classes) and maximize the $(g+1)$-th eigenvalue. This mathematical approach maximizes the "eigengap," providing a strong signal that the latent space is partitioned into $g$ well-separated, non-overlapping clusters.

To maintain computational efficiency, the authors utilize a Monte Carlo approximation. Instead of building a graph for the entire memory buffer, they sample small, class-balanced sub-graphs during each training step, significantly reducing the computational burden.

Experimental Evaluation

CaSpeR-IL was evaluated as a "plug-and-play" module across several standard benchmarks, including Split CIFAR-10, Split CIFAR-100, Split miniImageNet, and Rotated MNIST. When integrated with top-tier baselines like DER++, iCaRL, ER-ACE, and X-DER, CaSpeR-IL consistently improved performance.

Key results include:

  • Accuracy Gains: On Split CIFAR-100 with a buffer size of 500, adding CaSpeR-IL to the DER++ baseline increased final average accuracy from 28.01% to 32.16%.
  • Retention: Metrics for "Final Average Adjusted Forgetting" showed a marked decrease when the regularizer was active, confirming that the model was successfully retaining knowledge from earlier tasks.
  • Spectral Robustness: Unlike contrastive losses (such as InfoNCE) which often require large batches or many views to be effective, spectral properties are robust to "coarsening," allowing CaSpeR-IL to remain effective even with small memory buffers.

Limitations and Future Directions

While effective, CaSpeR-IL does introduce a computational overhead of approximately 33-43% due to the additional forward passes and eigendecomposition steps. Furthermore, as a rehearsal-based method, it requires the storage of raw data, which may pose privacy concerns in sensitive domains like healthcare.

Future research may explore the application of CaSpeR-IL to large-scale pre-trained transformers, which are increasingly prevalent in the field of Continual Learning, to see if spectral regularization can further stabilize their high-dimensional latent spaces.

Summary updated

BibTeX
@article{frascaroli2024latent,
  author = {Emanuele Frascaroli and Riccardo Benaglia and Matteo Boschini and Luca Moschella and Cosimo Fiorini and Emanuele Rodolà and Simone Calderara},
  title = {{Latent spectral regularization for continual learning}},
  journal = {Pattern Recognition Letters},
  year = {2024},
  doi = {10.1016/j.patrec.2024.06.020},
}
Figure