Thompson Sampling (TS) is a cornerstone of modern reinforcement learning and bandit problems, prized for its elegant way of balancing exploration and exploitation. However, TS has a major practical hurdle: it requires maintaining an exact posterior distribution over model parameters. In complex environments—like those involving deep neural networks—this is often computationally impossible.
Enter Ensemble Sampling (ES). Instead of tracking a full distribution, ES maintains a small "ensemble" of models that are updated incrementally. While ES has become a popular heuristic in deep RL and recommendation systems, it has lacked a rigorous theoretical foundation. This paper, presented at NeurIPS 2022, provides the first rigorous regret analysis for ES, proving that this practical approximation isn't just a good guess—it’s mathematically sound.
TL;DR
The authors provide the first rigorous Bayesian regret bound for Ensemble Sampling in linear bandit problems. They show that ES's regret consists of a standard Thompson Sampling term plus an "approximation error" term that vanishes as the ensemble size increases, effectively proving that ES can be as good as exact TS with enough models.
What Problem Does This Paper Address?
The core challenge in Bayesian optimization and bandits is the "curse of dimensionality" and the difficulty of exact inference. Thompson Sampling works by sampling from a posterior distribution, but for most interesting models, you can't calculate that posterior exactly.
Ensemble Sampling was proposed as a workaround: maintain $M$ different models, pick one at random to act, and update them all with a bit of noise to simulate posterior sampling. While empirically successful, previous attempts to prove its efficiency (notably by Lu and Van Roy in 2017) contained technical flaws. Researchers couldn't definitively say if ES would eventually converge to optimal behavior or if the approximation error would accumulate and lead to linear regret.
Methods
The authors focus their analysis on the linear-Gaussian bandit problem. In this setting, the reward is a linear function of the action vector and an unknown parameter vector $\theta$, with Gaussian noise.
The key contribution is a two-step theoretical approach:
- A General Regret Bound (Theorem 2): The authors derive a new, general regret bound applicable to any learning algorithm. This bound is based on the Hellinger distance between the algorithm's action-selection distribution and the true posterior distribution of the optimal action.
- Application to ES (Theorem 1): They then apply this general bound specifically to the ES algorithm. To do this, they use information-theoretic tools (like Shannon entropy and mutual information) to bound the "posterior mismatch" caused by using a finite ensemble instead of a continuous distribution.
The ES algorithm analyzed here is detailed in the pseudo-code below:
Key Insights and Ideas
- The Regret Decomposition: The authors show that the regret of ES can be split into two distinct parts:
- Term (a): The regret of exact Thompson Sampling.
- Term (b): The penalty for using an ensemble approximation.
- The Power of $M$: The analysis quantifies exactly how the ensemble size ($M$) affects performance. The approximation error scales with $1/\sqrt{M}$. This means that as you add more models to your ensemble, your performance approaches the theoretical optimum of exact TS.
- Information-Theoretic "Stepping Stone": Theorem 2 is a significant contribution in its own right. By framing regret in terms of Hellinger distance, the authors provide a tool that other researchers can use to analyze different approximate TS methods (like Laplace approximations or Variational Inference).
- Sanity Check for Linear Bandits: While linear bandits are simpler than deep RL, they serve as a vital "sanity check." If an algorithm doesn't have a sublinear regret bound here, it's unlikely to be robust in more complex settings.
Key Results
The main result is the Bayesian regret bound for ES:
$$\text{Regret}(T) \leq O\left( \sqrt{dTH(A_*)} + T \sqrt{\frac{\min\{d, \log K\}K \log(6TM)}{M}} \right)$$
- Sublinear Regret: The first term is $O(\sqrt{T})$, which is the standard optimal rate for linear bandits.
- Vanishing Mismatch: The second term shows that if the ensemble size $M$ is large enough (specifically, if $M$ grows with $T$), the approximation error becomes negligible.
- Efficiency: The authors note that if $M \approx KT/d$, ES achieves the same order of regret as exact Thompson Sampling.
Limitations and Future Work
- Dependence on $K$: The current bound depends on the number of actions $K$. In many linear bandit problems, the action set is very large or infinite, which would make this specific bound less useful. The authors conjecture that this dependence on $K$ can be improved to depend only on the dimension $d$.
- Linear-Gaussian Constraint: The proof relies on the properties of Gaussian distributions. Extending this to non-Gaussian settings or more complex function approximators (like neural networks) remains a theoretical challenge.
- Bridging to Deep RL: The authors suggest that since training wide neural networks with SGD can approximate Gaussian Process inference, their results might extend to neural-based ES. However, formalizing this requires significant future technical work.
By providing the first rigorous proof that Ensemble Sampling works, this paper elevates a popular heuristic to a theoretically grounded method, giving practitioners more confidence when deploying ensemble-based agents in the wild.
Summary updated