Abstract
We present a new adaptive algorithm for learning discrete distributions under distribution drift. In this setting, we observe a sequence of independent samples from a discrete distribution that is changing over time, and the goal is to estimate the current distribution. Since we have access to only a single sample for each time step, a good estimation requires a careful choice of the number of past samples to use. To use more samples, we must resort to samples further in the past, and we incur a drift error due to the bias introduced by the change in distribution. On the other hand, if we use a small number of past samples, we incur a large statistical error as the estimation has a high variance. We present a novel adaptive algorithm that can solve this trade-off without any prior knowledge of the drift. Unlike previous adaptive results, our algorithm characterizes the statistical error using data-dependent bounds. This technicality enables us to overcome the limitations of the previous work that require a fixed finite support whose size is known in advance and that cannot change over time. Additionally, we can obtain tighter bounds depending on the complexity of the drifting distribution, and also consider distributions with infinite support.
Introduction
In many real-world scenarios—such as tracking product popularity for online retailers or monitoring word frequencies in social media streams—the underlying probability distribution is dynamic, a phenomenon known as "distribution drift." Estimating the current state of such a distribution is challenging because typically only one sample is available per time step.
To obtain a reliable estimate, one must balance two competing sources of error:
- Statistical Error (Variance): Using too few samples leads to a noisy estimate.
- Drift Error (Bias): Using too many historical samples introduces "staleness" as the distribution evolves.
Previous state-of-the-art methods often required prior knowledge of the distribution's support size ($k$) and assumed it was fixed and finite. This is often unrealistic in practice where new items (e.g., new hashtags or products) appear constantly. This paper introduces an adaptive approach that moves beyond these constraints by utilizing data-dependent complexity measures.
Methodology
The proposed solution is an adaptive windowing algorithm. Instead of pre-selecting a fixed number of past samples, the algorithm iteratively evaluates different window sizes $r \in \{1, 2, 4, 8, \dots\}$.
The algorithm incorporates several key innovations:
- Data-Dependent Complexity: Rather than relying on a generic error bound based on a fixed support size $k$ (typically $O(\sqrt{k/r})$), the algorithm calculates a sharper measure of "learning complexity" ($\Lambda$) directly from the observed data. This allows for efficient estimation even when the total support is infinite or unknown, provided the distribution is "simple" (e.g., concentrated on a few items).
- Comparison Condition: At each iteration, the algorithm compares the empirical distribution of the current window to all previous, smaller windows. If the Total Variation (TV) distance between these estimates exceeds a threshold defined by the data-dependent complexity, the algorithm detects significant drift and terminates, returning the most reliable estimate.
- Zero-Knowledge Adaptivity: The algorithm requires no prior information regarding the drift rate or the cardinality of the distribution's support.
Theoretical Results
The validity of this approach is established through rigorous minimax analysis. The primary result, Theorem 2.1, proves that the algorithm's estimation error in terms of Total Variation distance is bounded by:
$$O\left( \min_{1 \le r \le T} \left[ \Lambda_r(\mu_T) + \sqrt{\frac{\text{log factors}}{r}} + \Delta_r \right] \right)$$
where $\Lambda_r(\mu_T)$ represents the distribution-dependent complexity and $\Delta_r$ is the maximum drift encountered within the window. This bound demonstrates that the algorithm automatically identifies the optimal "sweet spot" in the bias-variance trade-off for any arbitrary drifting discrete distribution.
A significant insight is that drift can be tied to changes in learning complexity. This allows the algorithm to remain robust even when the "shape" of the distribution changes drastically. Furthermore, the algorithm achieves an error rate that is nearly optimal, matching the minimax lower bound up to small logarithmic factors—the inherent "price" of adaptivity.
Conclusion and Future Work
This work provides a robust framework for learning discrete distributions in non-stationary environments without requiring prior knowledge of the support size or drift magnitude. However, several avenues for future research remain:
- Continuous Distributions: The current methodology is strictly for discrete distributions. Extending these data-dependent adaptive techniques to continuous densities is an open challenge.
- Logarithmic Overhead: Reducing the logarithmic penalty associated with adaptivity could further refine the error bounds.
- Empirical Validation: While theoretically sound, implementing the algorithm in real-time analytics engines would provide valuable insights into its performance against common heuristics like fixed-length sliding windows in practical settings.
Summary updated