Contexts can be Cheap: Solving Stochastic Contextual Bandits with Linear Bandit Algorithms

Osama A. Hanna, Lin F. Yang, Christina Fragouli

Abstract

In this paper, we address the stochastic contextual linear bandit problem, where a decision maker is provided a context (a random set of actions drawn from a distribution). The expected reward of each action is specified by the inner product of the action and an unknown parameter. The goal is to design an algorithm that learns to play as close as possible to the unknown optimal policy after a number of action plays. This problem is considered more challenging than the linear bandit problem, which can be viewed as a contextual bandit problem with a fixed context. Surprisingly, in this paper, we show that the stochastic contextual problem can be solved as if it is a linear bandit problem. In particular, we establish a novel reduction framework that converts every stochastic contextual linear bandit instance to a linear bandit instance, when the context distribution is known. When the context distribution is unknown, we establish an algorithm that reduces the stochastic contextual instance to a sequence of linear bandit instances with small misspecifications and achieves nearly the same worst-case regret bound as the algorithm that solves the misspecified linear bandit instances. As a consequence, our results imply a $O(d\sqrt{T\log T})$ high-probability regret bound for contextual linear bandits, making progress in resolving an open problem. Our reduction framework opens up a new way to approach stochastic contextual linear bandit problems, and enables improved regret bounds in a number of instances including the batch setting, contextual bandits with misspecifications, contextual bandits with sparse unknown parameters, and contextual bandits with adversarial corruption.

Introduction

In the field of multi-armed bandits, a traditional hierarchy of difficulty exists between standard linear bandits and contextual linear bandits. Linear bandits involve selecting actions from a fixed set to maximize a reward that is a linear function of an unknown parameter $\theta_\star$. Contextual linear bandits are generally considered more complex because the learner observes a changing set of available actions (a context) at every time step. Historically, this has led to a persistent theoretical "gap," where contextual models often suffer from additional logarithmic factors in regret bounds due to the difficulty of exploration in dynamic action spaces.

This research challenges the notion that contexts necessarily increase complexity. By focusing on stochastic contexts—where action sets are drawn from a distribution rather than chosen by an adversary—the authors demonstrate that the contextual problem can effectively be treated as a standard linear bandit problem.

The Reduction Framework

The core of this work is a novel Reduction Framework that maps the contextual problem into a "virtual" linear bandit problem with a fixed action space. The framework relies on three primary components:

  1. The $g(\theta)$ Mapping: For any parameter vector $\theta$, a "virtual action" $g(\theta)$ is defined. This action represents the expected best action the learner would take if $\theta$ were the true parameter, averaged over the context distribution $D$. Crucially, the expected reward remains linear: $\mathbb{E}[\text{reward}] = \langle g(\theta), \theta_\star \rangle$.
  2. Distribution Handling: If the context distribution $D$ is known, the learner applies standard linear bandit algorithms to the fixed set of virtual actions. If $D$ is unknown, the authors utilize a batched approach, using contexts from previous rounds to empirically estimate $g(\theta)$.
  3. Robustness to Misspecification: Because empirical estimates of the distribution introduce noise, the framework employs linear bandit algorithms (such as Phased Elimination) specifically designed to handle model misspecification, ensuring low regret even with imperfect knowledge of the context distribution.

Theoretical Results

The proposed reduction framework achieves state-of-the-art regret bounds across several critical scenarios. Most notably, it establishes a $O(d\sqrt{T \log T})$ high-probability regret bound for standard contextual linear bandits, matching the best known bounds for fixed-set linear bandits and resolving a significant open problem in the field.

Comparison of regret bounds between the proposed reduction framework and existing state-of-the-art algorithms across various settings.

As shown in the table above, the framework provides substantial improvements in several specialized settings:

  • Batch Learning: Achieves near-optimal regret with only $O(\log \log T)$ batches.
  • Sparse Parameters: Improves the dependency on the time horizon $T$ for $s$-sparse vectors to $O(\sqrt{dsT} \log T)$.
  • Adversarial Corruption: Significantly reduces the dimensional dependency from $\tilde{O}(d^{4.5})$ in prior work to $\tilde{O}(d^{3/2}C)$.

Discussion and Limitations

The primary insight of this work is that stochastic contexts are "cheap" in terms of information; they do not inherently worsen the fundamental regret of linear bandits. However, this reduction relies heavily on the stochastic assumption. If contexts are chosen adversarially, the mapping to a fixed virtual action set is no longer valid. Furthermore, while the regret bounds are theoretically optimal, the computational cost of calculating or estimating the $g(\theta)$ mapping in high-dimensional spaces remains a practical challenge. Future research may explore further optimizing the dimensional dependencies in corrupted settings and improving the computational efficiency of the virtual action mapping.

Summary updated

Abstract

In this paper, we address the stochastic contextual linear bandit problem, where a decision maker is provided a context (a random set of actions drawn from a distribution). The expected reward of each action is specified by the inner product of the action and an unknown parameter. The goal is to design an algorithm that learns to play as close as possible to the unknown optimal policy after a number of action plays. This problem is considered more challenging than the linear bandit problem, which can be viewed as a contextual bandit problem with a \emph{fixed} context. Surprisingly, in this paper, we show that the stochastic contextual problem can be solved as if it is a linear bandit problem. In particular, we establish a novel reduction framework that converts every stochastic contextual linear bandit instance to a linear bandit instance, when the context distribution is known. When the context distribution is unknown, we establish an algorithm that reduces the stochastic contextual instance to a sequence of linear bandit instances with small misspecifications and achieves nearly the same worst-case regret bound as the algorithm that solves the misspecified linear bandit instances. As a consequence, our results imply a $O(d\sqrt{T\log T})$ high-probability regret bound for contextual linear bandits, making progress in resolving an open problem in (Li et al., 2019), (Li et al., 2021). Our reduction framework opens up a new way to approach stochastic contextual linear bandit problems, and enables improved regret bounds in a number of instances including the batch setting, contextual bandits with misspecifications, contextual bandits with sparse unknown parameters, and contextual bandits with adversarial corruption.
BibTeX
@inproceedings{hanna2023contexts,
  author = {Osama A. Hanna and Lin F. Yang and Christina Fragouli},
  title = {{Contexts can be Cheap: Solving Stochastic Contextual Bandits with Linear Bandit Algorithms}},
  booktitle = {Conference on Learning Theory},
  year = {2023},
}
Figure