Continual Learning: Less Forgetting, More OOD Generalization via Adaptive Contrastive Replay

Hossein Rezaei, Mohammad Sabokrou · DOI

Abstract

Continual Learning (CL) aims to enable artificial intelligence to learn tasks sequentially without suffering from catastrophic forgetting. However, current rehearsal-based methods often lead to "bad memorization," where models overfit to specific buffer samples and fail to generalize to Out-of-Distribution (OOD) data. This paper introduces Adaptive Contrastive Replay (ACR), a novel framework that addresses these challenges through proxy-based contrastive learning and confidence-guided sample selection. By prioritizing "boundary samples"—informative examples near decision thresholds—ACR significantly enhances OOD generalization and reduces forgetting. Experimental results across three major benchmarks show that ACR outperforms state-of-the-art methods while requiring up to 9x less GPU memory.

1. Introduction

In the pursuit of artificial general intelligence, Continual Learning (CL) remains a critical hurdle. The primary challenge is the stability-plasticity dilemma: maintaining old knowledge (stability) while integrating new information (plasticity). Most existing solutions rely on "rehearsal," storing a small subset of previous data in a buffer. While effective for In-Distribution (IID) performance, these methods often result in brittle models that struggle with OOD samples—data with slight variations like noise, blur, or environmental changes. This research identifies "bad memorization" as a core cause of this brittleness and proposes a data-centric approach to improve both stability and generalization.

2. Adaptive Contrastive Replay (ACR)

The proposed ACR method rests on three innovative pillars designed to move beyond simple pixel-level memorization toward robust feature representation.

2.1 Proxy-Based Contrastive Loss

Traditional contrastive learning is computationally intensive, requiring pairwise comparisons between all samples. ACR utilizes "proxies"—representative weights for each class—to optimize the feature extractor and classifier simultaneously. This approach ensures better class separation and faster convergence without the heavy computational overhead of standard contrastive methods.

2.2 Confidence-Guided Sample Selection

Rather than selecting buffer samples at random, ACR focuses on boundary samples. These are identified by high variance in prediction confidence across training epochs. By ignoring easy samples (which the model already knows) and outliers (which may be noise), the model focuses its limited buffer capacity on the most informative examples that define the borders between classes.

2.3 Balanced Buffer Management

To prevent the model from developing a bias toward recent tasks or dominant classes, ACR enforces a strict, task-aware, and class-aware buffer structure. This ensures a perfectly balanced representation of the model's entire history, maintaining a level playing field for all learned categories.

The ACR framework utilizes task and class balancing alongside confidence-guided selection to maintain robust decision boundaries.

3. Experimental Evaluation

The method was evaluated on three standard CL benchmarks: Split CIFAR-100, Split Mini-ImageNet, and Split Tiny-ImageNet. To assess OOD generalization, the researchers applied 15 types of corruptions (e.g., Gaussian noise, motion blur, snow) to the test sets, following the Hendrycks & Dietterich methodology. This rigorous testing environment highlights the difference between rote memorization and true feature understanding.

4. Results and Discussion

ACR consistently outperformed eight major baselines, including GEM, ER, and MetaSP, across all evaluated metrics.

4.1 Performance and Generalization

As shown in the figure below, ACR achieved substantial gains in OOD generalization. Specifically, it outperformed the next best methods by 13.41% on Split CIFAR-100 and 9.91% on Split Mini-ImageNet. Even on standard IID data, ACR maintained a 6.0% lead over the second-best method on CIFAR-100. These results suggest that by focusing on boundary samples, the model learns more resilient features that are less susceptible to environmental noise.

OOD Generalization performance of ACR compared to state-of-the-art baselines across three benchmarks.

4.2 Computational Efficiency

Efficiency is a key advantage of the ACR framework. Compared to top-tier baselines like MetaSP, ACR required roughly 9x less GPU memory. This efficiency stems from the proxy-based approach, which avoids the quadratic complexity of standard contrastive learning, making it highly viable for resource-constrained real-world applications.

5. Conclusion

Adaptive Contrastive Replay (ACR) represents a significant step forward in Continual Learning by shifting the focus from quantity to quality in data rehearsal. By prioritizing boundary samples and utilizing efficient proxy-based learning, ACR achieves superior generalization and reduced forgetting. Future work will explore the method's sensitivity to hyperparameter tuning and its performance in "blurry" task transitions where class boundaries are not clearly defined.

Summary updated

BibTeX
@misc{rezaei2024continual,
  author = {Hossein Rezaei and Mohammad Sabokrou},
  title = {{Continual Learning: Less Forgetting, More OOD Generalization via Adaptive Contrastive Replay}},
  year = {2024},
  eprint = {2410.07110},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.07110},
}
Figure