Unlearning-based sliding window for continual learning under concept drift

Michal Wozniak, Marek Klonowski, Maciej Maczyński, Bartosz Krawczyk

Abstract

Traditional machine learning assumes a stationary data distribution, yet many real-world applications operate on nonstationary streams in which the underlying concept evolves over time. This problem can also be viewed as task-free continual learning under concept drift, where a model must adapt sequentially without explicit task identities or task boundaries. In such settings, effective learning requires both rapid adaptation to new data and forgetting of outdated information. A common solution is based on a sliding window, but this approach is often computationally demanding because the model must be repeatedly retrained from scratch on the most recent data. We propose a different perspective based on machine unlearning. Instead of rebuilding the model each time the active window changes, we remove the influence of outdated samples using unlearning and then update the model with newly observed data. This enables efficient, targeted forgetting while preserving adaptation to evolving distributions. To the best of our knowledge, this is the first work to connect machine unlearning with concept drift mitigation for task-free continual learning. Empirical results on image stream classification across multiple drift scenarios demonstrate that the proposed approach offers a competitive and computationally efficient alternative to standard sliding-window retraining.

Introduction

In real-world data streams, the underlying distribution often changes over time—a phenomenon known as concept drift. To maintain performance, models must perform "task-free continual learning," adapting to new patterns without explicit signals regarding when a change occurred.

The standard approach for handling this is the sliding window: the model is trained only on the most recent $L$ chunks of data. However, this is computationally expensive. Every time a new chunk arrives, the oldest one is dropped, and the model is typically retrained from scratch on the remaining window to ensure it is not biased by obsolete data. As window size or model complexity increases, this retraining becomes a massive bottleneck. This paper introduces UIL (Unlearned and Iteratively trained cLassifier), a framework that replaces the "retrain-from-scratch" step with targeted machine unlearning.

The UIL Framework

Overview of the UIL framework, illustrating the transition from initial window filling to the sliding window unlearning phase.

UIL treats forgetting not as a privacy requirement, but as an optimization strategy. The process is divided into two primary phases:

  1. Phase A: Initial Training: The model $\psi$ is trained incrementally as the first $L$ chunks of the data stream arrive, filling the sliding window.
  2. Phase B: Sliding Window Unlearning: Once the window is full ($k \ge L$), the model maintains a fixed window size through a two-step update process:
  3. The Unlearning Step: Instead of resetting the model, UIL uses an approximate unlearning algorithm (based on Influence Functions or approximate Newton steps) to surgically remove the mathematical influence of the oldest data chunk ($DS_{k-L}$) from the current model weights.
  4. The Incremental Step: The model then performs a few epochs of standard gradient descent on the newest data chunk ($DS_k$).

This "unlearn-then-train" approach decouples the update cost from the history length. Unlike traditional sliding windows where cost scales linearly with window size ($L$), UIL’s cost is independent of window size, making it significantly more scalable for long-term stream monitoring.

Theoretical Stability

The authors provide a mathematical proof showing that the error introduced by this approximate unlearning remains bounded. In stationary environments, incremental training acts as a "restoring force." Even if the unlearning step introduces slight algorithmic noise, the subsequent training on new (but similar) data pulls the model back toward the global optimum, preventing the model from drifting into chaos over time.

Experimental Evaluation

The researchers evaluated UIL using a ResNet18 backbone on two primary image stream benchmarks:

  • MNIST (Noise Drift): Simulated drift by toggling between clean images and images with 50% Gaussian noise.
  • Fashion-MNIST (Semantic Drift): A scenario where target classes change (e.g., shifting from one set of clothing categories to another).

Key Results

  • Efficiency: UIL reduced per-batch processing time from ~6.5 seconds (standard sliding window) to ~2.1 seconds—a roughly 3x speedup.
  • Memory: UIL consistently utilized slightly less memory per batch than the retraining baseline.
  • Drift Recovery: On MNIST noise drift, UIL recovered its performance in 6.33 chunks, significantly faster than the 17 chunks required for the standard sliding window. This suggests that surgically removing old information can be more effective for adaptation than starting over with a blank slate.
  • Stability: Experiments confirmed that for most learning rates, the model did not suffer from "catastrophic forgetting" or error accumulation over hundreds of data chunks.

Discussion and Future Work

While UIL shows great promise, it faced more challenges with "semantic drift" (Fashion-MNIST) than "noise drift" (MNIST). This suggests that approximate unlearning is currently more adept at handling low-level feature changes than high-level structural changes in data.

Future research directions include:

  • Dynamic Unlearning: Integrating drift detectors to dynamically scale unlearning intensity—accelerating forgetting when a shift is detected and pausing it during stable periods.
  • Hybrid Regularization: Combining unlearning with techniques like Elastic Weight Consolidation (EWC) to further mitigate noise during the incremental training phase.
  • Periodic Anchoring: Implementing periodic full retrains ("anchors") to reset any potential long-term error accumulation in very long-lived deployments.

Summary updated

Abstract

Traditional machine learning assumes a stationary data distribution, yet many real-world applications operate on nonstationary streams in which the underlying concept evolves over time. This problem can also be viewed as task-free continual learning under concept drift, where a model must adapt sequentially without explicit task identities or task boundaries. In such settings, effective learning requires both rapid adaptation to new data and forgetting of outdated information. A common solution is based on a sliding window, but this approach is often computationally demanding because the model must be repeatedly retrained from scratch on the most recent data. We propose a different perspective based on machine unlearning. Instead of rebuilding the model each time the active window changes, we remove the influence of outdated samples using unlearning and then update the model with newly observed data. This enables efficient, targeted forgetting while preserving adaptation to evolving distributions. To the best of our knowledge, this is the first work to connect machine unlearning with concept drift mitigation for task-free continual learning. Empirical results on image stream classification across multiple drift scenarios demonstrate that the proposed approach offers a competitive and computationally efficient alternative to standard sliding-window retraining. Our implementation can be found at \hrehttps://anonymous.4open.science/r/MUNDataStream-60F3}{https://anonymous.4open.science/r/MUNDataStream-60F3}.
BibTeX
@misc{wozniak2026unlearning,
  author = {Michal Wozniak and Marek Klonowski and Maciej Maczyński and Bartosz Krawczyk},
  title = {{Unlearning-based sliding window for continual learning under concept drift}},
  year = {2026},
  eprint = {2603.14484},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.14484},
}

Loading related content...

Figure