Best-of-Both-Worlds Linear Contextual Bandits

Masahiro Kato, Shinji Ito

Abstract

In the field of online learning, algorithms are typically optimized for either stochastic environments, where rewards follow a fixed distribution, or adversarial environments, where rewards are chosen by an opponent. This paper introduces BoBW-RealFTRL, the first "Best-of-Both-Worlds" algorithm for linear contextual bandits. BoBW-RealFTRL automatically adapts to its environment, achieving fast, poly-logarithmic regret in stochastic settings and robust, square-root regret in adversarial or corrupted settings, without requiring prior knowledge of the environment type.

Introduction

Multi-armed bandit problems present a fundamental trade-off between exploration and exploitation. Traditionally, researchers design algorithms for two distinct regimes:

  1. Stochastic Environments: Rewards/losses follow a fixed, predictable distribution. The goal is "problem-dependent" regret that grows logarithmically over time.
  2. Adversarial Environments: An opponent can manipulate losses to deceive the algorithm. The goal is "problem-independent" regret that grows with the square root of time ($\sqrt{T}$).

The "Best-of-Both-Worlds" (BoBW) challenge is to develop a single strategy that performs optimally in both scenarios. While solutions exist for simpler bandit problems, the linear contextual bandit—where decisions are based on side information (contexts) and a linear relationship between context and loss—is significantly more complex. Previous linear contextual algorithms were specialized for only one regime; BoBW-RealFTRL bridges this gap.

Methodology: The BoBW-RealFTRL Algorithm

The proposed algorithm, BoBW-RealFTRL, integrates several advanced techniques to achieve its adaptive properties:

  • Follow-The-Regularized-Leader (FTRL): The algorithm minimizes the sum of past estimated losses plus a regularization term, rather than simply selecting the empirical best arm.
  • Shannon Entropy Regularization: By using negative Shannon entropy as the regularizer, the algorithm behaves like an "exponential weights" method, which is known for its effectiveness in both stochastic and adversarial regimes.
  • Matrix Geometric Resampling (MGR): Estimating the inverse covariance matrix of contexts is a major challenge in linear bandits because the algorithm's choices influence the contexts it observes. BoBW-RealFTRL employs MGR to generate unbiased loss estimators through simulation.
  • Adaptive Learning and Exploration: The algorithm dynamically updates its learning rate ($\beta_t$) and exploration rate ($\gamma_t$) based on the entropy of the current policy. This allows it to focus more aggressively in stable environments while maintaining robustness in volatile ones.

Theoretical Guarantees

The primary contribution of this work is the mathematical proof that BoBW-RealFTRL achieves optimal or near-optimal regret bounds across various settings. The algorithm's performance is characterized by a unified analysis using a corruption parameter ($C$), which bridges the gap between stochastic ($C=0$) and adversarial ($C=T$) environments.

Comparison of regret bounds between BoBW-RealFTRL and RealLinExp3 across different environments.

As shown in the table above, BoBW-RealFTRL provides a "safety net" for the decision-maker:

  • Stochastic Environment: It achieves $O\left(\frac{\log^3(T)}{\Delta_*}\right)$ regret, where $\Delta_*$ is the gap between the best and second-best arm. This "fast" regret indicates rapid convergence to the optimal policy.
  • Adversarial Environment: It achieves $O(\sqrt{T} \log^2(T))$ regret, matching the minimax optimal rate (up to logarithmic factors).
  • Corrupted Environments: In cases where an adversary partially corrupts a stochastic environment, the regret scales gracefully as $O\left(\frac{\log^3(T) + C \log^3(T)}{\Delta_*}\right)$.

Discussion and Future Work

While BoBW-RealFTRL represents a significant theoretical advancement, it has certain limitations. Currently, the algorithm requires the decision-maker to know the distribution of contexts beforehand, which may not be feasible in all real-world applications. Additionally, the analysis assumes a unique optimal arm with a constant minimum gap ($\Delta_*$).

Future research could focus on relaxing the requirement for a known context distribution and extending the analysis to more general "margin conditions" where the gap between arms can be arbitrarily small. Furthermore, exploring different regularizers, such as Tsallis entropy, might help reduce the poly-logarithmic factors in the regret bounds.

Summary updated

BibTeX
@article{kato2024best,
  author = {Masahiro Kato and Shinji Ito},
  title = {{Best-of-Both-Worlds Linear Contextual Bandits}},
  journal = {Trans. Mach. Learn. Res.},
  year = {2024},
  url = {https://openreview.net/forum?id=rlrFUl5Ign},
}
Figure