NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Provable Contrastive Continual Learning

Yichen Wen, Zhiquan Tan, Kaipeng Zheng, Chuanlong Xie, Weiran Huang

Abstract

Continual Learning (CL) aims to train models on a sequence of tasks without suffering from catastrophic forgetting. While Contrastive Continual Learning (CCL) has demonstrated significant empirical success by combining contrastive losses with knowledge distillation, a rigorous theoretical understanding of its performance has been lacking. This paper provides the first theoretical guarantees for CCL, proving that the final model's performance is bounded by a linear combination of previous training losses. Based on these insights, we introduce CILA (Contrastive Incremental Learning with Adaptive distillation), an algorithm that adaptively tunes distillation coefficients to balance the preservation of old knowledge with the acquisition of new features. Our experiments demonstrate that CILA achieves state-of-the-art results across standard benchmarks.

Introduction

In the field of artificial intelligence, the ability to learn incrementally is a hallmark of biological intelligence. However, artificial neural networks typically suffer from catastrophic forgetting, where learning new information abruptly erases previously acquired knowledge. Contrastive Continual Learning (CCL) has emerged as a powerful paradigm to mitigate this. By utilizing contrastive loss to learn robust representations and knowledge distillation to maintain consistency with previous model iterations, CCL has set new benchmarks in performance.

Despite these practical gains, the underlying mechanics of CCL remained poorly understood. Specifically, there was no mathematical proof ensuring that minimizing these specific losses would guarantee performance across an entire sequence of tasks. This research bridges that gap by providing a theoretical foundation for CCL and leveraging those insights to develop a more robust, adaptive learning algorithm.

Theoretical Framework: Bridging Contrastive and Distillation Losses

The core contribution of this work is the derivation of rigorous performance bounds for CCL. The authors establish Lemma 1, which serves as a mathematical "bridge" connecting the contrastive losses of two consecutive models through the distillation loss.

This lemma is expanded into Theorem 1, which provides both upper and lower bounds for the final test loss. The theorem demonstrates that the final model's error is constrained by a linear combination of the training losses from every task in the sequence.

The Significance of the Initial Task

A key insight from these theoretical bounds is the disproportionate influence of the very first task. The math reveals that the loss on the initial task significantly impacts the tightness of the performance bounds for all subsequent tasks. This provides a formal justification for the empirical success of pre-training in continual learning: a strong, stable foundation established early on creates a tighter bound, effectively limiting the potential for forgetting later in the sequence.

The CILA Algorithm

Guided by the theoretical finding that the ideal weight for remembering the past (the distillation coefficient, $\lambda$) is not a universal constant, the authors developed CILA (Contrastive Incremental Learning with Adaptive distillation).

Adaptive Distillation

Traditional methods often use a fixed $\lambda$ (typically $\lambda=1$). However, CILA recognizes that the optimal balance between stability (preserving old tasks) and plasticity (learning new tasks) depends on the specific data distribution of the current task relative to the past.

CILA calculates an adaptive $\lambda_t$ for each task by monitoring the ratio between average distillation losses and average contrastive losses from previous tasks. If the model begins to struggle with retention, CILA automatically increases the distillation weight to prioritize stability. This mechanism allows the model to find the "turning point" where it maintains the best possible performance across the entire task sequence.

Experimental Evaluation

The researchers evaluated CILA against several leading baselines, including DER++ and Co2L, across three standard continual learning benchmarks:

  1. Seq-CIFAR-10: 5 tasks (2 classes each), testing Class-Incremental Learning (Class-IL).
  2. Seq-Tiny-ImageNet: 10 tasks (20 classes each), a more complex Class-IL challenge.
  3. R-MNIST (Rotated MNIST): 20 tasks with varying rotations, testing Domain-Incremental Learning (Domain-IL).

Key Results

CILA achieved new state-of-the-art (SOTA) results across all tested scenarios:

  • Seq-CIFAR-10: CILA reached 67.06% accuracy (200-sample buffer), outperforming Co2L's 65.57%.
  • Seq-Tiny-ImageNet: In the 500-sample buffer setting, CILA achieved 20.64% accuracy, significantly leading all baselines.
  • Robustness: The adaptive nature of CILA proved more resilient to changes in buffer size and task complexity than methods relying on fixed hyperparameters.

Discussion and Limitations

While this work provides a breakthrough in the theoretical understanding of contrastive frameworks, certain limitations remain. The current evaluation follows a "pre-train then linear probe" protocol; future research should investigate how these bounds apply when the entire backbone is fine-tuned simultaneously. Additionally, while the adaptive coefficient is "easily computed," it does introduce a minor layer of complexity to the training loop. Finally, extending this provable approach beyond contrastive loss to other forms of regularization or generative replay remains an open and promising challenge.

Conclusion

By providing the first theoretical guarantees for Contrastive Continual Learning, this paper transforms CCL from an empirical heuristic into a mathematically grounded framework. The resulting CILA algorithm demonstrates that theoretical insights can directly lead to superior practical performance, offering a more stable and adaptive path forward for incremental machine learning.

Summary updated

BibTeX
@inproceedings{wen2024provable,
  author = {Yichen Wen and Zhiquan Tan and Kaipeng Zheng and Chuanlong Xie and Weiran Huang},
  title = {{Provable Contrastive Continual Learning}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=V3ya8RlbrW},
}
Figure