Abstract
Thompson Sampling (TS) is a powerful, Bayesian-driven framework for navigating the classic exploration-exploitation trade-off in online decision-making. This tutorial explores how TS utilizes "probabilistic matching" to focus exploration on actions that are statistically plausible candidates for being the best, outperforming naive heuristics in complex environments.
Introduction: The Exploration-Exploitation Dilemma
In many real-world scenarios—from clinical trials and website ad placement to autonomous routing—decision-makers face a fundamental dilemma: Should they take the action that has performed best in the past (exploitation), or should they try something new to see if it’s even better (exploration)?
This is the "multi-armed bandit" problem. Simple strategies like $\epsilon$-greedy, which act greedily most of the time but pick a random action occasionally, are often wasteful because they explore blindly. They might spend as much effort testing a clearly suboptimal option as they do a promising one. The challenge is to develop an algorithm that explores intelligently, leveraging existing knowledge to minimize "regret"—the gap between actual performance and the theoretical optimum.
Methodology: The Core of Thompson Sampling
The core of Thompson Sampling is elegantly simple and rooted in Bayesian principles. Instead of using point estimates for expected rewards, the algorithm maintains a probability distribution (a "belief") over the model parameters.
The process follows four key steps:
- Maintain a Belief: Start with a prior distribution over the model parameters.
- Sample: At each time step, draw a random sample from the current posterior distribution.
- Act: Choose the action that would be optimal if that random sample represented the true state of the world.
- Update: Observe the result and use Bayes' Rule to update the belief.
While the "classic" Beta-Bernoulli bandit is a common starting point, the real power of TS lies in its extensibility to complex, non-conjugate models. Approximation methods such as Laplace Approximation, Langevin Monte Carlo, and Bootstrapping (Ensemble Sampling) allow TS to scale to high-dimensional problems and integrate with deep learning models.
Applications and Structured Decision-Making
Thompson Sampling excels in environments with complex dependencies. Unlike Upper Confidence Bound (UCB) algorithms, which often rely on "hyper-rectangular" confidence intervals that scale poorly, TS handles structured information naturally. If two actions are correlated, TS "knows" that learning about one informs the other.
This capability is particularly evident in shortest-path simulations (e.g., Binomial Bridges). In these scenarios, an agent must find the quickest route through a network of nodes. As shown in the figure above, the decision space can be represented as a directed graph. TS converges to the optimal route significantly faster than $\epsilon$-greedy, which continues to waste time on high-latency paths long after they have been statistically debunked.
Key Insights: Deep Exploration and Information Ratios
A significant advancement discussed in the tutorial is the application of TS to Reinforcement Learning (RL). In RL, the authors emphasize that TS must be applied at the episode level rather than the step level. By sampling a policy once and sticking with it for a full episode, the agent can execute multi-step plans to reach distant rewards—a concept known as "deep exploration."
Furthermore, the paper introduces the Information Ratio, a metric that measures the "cost per bit" of information. If an action provides substantial information about the optimal choice at a low cost in terms of lost reward, it is prioritized for exploration.
Limitations and Future Directions
Thompson Sampling is not without its constraints. It is primarily designed to maximize cumulative reward while learning. In contexts where the sole goal is information gathering (e.g., pure A/B testing), specialized "Best Arm Identification" algorithms are more efficient.
Additionally, TS may fail to select "revealing actions"—those that yield low immediate rewards but provide massive information about other actions. Finally, in "satisficing" scenarios where a "good enough" solution is required quickly, standard TS may spend excessive effort differentiating between nearly identical top-tier options. Future research into "Satisficing TS" aims to address these specific time-sensitive needs.
Summary updated