Maillard Sampling: Boltzmann Exploration Done Optimally

Jie Bian, Kwang-Sung Jun

Abstract: The PhD thesis of Maillard (2013) presents a rather obscure algorithm for the $K$-armed bandit problem. This less-known algorithm, which we call Maillard sampling (MS), computes the probability of choosing each arm in a closed form, which is not true for Thompson sampling, a widely-adopted bandit algorithm in the industry. This means that the bandit-logged data from running MS can be readily used for counterfactual evaluation, unlike Thompson sampling. Motivated by such merit, we revisit MS and perform an improved analysis to show that it achieves both the asymptotical optimality and $\sqrt{KT\log{T}}$ minimax regret bound where $T$ is the time horizon, which matches the known bounds for asymptotically optimal UCB. We then propose a variant of MS called MS$^+$ that improves its minimax bound to $\sqrt{KT\log{K}}$. MS$^+$ can also be tuned to be aggressive (i.e., less exploration) without losing the asymptotic optimality, a unique feature unavailable from existing bandit algorithms. Our numerical evaluation shows the effectiveness of MS$^+$.

Introduction

In the multi-armed bandit framework, the "exploration-exploitation" trade-off is the central challenge. The goal is to identify the optimal arm while minimizing "regret"—the cumulative reward lost by not pulling the best arm from the beginning.

Two major families of algorithms dominate this space: Upper Confidence Bound (UCB), which is deterministic, and Thompson Sampling (TS), which is randomized. Industry practitioners often prefer randomized algorithms because the logged data they produce is significantly easier to use for "off-policy evaluation"—estimating how a new algorithm would have performed using historical data. However, Thompson Sampling lacks a closed-form formula for selection probabilities, necessitating expensive simulations that are often impractical for web-scale systems. This paper revisits Maillard Sampling (MS), a lesser-known algorithm that provides a closed-form solution to this problem.

Methods: Maillard Sampling and MS+

Maillard Sampling chooses an arm with a probability proportional to the "sub-Gaussian tail" of its estimated gap from the best arm. Specifically, the probability $p_{t,a}$ is proportional to $\exp(-N_{t-1,a} \hat{\Delta}_{t-1,a}^2 / 2\sigma^2)$. This approach can be viewed as a refined version of Boltzmann Exploration (Softmax), where the "temperature" is automatically and optimally tuned for each arm based on its pull count.

The authors introduce MS+, which improves upon the original MS by slightly inflating the sampling probability of the empirical best arm. This modification allows for a tighter minimax regret bound of $O(\sqrt{KT \log K})$.

The "Booster" Parameter

A unique feature of MS+ is the introduction of a "booster" parameter $B$. Increasing $B$ encourages the algorithm to exploit the current best arm more aggressively. Crucially, the authors prove that even with a very high $B$, the algorithm's long-term asymptotic optimality remains intact. This allows practitioners to safely tune for exploitation without risking the linear regret often associated with manual tuning in other algorithms.

Figure 1: Average regret and variance as a function of the booster parameter B. While increasing B can reduce average regret initially, very high values significantly increase variance.

Key Insights

  • Closed-Form Utility: The ability to calculate exact selection probabilities ($p_{t,a}$) instantly makes MS/MS+ significantly more practical than Thompson Sampling for counterfactual reasoning and off-policy improvement.
  • Safe Aggression: In traditional algorithms like UCB, manually shrinking confidence intervals to be more aggressive can lead to the algorithm "getting stuck" on sub-optimal arms. In MS+, the booster only affects lower-order terms in the regret formula, ensuring the algorithm can recover from early mistakes.
  • Optimal Boltzmann Exploration: While standard Boltzmann exploration is typically sub-optimal, MS demonstrates that with appropriate arm-specific scaling, the Boltzmann approach can achieve theoretical optimality.

Experimental Results

The researchers evaluated MS+ against state-of-the-art algorithms using synthetic bandit problems with Gaussian and Bernoulli rewards across various gap structures (e.g., "Linear" and "Equal" gaps).

Figure 4: Performance comparison in a linear gap setting with K=10 arms. MS+ variants (B=4, 8, 16) perform competitively with Thompson Sampling (TS) and outperform several UCB variants.

In head-to-head tests, MS+ (specifically with $B=8$ or $B=16$) performed on par with or better than Thompson Sampling and state-of-the-art UCB variants. In Bernoulli environments, MS+16 consistently demonstrated the lowest average regret among "anytime" algorithms (those that do not require prior knowledge of the time horizon $T$).

Limitations and Future Work

While MS+ shows great promise for the $K$-armed bandit problem, several avenues for future research remain:

  • Contextual Bandits: Extending the MS+ framework to linear or deep contextual bandits to handle user features.
  • Variance Management: As shown in Figure 1, aggressive boosting increases variance. Finding the optimal balance remains a task for practitioners.
  • Exponential Families: Generalizing the current sub-Gaussian analysis to the broader exponential family of distributions.

Summary updated

BibTeX
@inproceedings{bian2022maillard,
  author = {Jie Bian and Kwang-Sung Jun},
  title = {{Maillard Sampling: Boltzmann Exploration Done Optimally}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2022},
  url = {https://openreview.net/forum?id=SGbW1wIlSj},
}
Figure