Online Learning and Unlearning

Yaxi Hu, Bernhard Schölkopf, Amartya SanyalarXiv 2025

Abstract: We formalize the problem of online learning-unlearning, where a model is updated sequentially in an online setting while accommodating unlearning requests between updates. After a data point is unlearned, all subsequent outputs must be statistically indistinguishable from those of a model trained without that point. We present two online learner-unlearner (OLU) algorithms, both built upon online gradient descent (OGD). The first, passive OLU, leverages OGD's contractive property and injects noise when unlearning occurs, incurring no additional computation. The second, active OLU, uses an offline unlearning algorithm that shifts the model toward a solution excluding the deleted data. Under standard convexity and smoothness assumptions, both methods achieve regret bounds comparable to those of standard OGD, demonstrating that one can maintain competitive regret bounds while providing unlearning guarantees.

Introduction: The Online Unlearning Dilemma

Most machine unlearning research focuses on the "offline" scenario: a model is trained on a static dataset, and a request later arrives to remove a specific point. However, modern systems like recommendation engines or financial predictors operate in an online fashion, learning from a continuous stream of data.

In this online setting, unlearning is significantly more complex. Once a deletion request arrives, the model has already incorporated that point into its state, influencing every subsequent update. True "unlearning" requires that all future outputs be statistically indistinguishable from a model that never encountered the deleted point. The challenge is to provide this privacy guarantee without compromising accuracy or resorting to expensive full retraining.

Proposed Framework: Online Learner-Unlearner (OLU)

The authors propose two primary strategies built upon Online Gradient Descent (OGD) to address this challenge:

Passive OLU

Passive OLU exploits a fundamental property of OGD known as contraction. This property implies that the influence of any single past data point naturally diminishes over time as the model converges toward newer data. When a deletion request occurs, the algorithm calculates the remaining "trace" of that point and injects a calibrated amount of Gaussian noise to mask it. This method is computationally efficient, requiring zero extra overhead beyond standard learning.

Visualization of the contraction property where the influence of a deleted point fades over time.

Active OLU

Active OLU takes a more proactive approach by employing an auxiliary "descent-to-delete" procedure. Upon receiving a deletion request, the algorithm performs additional gradient steps to actively shift the model’s parameters toward a state that excludes the deleted data. While this incurs a small computational cost, it reduces the amount of noise required, potentially leading to higher accuracy (lower regret).

Theoretical Insights: Contraction and Trade-offs

A key insight of this work is that the mathematical stability required for efficient learning is the same property that enables unlearning. Because OGD is contractive, the "error" introduced by a deleted point shrinks over time. Consequently, less noise is needed to hide a deletion if it occurs long after the point was first seen.

This reveals a fundamental computation-noise trade-off:

  • Passive OLU offers "free" unlearning at the cost of higher noise.
  • Active OLU provides "cleaner" unlearning (less noise) in exchange for a computational "tax" in the form of extra gradient steps.

Furthermore, unlike standard Differential Privacy (DP) approaches—which often have regret bounds scaling poorly with the number of dimensions ($d$)—these OLU methods focus specifically on protecting deleted points. This focus allows for regret bounds where the learning error component is independent of $d$.

Key Results

The OLU algorithms achieve sub-linear regret, ensuring the model continues to learn effectively while satisfying unlearning guarantees.

Comparison of OLU algorithms (Passive and Active) against baselines like retraining and Online DP.

As summarized in the table above:

  • Strongly Convex (SC) Losses: Both Passive and Active OLU achieve a regret of $O(\log T + k^2d)$, matching the optimal rate of standard OGD plus a penalty for $k$ deletions.
  • General Convex (C) Losses: Passive OLU achieves $O(\sqrt{T} + k^2d)$, matching the standard $O(\sqrt{T})$ rate.
  • Efficiency: Passive OLU adds no computational overhead, while Active OLU adds only a logarithmic overhead ($O(\log \tau)$) per deletion.

Limitations and Future Work

While promising, the current framework has limitations. Active OLU relies on strong convexity to ensure rapid convergence to the retrained state, making its application to non-convex models like deep neural networks an open question. Additionally, the analysis assumes an "oblivious" adversary; future work should explore performance against "adaptive" adversaries who adjust their strategy based on model outputs. Finally, establishing theoretical lower bounds for online unlearning regret remains a key objective for the field.

Summary updated

BibTeX
@misc{hu2025online,
  author = {Yaxi Hu and Bernhard Schölkopf and Amartya Sanyal},
  title = {{Online Learning and Unlearning}},
  year = {2025},
  eprint = {2505.08557},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.08557},
}
Figure