NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Thompson Sampling for High-Dimensional Sparse Linear Contextual Bandits

Sunrit Chakraborty, Saptarshi Roy, Ambuj Tewari

TL;DR

This paper provides the first theoretical regret guarantees for Thompson Sampling in high-dimensional, sparse linear contextual bandits. By combining a "spike-and-slab" sparsity-inducing prior with Variational Inference, the authors created an algorithm (VBTS) that is not only mathematically optimal but also orders of magnitude faster than traditional sampling methods.

What Problem Does This Paper Address?

In the world of personalized recommendations or clinical trials, we often face the "contextual bandit" problem: an agent must choose an action (like showing an ad or prescribing a drug) based on a set of features (the context) to maximize a cumulative reward.

In the modern "big data" era, these contexts are often high-dimensional—meaning there are thousands of features ($d$). However, usually only a tiny fraction of these features actually influence the reward (a concept known as sparsity, denoted as $s^*$). Standard bandit algorithms often suffer from the "curse of dimensionality," where their performance degrades linearly as the number of features increases.

While Upper Confidence Bound (UCB) methods have been successfully adapted for this sparse setting, Thompson Sampling (TS)—a popular, often better-performing alternative that selects actions based on posterior probabilities—has historically lacked rigorous theoretical guarantees for high-dimensional sparse environments. Furthermore, calculating the "true" posterior in these settings using traditional methods is computationally nightmarish.

Methods

The authors bridge the gap between theory and practice using three key components:

  1. Sparsity-Inducing Priors: They employ a "complexity prior" (a variation of the spike-and-slab prior). This prior assumes that most coefficients are exactly zero (the "spike") while the few non-zero ones follow a Laplace distribution (the "slab").
  2. Thompson Sampling Framework: The agent maintains a distribution over possible models. At each step, it draws a sample model from this distribution and acts greedily according to that sample. This naturally balances exploring new feature combinations and exploiting known ones.
  3. Variational Inference (VB): Instead of using Markov Chain Monte Carlo (MCMC) to sample from the posterior—which is painfully slow in high dimensions—the authors use Variational Bayes. They approximate the complex posterior with a simpler, "mean-field" distribution. This turns an intractable sampling problem into a solvable optimization problem, making it computationally feasible.

Theoretical Guarantees & Key Insights

The theoretical analysis of the proposed algorithm yields several compelling insights into how Thompson Sampling behaves in sparse environments:

  • Dimension Independence: The most striking insight is that the algorithm's "regret" (the cumulative reward lost by not picking the perfect arm) is nearly independent of the total number of features $d$. It scales poly-logarithmically with $d$, meaning you can drastically increase the number of irrelevant features and barely see a performance hit.
  • The Margin Condition: The authors show that the difficulty of the problem depends on the "margin"—how clearly the best arm stands out from the others. If the gap is large, the regret grows very slowly (logarithmically with time $T$); if the gap is tiny, it grows at a rate of $\sqrt{T}$.
Comparison of regret bounds showing this paper's near-optimal, dimension-independent scaling.
  • VB is Enough: While Variational Inference is an approximation, the authors theoretically and empirically demonstrate that it provides enough "uncertainty" for Thompson Sampling to explore effectively, while remaining fast enough for real-time applications.

Key Results

The authors evaluated their algorithm, VBTS (Variational Bayes Thompson Sampling), using both synthetic data (Equicorrelated and Autoregressive feature structures) and real-world data (the gravier breast carcinoma dataset).

  • Superior Performance: In synthetic tests with $d=1000$ features where only $s^*=5$ were relevant, VBTS consistently outperformed state-of-the-art sparse bandit algorithms (like LASSO-L1 and DR-LASSO) by a wide margin in terms of cumulative regret.
  • Massive Speedup: The computational results were the most dramatic. In a 1000-dimensional setting, traditional Thompson Sampling (LinTS) took roughly 1,344 seconds to execute, while the proposed VBTS took only ~29 seconds.
Execution time comparison demonstrating the massive computational advantage of VBTS.
  • Real-World Accuracy: On the gravier dataset (predicting metastasis using 2,905 gene expressions), VBTS achieved a classification accuracy of 81.88%, outperforming other sparse bandit methods like ESTC (73.32%) and DR-LASSO (65.63%).

Limitations and Future Work

The authors acknowledge a few areas for further exploration:

  • Degeneracy: The current theory assumes the context features aren't "degenerate" (i.e., they must have some diversity). If certain features are always zero or perfectly correlated, the current analysis needs adjustment.
  • MCMC Alternatives: While VB is fast, the authors suggest that specialized MCMC methods (like those based on truncated sparsity priors) might eventually offer even better theoretical properties if their "mixing time" issues can be solved.
  • Beyond Linear Models: The current work focuses on linear rewards. Extending these sparse TS guarantees to Generalized Linear Models (like Logistic Regression for binary rewards) is a logical next step for the field.

Summary updated

BibTeX
@inproceedings{chakraborty2023thompson,
  author = {Sunrit Chakraborty and Saptarshi Roy and Ambuj Tewari},
  title = {{Thompson Sampling for High-Dimensional Sparse Linear Contextual Bandits}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=ZI4vN6D9Kk},
}
Figure