Every AI system that acts has to decide how much of its budget goes into learning and how much into earning. A recommendation engine choosing which headline to show, a reinforcement learning agent trying an action, an LLM sampling five candidate solutions before picking one: all of them face the same trade-off, and the mathematics of that trade-off is 90 years old. It starts with a gambler and a row of slot machines.
The Problem
The multi-armed bandit is a sequential decision problem. There are K options, called arms. Each round, the agent pulls exactly one arm and observes the reward from that arm only. Each arm pays out according to a fixed but unknown probability distribution. The agent's goal is not to learn the distributions for their own sake but to accumulate as much total reward as possible.
The difficulty is that the data the agent sees depends on the choices it makes. Pulling one arm reveals nothing about the others. If the agent only pulls the arm that has performed best so far (exploitation), it may sit forever on a mediocre winner while a better arm stays untested. If it pulls at random to gather information (exploration), it wastes rounds on known losers. The gap between what the agent earned and what a perfect oracle would have earned is called regret, and minimizing regret over a long sequence of pulls is the objective the whole literature measures itself against.
The name comes from the slot machine metaphor, each machine being a "one-armed bandit." As Google Research put it in its survey of the topic, the formulation dates to William Thompson's 1933 paper on allocating patients between two treatments, and Herbert Robbins put it on rigorous footing in his 1952 paper "Some Aspects of the Sequential Design of Experiments". It sits in an odd middle ground between classical statistics and reinforcement learning: unlike a full Markov decision process, pulling an arm does not move the agent to a new state, but unlike supervised learning, the agent chooses which labels it gets to see.
What Is Provably Optimal
For decades the interesting result was a lower bound. In 1985, Tze Leung Lai and Herbert Robbins proved that any sensible algorithm must, in expectation, pull each suboptimal arm at least on the order of log(T) / D(arm || best) times after T rounds, where D is the Kullback-Leibler divergence between the arm's reward distribution and the best arm's. Translation: the more similar a bad arm looks to the good one, the more times you are mathematically required to be fooled by it. No algorithm escapes this. Regret cannot be driven below logarithmic growth; an agent that tries everything equally often has linear regret and loses by definition.
The practical algorithms chase that bound. Auer, Cesa-Bianchi and Fischer's 2002 paper introduced UCB1, the finite-time analysis that made the field's theory usable: keep a running average reward for each arm plus a confidence bonus that shrinks as the arm is pulled more, then always pull the arm with the highest average plus bonus. Uncertain arms get bonus attention; well-measured arms play their actual strength. Their theorem bounds expected regret at 8 * sum(ln(n)/Delta_i) + O(K), close to the Lai-Robbins floor.
The other two standard policies behave differently but fill the same role:
- Epsilon-greedy. Play the current best arm with probability 1 - epsilon, play a uniformly random arm with probability epsilon. Crude, unguided (the random pull is not aimed at the most informative arm), and surprisingly hard to beat in noisy production settings.
- Thompson sampling. The 1933 idea, revived: maintain a Bayesian posterior over each arm's value, draw one sample from each posterior per round, play the arm with the highest draw. Selection probability equals probability of being optimal. Agrawal and Goyal's 2012 analysis gave it the first logarithmic regret bound for Bernoulli arms, and it remains the default in many production systems because it degrades gracefully with delayed feedback.
Why It Shows Up Everywhere in AI

The bandit frame quietly underwrites several things the modern AI industry does.
Reinforcement learning. Every RL agent that trains with an exploration schedule is running a bandit-style policy inside a harder problem. DeepMind's 2015 DQN paper on human-level Atari play uses an annealed epsilon-greedy action selection rule. AlphaGo's 2016 Nature paper drives its Monte Carlo tree search with UCT, an upper-confidence-bound rule descended directly from the Lai-Robbins lineage. Sutton and Barto's textbook devotes its Chapter 2 bandit section to exactly this point: action values learned without exploration are untrustworthy, because the agent only ever samples the actions its current policy already likes.
LLM post-training. Reasoning models trained with RL, in the GRPO-style setups described by DeepSeek-R1, are running a regret problem at scale: sample many completions per prompt, reward them, push probability mass toward the winners. Exploit too hard and training collapses onto one high-scoring template; explore too broadly and the model wastes compute on garbage rollouts. The temperature and rollout-budget dials in RL pipelines are exploration knobs by another name.
Recommendation and ranking. The canonical applied paper is Li, Chu, Langford and Schapire's 2010 LinUCB study, which modeled Yahoo Front Page news selection as a contextual bandit and reported a 12.5 percent click lift over a standard context-free bandit algorithm on 33 million logged events. Netflix does the same thing with thumbnails rather than headlines: its artwork personalization system selects which promotional image each title shows using contextual bandits, with controlled randomization injected into serving to keep the training data honest.
A/B testing that never waits. Traditional A/B tests run fixed splits for two weeks; bandit-based allocation shifts traffic toward the better variant continuously. The cost is that you explore on real users, and the Lai-Robbins bound says that cost is unavoidable: some bad pulls are the price of knowledge.
What Breaks in Production

Three failure modes show up constantly.
First, plain bandits assume arms have static value distributions. Real reward rates drift (news goes stale, models get better). Production systems handle this with sliding windows or discount factors that forget old pulls. Second, feedback is delayed: a click arrives in a second, a subscription arrives in a month, and the algorithm must attribute rewards to the arm that earned them. Thompson sampling's tolerance for delayed feedback was one of the reasons it won adoption. Third, logged data is biased toward whatever the previous policy chose, the same selection-bias problem that haunts offline LLM evaluation. Yahoo's paper solved it the standard way: hold out a random-traffic bucket as ground truth. Netflix injects randomization into serving for the same reason. If a system reports bandit results without a randomization lane, the numbers are untrustworthy.
The conceptual trap for practitioners is that exploration is not a nice-to-have. An agent that only consumes its own exploitation data cannot detect that a better arm exists, ever. That is the same argument that makes model-collapse warnings and self-training cautions ring true: data gathered under one policy systematically hides what other policies would have found.
The Short Version
Pick K options, pay for information in lost reward, spend the rest of the budget cashing out. Thompson posed it in 1933 as two medical treatments; Robbins made it a theorem target in 1952; Lai and Robbins drew the line no algorithm can cross in 1985; Auer and colleagues gave the practical rule in 2002; Yahoo and Netflix deployed it at hundreds-of-millions-of-events scale. Every AI agent that samples actions, rollouts, headlines or thumbnails is reliving a slot-machine puzzle, and every one of them faces the same tax: the least you can pay for knowing better is a few bad pulls.
Sources
- W. R. Thompson, "On the likelihood that one unknown probability exceeds another in view of the evidence of two samples," Biometrika, 1933 (via Wikipedia: Multi-armed bandit)
- H. Robbins, "Some Aspects of the Sequential Design of Experiments," Annals of Mathematical Statistics, 1952 (projecteuclid)
- Lai-Robbins lower bound (Wikipedia)
- Auer, Cesa-Bianchi, Fischer, "Finite-time Analysis of the Multi-armed Bandit Problem," Machine Learning 47, 2002 (PDF)
- Agrawal and Goyal, "Analysis of Thompson Sampling for the Multi-armed Bandit Problem," COLT 2012 (PMLR)
- Li, Chu, Langford, Schapire, "A Contextual-Bandit Approach to Personalized News Article Recommendation," WWW 2010 (arXiv:1003.0146)
- Lattimore and Szepesvari-era Google Research survey: "Multi-armed bandit experiments in the online service economy"
- Sutton and Barto, Reinforcement Learning: An Introduction, Chapter 2 (mitpress)
- Mnih et al., "Human-level control through deep reinforcement learning," Nature 2015 (nature.com)
- Silver et al., "Mastering the game of Go with deep neural networks and tree search," Nature 2016 (nature.com)
- Netflix Tech Blog, "Artwork Personalization at Netflix" (netflixtechblog.com)
