Active learning for stochastic contextual linear bandits

Emma Brunskill, Ishani Karmarkar, Zhaoqi Li

TL;DR

This paper introduces a novel active learning approach for contextual linear bandits that strategically samples both contexts and actions to learn optimal policies more efficiently. Their method offers theoretical guarantees that can outperform existing passive sampling strategies by a factor of $\sqrt{d}$ and is empirically validated on real-world tasks like medical treatment prediction and recommendation systems.

What Problem Does This Paper Address?

In many real-world applications, like personalized recommendations or clinical trials, we need to make sequential decisions based on contextual information. The "contextual linear bandit" framework models this: at each step, we observe a context (e.g., a user's profile, a patient's condition), choose an action (e.g., recommend an item, prescribe a dosage), and receive a reward. The goal is to learn a policy that maximizes cumulative rewards over time.

Traditional approaches to this problem often assume that contexts are sampled randomly from a known distribution (passive context sampling). However, in practice, we might have prior knowledge about the context distribution and can actively choose which contexts to gather data from. This "active context sampling" has the potential to significantly improve learning efficiency, but its role in contextual linear bandits has been largely unexplored. This paper aims to bridge this gap by developing and analyzing an active context sampling algorithm for stochastic contextual linear bandits.

Methods

The core contribution is an algorithm that strategically samples context-action pairs to learn a near-optimal policy. Unlike passive methods that rely on a fixed context distribution, this algorithm actively selects contexts that are likely to reveal more information about the underlying reward model.

The algorithm works in two main stages:

  1. Sampling Distribution Design: It first computes an "a-smoothed" distribution over context-action pairs. This distribution is designed to balance information gain (by upsampling informative pairs) with the need for a well-conditioned sampling process for theoretical guarantees. This involves solving a semi-definite program (SDP), which can be done in polynomial time.
  2. Data Collection and Policy Learning: The algorithm then draws samples from this designed distribution, collects rewards, and uses standard ridge regression to learn the linear reward model. Finally, it derives a policy from the learned model.

The theoretical analysis provides instance-dependent regret guarantees. Crucially, they show that their active context sampling strategy can improve over the minimax-optimal rate by a factor of $\sqrt{d}$ (where $d$ is the dimension of the linear features), particularly in scenarios where certain context-action pairs are disproportionately informative.

Datasets

The paper evaluates their proposed algorithm on two real-world datasets:

  • Warfarin: A clinical dataset for predicting optimal warfarin dosage for patients, based on demographics and health history.
  • Jester: A dataset of user ratings for jokes, used for joke recommendation.

They also introduce synthetic datasets based on a specific "hard instance" designed to highlight the advantages of active context sampling over passive methods.

Key Insights and Ideas

  • Active Context Sampling Matters: The paper demonstrates that strategically choosing which contexts to gather data from, in addition to choosing actions, can significantly improve learning efficiency in contextual linear bandits. This is a departure from standard approaches that assume passive context sampling.
  • Instance-Dependent Improvement: The theoretical analysis shows that active context sampling can yield an instance-dependent regret bound that is up to $\sqrt{d}$ better than passive methods. This means that for certain problem instances, the algorithm can learn a near-optimal policy with substantially fewer samples.
  • Bridging Theory and Practice: The proposed algorithm is polynomial-time implementable, making it practical for real-world applications. The theoretical guarantees are supported by empirical results on challenging real-world datasets.
  • Robustness to Approximate Context Distribution: The authors show that their algorithm's theoretical guarantees are robust to using an approximate context distribution, which is often the case in practice.

Key Results

  • Theoretical Guarantee: The proposed active context sampling algorithm achieves instance-dependent regret bounds that match the minimax-optimal rate in the worst-case and improve upon it by a factor of $\sqrt{d}$ in the best-case.
  • Empirical Validation: Experiments on the Warfarin and Jester datasets show that their algorithm requires fewer samples to learn a near-optimal policy compared to passive sampling baselines. For instance, on the Warfarin dataset, their method sometimes required 5,000 fewer samples.
  • Synthetic Instance Advantage: On a specifically constructed synthetic instance, the active context sampling algorithm consistently outperformed passive methods by the theoretically predicted $\sqrt{d}$ factor.

Limitations and Future Work

  • Computational Cost of SDP: While the algorithm is polynomial-time, the SDP solver used for designing the sampling distribution can become computationally expensive for very large context-action spaces. The authors suggest exploring GPU-accelerated solvers or heuristic approximations for such scenarios.
  • Linearity Assumption: The current work assumes linear reward models. The authors acknowledge that real-world data might not perfectly adhere to this assumption, but their empirical results suggest robustness. Extending the techniques to more complex, non-linear reward models is a promising direction.
  • Active Context Sampling in Cumulative Regret: The paper focuses on the "pure exploration" setting (learning a policy during an initial phase, then deploying it). They note that active context sampling might be trivial or less meaningful in the cumulative regret minimization setting where exploration and exploitation are interleaved at every step.

Summary updated

BibTeX
@inproceedings{brunskill2026active,
  author = {Emma Brunskill and Ishani Karmarkar and Zhaoqi Li},
  title = {{Active learning for stochastic contextual linear bandits}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2026},
  url = {https://openreview.net/forum?id=cAeeSxkc80},
}
Figure