On Approximate Thompson Sampling with Langevin Algorithms

Eric Mazumdar, Aldo Pacchiano, Yi-An Ma, Michael I. Jordan, Peter L. Bartlett

Thompson Sampling (TS) is a gold standard for managing the exploration-exploitation tradeoff in multi-armed bandits. However, a long-standing gap exists between its theoretical elegance and the practical reality of implementing it in non-trivial machine learning models. This paper provides the first theoretical guarantee that TS remains optimal even when using approximate Markov Chain Monte Carlo (MCMC) methods, such as Langevin Dynamics, to sample from the posterior.

The Computational Bottleneck of Thompson Sampling

In most real-world scenarios where rewards are not simple conjugate pairs (like Bernoulli or Gaussian), the posterior distribution lacks a closed-form solution. Consequently, standard TS requires running an expensive MCMC simulation at every single time step.

Recent research has highlighted a severe consequence of this bottleneck: if the approximation error of the sampler remains constant, the algorithm's cumulative regret (the loss compared to the best possible strategy) can grow linearly, effectively halting learning. The core challenge is approximating the posterior accurately enough to maintain optimal performance without computational costs exploding as more data is collected.

Methodology: Langevin MCMC and Warm-Starting

To resolve this, the authors propose using Langevin MCMC algorithms—specifically the Unadjusted Langevin Algorithm (ULA) and Stochastic Gradient Langevin Dynamics (SGLD)—to generate the necessary samples. The approach relies on several key technical components:

  • Log-Concave Assumptions: The framework focuses on a broad class of log-concave reward distributions and priors, covering many practical models beyond simple conjugate pairs.
  • Warm-Starting: This is the "secret sauce" of the method. Instead of initializing the MCMC chain from the prior at every round, the sampler is initialized using the sample generated in the previous round.
  • Scaled Posteriors: A scaling parameter ($\gamma$) is introduced to the posterior to ensure sufficient variance, encouraging adequate exploration in high-dimensional bandit problems.
  • New Concentration Bounds: The authors derive new finite-time posterior concentration bounds for log-concave distributions to support their proofs, which may also benefit the broader statistics community.

Key Insights and Theoretical Results

The paper is primarily a theoretical contribution, focusing on instance-dependent regret bounds rather than empirical dataset benchmarks. It yields several major breakthroughs:

  • The "Constant Work" Breakthrough: The most surprising finding is that the MCMC chain does not need to fully converge to the true posterior at every step. Because the posterior updates slowly as new data arrives, a constant number of MCMC steps is sufficient to track it and maintain optimal regret.
  • Mandatory Error Decay: The authors demonstrate that for TS to achieve logarithmic regret, the approximation error (measured in Wasserstein distance) must decrease at a rate of $1/n$, where $n$ is the number of samples. The proposed Langevin approach naturally achieves this decay.
  • Scalability via SGLD: By utilizing SGLD, which relies on mini-batches rather than the full data history, the per-step computational cost remains constant even as data grows infinitely. This makes the algorithm truly scalable for long-horizon tasks.
  • Optimal Regret: The authors prove that both exact and approximate Langevin-based TS achieve optimal logarithmic regret, $O(\frac{\log T}{\Delta})$, matching theoretical lower bounds for bandit problems. The bounds also provide explicit constants detailing dependencies on dimensionality ($d$), prior quality, and the condition number of reward distributions.

Limitations and Future Directions

While this work bridges a critical gap in bandit literature, the authors note a few limitations:

  • Log-Concavity Constraint: The proofs strictly rely on strong log-concavity, excluding multi-modal distributions (e.g., Gaussian Mixtures) and complex neural network loss landscapes.
  • Prior Sensitivity: The theoretical bounds are "worst-case." They account for the prior but do not yet fully capture the practical benefits of having a highly accurate prior, which is a primary motivation for using Bayesian methods.
  • Contextual Bandits: Extending these rigorous Langevin guarantees from the standard Multi-Armed Bandit (MAB) setting to contextual bandits (where rewards depend on features) remains a highly anticipated next step for this line of research.

Summary updated

BibTeX
@inproceedings{mazumdar2020approximate,
  author = {Eric Mazumdar and Aldo Pacchiano and Yi-An Ma and Michael I. Jordan and Peter L. Bartlett},
  title = {{On Approximate Thompson Sampling with Langevin Algorithms}},
  booktitle = {International Conference on Machine Learning},
  year = {2020},
}
Figure