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

An Adaptive Algorithm for Learning with Unknown Distribution Drift

Alessio Mazzetto, Eli Upfal

Abstract

Traditional machine learning models often rely on the assumption that training and testing data are independent and identically distributed (i.i.d.). However, in real-world applications such as financial forecasting or consumer behavior modeling, data distributions frequently shift over time—a phenomenon known as distribution drift. This paper presents a novel adaptive algorithm designed to handle non-stationary environments without prior knowledge of the drift's magnitude. By employing a doubling strategy and a discrepancy-based stopping criterion, the algorithm identifies the optimal window of historical data to minimize total error. Theoretical analysis demonstrates that this approach achieves performance nearly identical to an "oracle" that knows the drift rate in advance.

Introduction

In many practical machine learning scenarios, the underlying data-generating process is non-stationary. Whether due to seasonal changes, evolving user preferences, or structural market shifts, this "distribution drift" invalidates the standard i.i.d. assumption. To maintain accuracy, practitioners typically use a "sliding window" approach, training models only on recent data.

This approach introduces a fundamental trade-off. A small window minimizes "drift error" (the bias introduced by outdated data) but increases "statistical error" due to the limited sample size. Conversely, a large window reduces statistical variance but risks high drift error. The optimal window size depends on the drift magnitude (denoted as $\Delta$), which is rarely known in practice. This paper addresses the challenge of creating an algorithm that can adaptively find this "Goldilocks" window size without prior knowledge of $\Delta$.

The Bias-Variance Trade-off in Drifting Environments

When learning under drift, the total error of a model can be decomposed into two primary components:

  1. Statistical Error: The error resulting from having a finite number of samples. This decreases as the window size increases.
  2. Drift Error: The error resulting from the discrepancy between historical training data and the current distribution. This typically increases as the window size increases.

Existing methods often require an upper bound on the drift rate to set the window size. If this bound is too loose, the model suffers from sub-optimal performance. The goal of this research is to develop an algorithm that is "oblivious" to the drift rate yet remains competitive with the best possible fixed-window learner.

The Adaptive Learning Algorithm

The proposed Adaptive Learning Algorithm under Drift utilizes an elegant iterative process to balance the aforementioned trade-off. Instead of estimating the drift rate directly, the algorithm assesses the utility of older data through a sequence of statistical tests.

The Doubling Strategy and Comparison Test

The algorithm begins with a minimal window of recent samples ($r=1$) and iteratively doubles the window size ($r, 2r, 4r, \dots$). At each step, it performs a comparison test between the most recent $r$ samples and the preceding $r$ samples (forming a combined window of $2r$).

The Stopping Criterion and Discrepancy Norm

The algorithm continues to expand the window as long as the difference between the distributions of the two windows is small enough to be attributed to statistical noise. To measure this distance, the authors utilize a discrepancy norm tailored to the specific hypothesis class (e.g., linear regressors or binary classifiers).

If the discrepancy exceeds a calculated threshold, it signals that the older data is sufficiently different from the recent data to degrade model performance. At this point, the algorithm stops and returns the model trained on the current optimal window.

Theoretical Performance and Optimality

The paper provides rigorous mathematical guarantees for the algorithm's performance across various learning tasks, including binary classification (using VC-dimension) and linear regression (using squared loss).

  • Theorem 1 (Oracle Inequality): The main result proves that the algorithm’s error is guaranteed to be within a constant factor of the error achieved by an "oracle" algorithm that knows the exact drift magnitude in advance.
  • Minimax Optimality: Through Theorem 8, the authors establish a lower bound for binary classification, showing that the error rates achieved by their adaptive algorithm are essentially the best possible in a minimax sense.
  • Recovery of i.i.d. Rates: In the event that there is zero drift, the algorithm naturally expands to use all available data. It recovers standard i.i.d. learning rates with only a negligible logarithmic penalty for the adaptation process.

Practical Considerations

While the algorithm is theoretically robust, the authors address several practical implementation concerns:

  • Computability: For common tasks like linear regression, the discrepancy check can be reduced to a solvable optimization problem, such as a trust-region subproblem.
  • Approximation: A variant of the algorithm (Algorithm 2) is provided for cases where the distance between distributions can only be approximated, increasing its viability for complex models.
  • Label Requirements: A current limitation is the assumption that labels for all previous observations are available to perform the discrepancy checks.

Conclusion

This work provides a powerful framework for machine learning in changing environments. By replacing the need for prior knowledge of drift with an adaptive, data-driven stopping criterion, the algorithm offers a robust solution for real-world non-stationary problems. Future research may focus on reducing the computational overhead for complex hypothesis classes and developing distribution-dependent bounds to further refine the algorithm's sensitivity.

Summary updated

BibTeX
@inproceedings{mazzetto2023adaptive,
  author = {Alessio Mazzetto and Eli Upfal},
  title = {{An Adaptive Algorithm for Learning with Unknown Distribution Drift}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=exiXmAfuDK},
}
Figure