Abstract
Continual learning (CL) in deep neural networks is fundamentally limited by catastrophic forgetting, where the acquisition of new knowledge leads to the abrupt loss of previously learned information. While existing approaches utilize weight-based regularization or gradient constraints, these methods often suffer from excessive rigidity or high computational complexity. This paper introduces Embedding Regularization (ER), a method that preserves past knowledge by regularizing the network's internal representations (embeddings). By maintaining a minimal memory buffer and employing a dynamic sampling strategy based on cosine distance, ER achieves state-of-the-art performance on image classification benchmarks. Notably, ER provides a significant reduction in memory and computational overhead, offering a nearly 3x speedup over gradient-based methods like GEM.
Introduction
Deep learning models typically operate under the assumption of stationary data distributions. When presented with sequential tasks—such as learning to classify animals (Task A) followed by vehicles (Task B)—networks tend to overwrite the weights optimized for Task A to accommodate Task B. This phenomenon, known as catastrophic forgetting, remains a primary hurdle for true artificial general intelligence.
To mitigate this, researchers have developed several strategies. Weight-based regularization methods, such as Elastic Weight Consolidation (EWC) and Synaptic Intelligence (SI), penalize changes to parameters deemed important for previous tasks. However, these can be overly restrictive, hindering the model's ability to learn new information. Alternatively, functional regularization methods like Learning without Forgetting (LwF) focus on output probabilities, while gradient-based methods like Gradient Episodic Memory (GEM) constrain weight updates to ensure they do not increase the loss of previous tasks. GEM, while effective, requires solving complex Quadratic Programming (QP) problems at every training step, leading to poor scalability. This paper proposes Embedding Regularization (ER) as a highly efficient "sweet spot" between these approaches.
Methodology
Embedding Regularization (ER)
Instead of focusing on individual weights or final output layers, ER regularizes the activations of the second-to-last layer—the embeddings. The core intuition is that if the high-level feature representations of old tasks remain stable, the network can still perform well on those tasks even if the underlying weights are adjusted for new objectives.
The ER framework consists of three primary components:
- Minimal Memory Buffer: The system stores a small subset of past examples. Each entry in the buffer includes the input image, its task ID, and the original embedding generated by the network at the time the task was first learned.
- Regularization Loss: During training on a new task, the network samples from this buffer. The current network processes the old images to generate new embeddings. A penalty is then applied based on the cosine distance between the original stored embedding and the current embedding.
- Dynamic Distance Sampling: To maximize the utility of the small buffer, the authors implement a dynamic sampling strategy. Rather than uniform sampling, the system prioritizes examples whose current embeddings have drifted the furthest from their original state, focusing computational effort on the knowledge most at risk of being forgotten.
Architectural Considerations
The authors also explored the impact of architectural flexibility on continual learning by testing ER on standard Neural Networks and "Kafnets." Kafnets utilize Kernel Activation Functions—trainable, non-parametric activation functions—to provide more representational power.
Experimental Setup
The proposed method was evaluated on three standard image classification benchmarks adapted for sequential learning:
- Permuted MNIST: A sequence of four tasks where pixels of the MNIST digits are subjected to different random permutations.
- Split CIFAR-10: The 10-class dataset is divided into five sequential tasks, with two classes per task.
- Split CIFAR-100: A more challenging benchmark where 100 classes are divided into 10 sequential tasks.
Results and Discussion
Performance and Efficiency
ER demonstrated superior performance across all benchmarks, achieving an average accuracy of 71.23%. This outperformed GEM (69.19%), Synaptic Intelligence (58.91%), and EWC (57.94%).
Beyond accuracy, ER proved to be exceptionally efficient. It reached peak performance with a memory buffer of only approximately 100 images per task. In terms of computational speed, ER avoids the heavy QP solvers required by GEM. On the Split CIFAR-100 benchmark, ER completed training in approximately 1,500 seconds, compared to 4,456 seconds for GEM—a nearly 3x improvement in training velocity.
The Flexibility Paradox
An interesting finding emerged regarding the use of Kafnets. While one might assume that more flexible, trainable activation functions would assist in accommodating new tasks, the results showed that Kafnets actually hindered continual learning. The activation functions themselves were subject to catastrophic forgetting, suggesting that simply increasing parameter flexibility without targeted regularization can exacerbate the forgetting problem.
Conclusion
Embedding Regularization offers a robust and efficient solution for continual learning in neural networks. By focusing on the stability of internal representations rather than individual weights or gradients, ER achieves high accuracy with minimal memory and computational costs. While the method currently requires a small rehearsal buffer—which may not be suitable for all privacy-sensitive applications—it sets a new standard for efficient sequential learning. Future research will focus on combining ER with weight consolidation techniques and exploring auxiliary objectives that allow for adaptation without direct rehearsal.
Summary updated