ML Systems Lab Open interactive version →
Foundational 35 min read banditexplorationregretexploration-exploitationstochastic

Multi-Armed Bandit Problem

Exploration-exploitation tradeoff, regret formulation, stochastic vs adversarial MAB

A/B testing commits samples to both arms for the full experiment duration, even if one arm is clearly losing early. In online settings — recommending ads, articles, treatments — every suboptimal recommendation has a real cost. Multi-armed bandits formalise the exploration-exploitation tradeoff: you must try options to learn their value (explore), but you want to choose the best option as often as possible (exploit). Doing both simultaneously is the core challenge.

Regret — the accumulated cost of not always choosing the best arm — is the right metric for this problem, not reward prediction accuracy: a reward model that is accurate wherever it has enough data can still incur linear regret under a greedy policy, because its early, noisy estimates on rarely-tried arms can underestimate the best arm, and greedy selection never explores enough to correct that and discover the better arm. The Lai-Robbins lower bound (Ω(log T)) is the key theoretical anchor: any consistent algorithm must pull suboptimal arms at a rate proportional to log T divided by the KL divergence between arm distributions. You cannot beat log T; you can only match it.

Key points

Takeaway

Regret — not reward prediction accuracy — is the right objective for bandit problems, because a model whose reward estimates are accurate wherever it has enough data can still incur linear regret under a greedy policy, since early, noisy estimates on rarely-tried arms can underestimate the best arm and greedy selection never explores enough to correct it. The Lai-Robbins lower bound (Ω(log T)) means no consistent algorithm can do better than O(log T) regret on all instances, and the KL term in the bound tells you why: near-optimal arms require many pulls to eliminate, because small distributional differences are hard to detect.

Recap

Check your understanding

Q1. Select the two true statements about why regret is a better objective than classification accuracy for a 500-article bandit recommender.

Q2. What is the difference between (raw) regret and pseudo-regret? Which is typically analyzed in theory?

Q3. In a clinical trial with 4 treatments and 200 patients total, should you use a bandit algorithm? What ethical constraints interact with regret minimization?

Q4. The Lai-Robbins lower bound is Ω(log T). Does this mean no algorithm can do better than O(log T) regret? What assumptions does the bound depend on?

Try it interactively

ML Systems Lab is a free interview-prep platform for ML engineers — work through the full interactive module, quizzes, and drills.

Open ML Systems Lab →