Abstract
The use of episodic memory in continual learning has demonstrated effectiveness for alleviating catastrophic forgetting. In recent studies, gradient-based approaches have been developed to make more efficient use of compact episodic memory. Such approaches refine the gradients resulting from new samples by those from memorized samples, aiming to reduce the diversity of gradients from different tasks. In this paper, we clarify the relation between diversity of gradients and discriminativeness of representations, showing shared as well as conflicting interests between Deep Metric Learning and continual learning, thus demonstrating pros and cons of learning discriminative representations in continual learning. Based on these findings, we propose a simple method -- Semi-Discriminative Representation Loss (SDRL) -- for continual learning. In comparison with state-of-the-art methods, SDRL shows better performance with low computational cost on multiple benchmark tasks in the setting of online continual learning.
Introduction
In Online Continual Learning (OCL), models must learn from a non-stationary stream of data, encountering each sample only once. The central hurdle is catastrophic forgetting, where learning new information leads to the erasure of previously acquired knowledge. Traditional solutions often employ an "episodic memory" buffer to replay old samples. Gradient-based methods further refine this by ensuring that updates from new data do not conflict with the gradients of stored samples—specifically, by maintaining a non-negative inner product between them. However, these methods are computationally prohibitive for large networks as they require calculating and storing high-dimensional gradient vectors for every parameter.
The Source of Gradient Conflict
A key contribution of this work is identifying why certain samples produce conflicting gradients. The authors demonstrate that gradient conflict (negative inner products) is strongly correlated with the similarity of internal representations between different classes. Samples located near decision boundaries are particularly prone to causing these conflicts.
By shifting the focus from raw gradients to low-dimensional feature embeddings, the authors propose a more efficient way to manage forgetting.
Semi-Discriminative Representation Loss (SDRL)
The proposed Semi-Discriminative Representation Loss (SDRL) operates directly on feature embeddings rather than parameter gradients. It consists of two primary terms:
- Between-class loss ($L_{bt}$): This term minimizes the similarity between representations of different classes. By increasing the separation between classes in the feature space, SDRL reduces gradient diversity and conflict, facilitating the learning of new tasks without overwriting old ones.
- Within-class loss ($L_{wi}$): This is the "Semi-Discriminative" aspect. While standard Deep Metric Learning seeks maximum compactness (making same-class samples as similar as possible), SDRL intentionally minimizes similarity within a class. This prevents the "Compactness Trap," where the model discards features that are irrelevant for current classification but might be essential for future tasks (e.g., distinguishing a "3" from an "8" later on).
To support this loss, the authors use Balanced Experience Replay (BER), a sampling strategy that ensures training batches contain a diverse mix of classes and at least one "positive pair" (same class) to satisfy the $L_{wi}$ requirement.
Experimental Results
SDRL was evaluated against standard benchmarks including Permuted MNIST, Split MNIST, Split CIFAR-10/100, and Split TinyImageNet.
Accuracy and Forgetting
SDRL consistently outperformed state-of-the-art methods like A-GEM and GSS. On the challenging Split CIFAR-100 task, SDRL achieved 19.3% average accuracy, surpassing A-GEM's 16.5%. Furthermore, it significantly reduced forgetting; on Split Fashion-MNIST, SDRL's forgetting rate was only 16.6%, compared to 37.0% for A-GEM.
Computational Efficiency
The most significant advantage of SDRL is its speed. Because it operates on low-dimensional embeddings ($H$) rather than the full parameter space ($W$), where $H \ll W$, it avoids the heavy overhead of gradient projections. On a ResNet18 CIFAR-10 benchmark, SDRL completed training in approximately 265 seconds, nearly four times faster than A-GEM (~1,067s) and twenty times faster than GSS (~5,289s).
Conclusion
SDRL offers a lightweight yet powerful alternative to gradient-based OCL methods. By optimizing representations to be semi-discriminative—separating classes while maintaining internal diversity—it effectively mitigates catastrophic forgetting with minimal computational cost. Future work may extend this approach to unsupervised settings and explore more sophisticated memory management strategies.
Summary updated