Overview
This paper introduces LMC-TS, a novel Thompson Sampling algorithm that uses Langevin Monte Carlo to sample directly from the posterior distribution of bandit parameters. By replacing computationally expensive and often inaccurate Gaussian approximations with efficient, gradient-based noisy updates, the authors provide a scalable framework that works seamlessly across linear, generalized linear, and neural contextual bandits.
The Challenge with Standard Thompson Sampling
Contextual bandits are a cornerstone of modern recommendation systems and sequential decision-making. The goal is to learn a policy that chooses the best "arm" (action) based on a given "context" (features) to maximize rewards over time.
A popular strategy for this is Thompson Sampling (TS), which balances exploration and exploitation by sampling parameters from a posterior distribution. However, standard TS faces two major hurdles:
- Computational Complexity: Most implementations use a "Laplace approximation," assuming the posterior is Gaussian. In high-dimensional spaces (like deep learning), sampling from this Gaussian requires inverting or decomposing large covariance matrices—an $O(d^3)$ operation that is prohibitively slow.
- Approximation Error: For non-linear reward models (e.g., neural networks), the true posterior is rarely Gaussian. A fixed Gaussian approximation can lead to poor exploration and high regret.
The LMC-TS Approach
To overcome these limitations, the authors propose Langevin Monte Carlo Thompson Sampling (LMC-TS). Instead of approximating the posterior as a Gaussian, they use Langevin Monte Carlo (LMC)—a Markov Chain Monte Carlo (MCMC) method—to sample from the posterior directly.
The core of the algorithm relies on a simple, iterative update rule: $$\theta_{t,k} = \theta_{t,k-1} - \eta_t \nabla L_t(\theta_{t,k-1}) + \sqrt{2\eta_t \beta_t^{-1}} \epsilon_{t,k}$$
In plain English, this is noisy gradient descent. The algorithm takes a step to minimize the loss (fitting the observed data) and adds a specific amount of Gaussian noise ($\epsilon_{t,k}$) to ensure it explores the parameter space correctly.
This approach offers several distinct advantages:
- First-Order Efficiency: It only requires gradients, making it much faster than methods requiring matrix inversions. It scales linearly with the number of parameters, making it "deep learning ready."
- Direct Sampling: It can theoretically approximate any posterior distribution with arbitrary accuracy, given enough steps.
- Unified Framework: The same algorithm applies to linear, logistic, and deep neural network reward models simply by changing the loss function $L_t$.
Key Theoretical Insights
Despite using an approximate MCMC sampler, the authors prove that for linear bandits, LMC-TS achieves a regret bound of $\tilde{O}(d\sqrt{dT})$. This matches the best-known theoretical performance for standard Thompson Sampling. Furthermore, the algorithm leverages "warm starts"—starting its MCMC chain from the previous round's parameters—which significantly reduces the number of steps needed to reach the new posterior.
Key Results
The authors evaluated LMC-TS on a diverse set of benchmarks, including synthetic datasets, UCI Machine Learning Repository datasets, and high-dimensional image data (CIFAR10). Across the board, LMC-TS consistently outperformed or matched state-of-the-art baselines.
On simulated bandit problems, LMC-TS demonstrated the lowest cumulative regret across linear, logistic, and quadratic settings.
When applied to real-world classification datasets from the UCI repository (transformed into bandit problems), LMC-TS generally achieved lower regret than both linear baselines (like LinUCB) and other neural-based methods (like NeuralTS).
The most striking result was observed on CIFAR10, a setting with over 30,000 context features. LMC-TS not only achieved sublinear regret in this high-dimensional space but was also significantly faster. For 1,000 rounds, LMC-TS took only 9.0 seconds for arm selection, compared to 174.1 seconds for NeuralTS—a nearly 20x speedup.
Limitations and Future Directions
While highly effective, LMC-TS does have limitations:
- Conditioning Sensitivity: The theoretical number of steps required for the MCMC chain depends on the "condition number" of the loss function. In poorly conditioned problems, the algorithm might require more iterations to remain accurate.
- Hyperparameter Tuning: Like many MCMC and deep learning methods, LMC-TS requires careful tuning of the step size ($\eta$) and temperature ($\beta$).
For future work, the authors suggest investigating Stochastic Gradient Langevin Dynamics (SGLD) to further improve scalability by using mini-batches of data instead of the full historical dataset in every round.
Summary updated