Inferensys

Glossary

Multi-Armed Bandit

A simplified reinforcement learning problem where an agent must allocate a fixed set of resources among competing choices to maximize cumulative reward under uncertain outcomes.
Developer reviewing multi-agent chat interface on laptop, agent conversation logs visible, casual coding session at WeWork desk.
SEQUENTIAL DECISION-MAKING

What is Multi-Armed Bandit?

A simplified reinforcement learning problem where an agent must allocate a fixed set of resources among competing choices to maximize cumulative reward under uncertain outcomes.

A Multi-Armed Bandit is a classic reinforcement learning framework that formalizes the exploration-exploitation trade-off. An agent faces a finite set of actions (the 'arms'), each providing a stochastic reward from an initially unknown probability distribution. The agent's objective is to sequentially select arms to maximize the cumulative reward over a finite or infinite time horizon, requiring a strategy that balances trying new arms to gather information against exploiting the current best-performing arm.

The problem is named after a gambler choosing among multiple slot machines ('one-armed bandits') with different, unknown payout rates. Core solution algorithms include the epsilon-greedy strategy, Upper Confidence Bound (UCB), and Thompson Sampling, each providing a different mathematical approach to managing the exploration-exploitation trade-off. In enterprise contexts, multi-armed bandits power adaptive systems like dynamic pricing engines, clinical trial design, and automated A/B testing for web content optimization.

EXPLORATION STRATEGIES

Core Multi-Armed Bandit Algorithms

The Multi-Armed Bandit problem is solved through distinct algorithmic strategies that balance the exploration-exploitation trade-off. Each algorithm offers a different mathematical guarantee for converging to the optimal action while minimizing cumulative regret.

01

Epsilon-Greedy

The simplest bandit algorithm that selects the best-known action with probability 1-ε and a random action with probability ε.

  • Mechanism: A fixed exploration rate ε (e.g., 0.1) ensures continuous sampling of suboptimal arms
  • Regret: Linear total regret because exploration never stops, even after identifying the optimal arm
  • Practical use: Baseline for A/B testing and rapid prototyping where simplicity outweighs optimality
  • Weakness: Wastes resources exploring clearly inferior arms with the same probability as promising ones
02

Upper Confidence Bound (UCB)

A deterministic algorithm that selects arms based on an optimistic estimate of their potential reward, calculated as the sample mean plus an exploration bonus.

  • Mechanism: UCB = μ̂ᵢ + √(2 ln(t) / nᵢ), where the bonus shrinks as an arm is pulled more often
  • Regret: Logarithmic total regret, a provably optimal scaling for the stochastic bandit problem
  • Key insight: The algorithm is optimistic in the face of uncertainty, naturally balancing exploration and exploitation without an explicit ε parameter
  • Variant: UCB1 is the canonical form with strong theoretical guarantees under bounded reward assumptions
03

Thompson Sampling

A Bayesian algorithm that maintains a probability distribution over each arm's reward parameter and selects actions by sampling from these posterior distributions.

  • Mechanism: For Bernoulli rewards, use Beta(α, β) priors; after observing a reward, update α (successes) or β (failures)
  • Probability matching: The probability an arm is selected equals the probability it is optimal given current data
  • Empirical performance: Often outperforms UCB in practice despite similar theoretical regret bounds
  • Advantage: Naturally incorporates prior knowledge and handles non-stationary environments gracefully
04

Softmax (Boltzmann Exploration)

A gradient-based algorithm that selects arms with probabilities proportional to their estimated values using a temperature-controlled softmax distribution.

  • Mechanism: P(aᵢ) = exp(Qᵢ / τ) / Σⱼ exp(Qⱼ / τ), where τ (temperature) controls exploration intensity
  • Temperature annealing: High τ encourages uniform exploration; low τ converges to greedy selection
  • Gradient-bandit variant: Uses stochastic gradient ascent on expected reward, enabling learning of action preferences rather than just value estimates
  • Use case: Effective when arms have similar expected values and fine-grained discrimination is required
05

Contextual Bandits

An extension where the agent observes side information (context) before each decision, enabling personalized action selection rather than a single best arm for all situations.

  • Mechanism: A model f(x, a) predicts the reward for action a given context vector x, typically using linear models or neural networks
  • Key distinction: Unlike standard bandits, the optimal arm depends on the observed context, making this a supervised learning problem with partial feedback
  • Applications: News recommendation, personalized medicine, dynamic pricing where user features inform the decision
  • Challenge: The exploration-exploitation dilemma now operates in a feature space, requiring algorithms like LinUCB or neural bandits
06

Adversarial Bandits

A non-stochastic formulation where rewards are chosen by an adversary rather than drawn from fixed distributions, requiring algorithms with worst-case guarantees.

  • Mechanism: The EXP3 (Exponential-weight algorithm for Exploration and Exploitation) algorithm maintains a weight for each arm and updates them multiplicatively based on observed rewards
  • Regret bound: Achieves O(√(TK log K)) regret against the best fixed action in hindsight over T rounds with K arms
  • Key concept: No statistical assumptions about reward generation; the adversary can adapt rewards based on the algorithm's past choices
  • Relevance: Models non-stationary environments, competitive scenarios, and situations where stationarity assumptions fail
DECISION INTELLIGENCE

Frequently Asked Questions

Clear, technically precise answers to the most common questions about the Multi-Armed Bandit problem and its application in prescriptive analytics.

A Multi-Armed Bandit (MAB) is a simplified reinforcement learning problem where an agent must sequentially allocate a fixed set of resources among competing choices (arms) to maximize cumulative reward under uncertain outcomes. The name derives from the metaphor of a gambler facing a row of slot machines (one-armed bandits), each with an unknown, distinct payout probability. At each time step, the agent pulls one arm and observes a stochastic reward drawn from that arm's stationary probability distribution. The core mechanism involves maintaining an internal estimate of each arm's expected value and updating these estimates with every observed outcome. The agent's policy dictates which arm to pull next, balancing the exploration-exploitation trade-off. Unlike full Markov Decision Processes, the classic MAB problem is stateless—the environment does not change based on the agent's actions, only the agent's knowledge updates. This makes it a foundational model for online decision-making, clinical trial design, and dynamic pricing systems where feedback is immediate and the goal is to minimize regret—the difference between the cumulative reward of the optimal strategy and the agent's actual accumulated reward.

EXPERIMENTATION STRATEGY COMPARISON

Multi-Armed Bandit vs. A/B Testing

A technical comparison of sequential decision-making approaches for online experimentation and optimization under uncertainty.

FeatureMulti-Armed BanditA/B TestingContextual Bandit

Core Objective

Maximize cumulative reward during experiment

Statistically compare fixed variants

Personalize action selection per context

Traffic Allocation

Dynamic; shifts toward best performer

Static; equal split throughout test

Dynamic; conditioned on user features

Exploration Strategy

Continuous; epsilon-greedy, UCB, Thompson Sampling

Fixed exploration phase only

Continuous; context-aware exploration

Regret Minimization

Statistical Significance Testing

Handles Non-Stationary Rewards

Cold Start Problem

High initial regret

No regret; pure data collection

Moderate; requires context features

Typical Use Case

Ad placement, dynamic pricing, recommendation

UI redesign, email subject lines

Personalized newsfeed, targeted offers

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.