Efficient Contextual Bandits in Non-stationary Worlds

Haipeng Luo, Alekh Agarwal, John Langford

Abstract

Most contextual bandit algorithms minimize regret against the best fixed policy, a benchmark that fails in non-stationary environments where user preferences or reward distributions change over time. This work develops several efficient contextual bandit algorithms for non-stationary environments by equipping existing methods for i.i.d. problems with sophisticated statistical tests to dynamically adapt to distribution changes. We analyze various regret notions, including interval, switching, and dynamic regret. Our algorithms achieve near-optimal regret bounds, such as $O(\sqrt{ST})$ for $S$ stationary periods or $O(\Delta^{1/3}T^{2/3})$ for non-stationarity measure $\Delta$, matching inefficient baselines. We also introduce a parameter-free algorithm that improves upon existing results for simpler bandit problems.

Introduction

In the classic Contextual Bandit problem, an algorithm observes a context (e.g., a user profile), chooses an action (e.g., showing an ad), and receives a reward. Most existing algorithms assume a stationary environment where underlying reward probabilities remain constant. However, real-world applications like news recommendation or seasonal retail involve shifting trends and evolving user interests.

In these non-stationary environments, the goal shifts from competing with a single fixed policy to competing with the best policy at every moment. This presents two major challenges:

  1. Statistical: Detecting distribution shifts with only partial feedback (rewards are only seen for chosen actions).
  2. Computational: Maintaining efficiency without tracking an exponential or infinite set of policies.

Adaptive Algorithms for Non-Stationary Worlds

The authors propose a family of "ADA" (Adaptive) algorithms that build upon stationary contextual bandit methods by integrating a NONSTATTEST procedure. This test monitors performance across different time intervals; if it detects that a different policy would have performed significantly better recently, the algorithm assumes a distribution shift and restarts its learning process.

Key Algorithm Variants:

  • ADA-GREEDY and ADA-ILTCB: These wrap base algorithms (like EPOCH-GREEDY or ILOVETOCONBANDITS) with the change-detection test. They are Oracle Efficient, meaning they reduce the bandit problem to a series of supervised learning problems, allowing them to handle large policy classes efficiently.
  • ADA-BINGREEDY: A more advanced, parameter-free version. Unlike other methods that require knowing the "budget" of non-stationarity (e.g., the number of shifts $S$), ADA-BINGREEDY uses a bin-based exploration strategy to adapt automatically.

Theoretical Results and Performance

This research establishes rigorous mathematical regret bounds for the proposed algorithms. A key insight is that if an algorithm can guarantee low regret on any stationary interval, it can be mathematically extended to handle complex scenarios like switching regret (discrete changes) and dynamic regret (continuous drift).

Comparison of regret bounds for various algorithms across different non-stationarity metrics.

As shown in the table above, the efficient ADA-ILTCB algorithm achieves a regret bound of $O(\Delta^{1/3}T^{2/3})$, which nearly matches the performance of Exp4.S, a classic but computationally inefficient baseline. Furthermore, ADA-BINGREEDY achieves a regret of $\min\{S^{1/4}T^{3/4}, \Delta^{1/5}T^{4/5}\}$ without prior knowledge of $S$ or $\Delta$, significantly improving upon previous results limited to two-armed bandits.

Limitations and Future Directions

While these algorithms provide strong theoretical guarantees, they currently rely on a "restart" mechanism that discards all previous learning upon detecting a change. Future work could explore "long-term memory" to recognize and reuse previously seen distributions. Additionally, while oracle-efficient, practical performance depends on the speed of the underlying optimization oracle. The statistical tests also involve constants that may require empirical tuning for specific real-world applications.

Summary updated

Abstract

Most contextual bandit algorithms minimize regret against the best fixed policy, a questionable benchmark for non-stationary environments that are ubiquitous in applications. In this work, we develop several efficient contextual bandit algorithms for non-stationary environments by equipping existing methods for i.i.d. problems with sophisticated statistical tests so as to dynamically adapt to a change in distribution. We analyze various standard notions of regret suited to non-stationary environments for these algorithms, including interval regret, switching regret, and dynamic regret. When competing with the best policy at each time, one of our algorithms achieves regret $\mathcal{O}(\sqrt{ST})$ if there are $T$ rounds with $S$ stationary periods, or more generally $\mathcal{O}(\Delta^{1/3}T^{2/3})$ where $\Delta$ is some non-stationarity measure. These results almost match the optimal guarantees achieved by an inefficient baseline that is a variant of the classic Exp4 algorithm. The dynamic regret result is also the first one for efficient and fully adversarial contextual bandit. Furthermore, while the results above require tuning a parameter based on the unknown quantity $S$ or $\Delta$, we also develop a parameter free algorithm achieving regret $\min\{S^{1/4}T^{3/4}, \Delta^{1/5}T^{4/5}\}$. This improves and generalizes the best existing result $\Delta^{0.18}T^{0.82}$ by Karnin and Anava (2016) which only holds for the two-armed bandit problem.
BibTeX
@inproceedings{luo2018efficient,
  author = {Haipeng Luo and Alekh Agarwal and John Langford},
  title = {{Efficient Contextual Bandits in Non-stationary Worlds}},
  booktitle = {Conference on Learning Theory},
  year = {2018},
  url = {https://openreview.net/forum?id=c7vbNN3Ob9D},
}
Figure