Inference with the Upper Confidence Bound Algorithm

Koulik Khamaru, Cun-Hui ZhangarXiv 2024 · DOI

Introduction: The Challenge of Sequential Data

In classical statistics, the assumption of "independent and identically distributed" (i.i.d.) data is foundational. However, in Reinforcement Learning (RL) and Multi-Armed Bandit (MAB) problems, this assumption is fundamentally violated. Because an agent selects its next action based on the rewards of previous actions, the resulting data is sequentially dependent.

This dependency creates significant hurdles for downstream inference. For many popular algorithms, such as $\epsilon$-greedy, the sample mean of rewards does not follow a standard Gaussian distribution. This failure of the Central Limit Theorem makes it difficult to construct reliable confidence intervals or perform hypothesis testing—capabilities that are essential in high-stakes domains like medical trials or autonomous systems.

The UCB Stability Property

This research demonstrates that the Upper Confidence Bound (UCB) algorithm possesses a unique "stability property" that mitigates these issues. UCB operates on the principle of "optimism in the face of uncertainty," calculating a score for each arm based on its average reward plus an exploration bonus.

The authors formalize stability as the convergence of the number of times an arm is pulled ($n_{a,T}$) to a non-random limit as the total trials ($T$) increase. By employing Martingale Central Limit Theorems and concentration inequalities (specifically the Law of the Iterated Logarithm), the researchers prove that UCB naturally gravitates toward a stable state. This stability ensures that the data collected, while not i.i.d., behaves predictably enough to allow for standard statistical inference.

Empirical Results and Asymptotic Normality

The core theoretical result is that for UCB, the standardized error of the sample mean—defined as $\sqrt{n_{a,T}} \cdot (\bar{X}_{a,T} - \mu_a)$—converges to a standard normal distribution $N(0, \sigma^2_a)$. This allows for the creation of asymptotically exact $1-\alpha$ confidence intervals.

To validate this theory, the authors conducted synthetic simulations of a 2-armed bandit environment. Using 5,000 Monte Carlo repetitions, they compared the error distributions of UCB and $\epsilon$-greedy.

Figure 1: Density plots of standardized error for $\epsilon$-greedy (left) and UCB (right). UCB's distribution closely matches the standard Gaussian curve, whereas $\epsilon$-greedy exhibits significant skew and non-normality.

As seen in the figure above, the $\epsilon$-greedy algorithm produces a "wonky," non-Gaussian distribution because it may "starve" an arm of samples based on early poor performance. In contrast, UCB’s exploration bonus ensures that every arm is sampled frequently enough to stabilize its statistics, resulting in a near-perfect fit to the bell curve.

Key Insights and Implications

Several critical insights emerge from this stability:

  • The Anchor Effect: The stability of the optimal arm acts as an "anchor," forcing sub-optimal arms into predictable sampling patterns.
  • Fairness in Sampling: UCB is inherently "fairer" than $\epsilon$-greedy; it prevents arms from being prematurely abandoned, which is what preserves the normality of the sample mean.
  • Scalability: The stability property holds even as the number of arms ($K$) grows, provided the growth rate relative to total trials is controlled ($\log K / \log T \to 0$).

Limitations and Future Work

While these results are promising, they currently rely on the assumption of sub-Gaussian reward noise. Future research is needed to determine if these properties hold for heavy-tailed distributions. Additionally, while UCB is stable, there may be a trade-off between this statistical stability and the total regret (reward maximization) compared to more aggressive algorithms. Extending this analysis to other popular methods like Thompson Sampling remains an open and important question for the field.

Summary updated

BibTeX
@misc{khamaru2024inference,
  author = {Koulik Khamaru and Cun-Hui Zhang},
  title = {{Inference with the Upper Confidence Bound Algorithm}},
  year = {2024},
  eprint = {2408.04595},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2408.04595},
}
Figure