Reinforcement Learning

Multi-Armed Bandits

Optimizing online decision-making when actions yield stochastic rewards without full sequential state transitions.

🟡 intermediate4 min readbanditsmust-know
A Multi-Armed Bandit (MAB) is a simplified Reinforcement Learning framework where an agent chooses among K independent actions ("arms") to maximize cumulative reward. Unlike full MDPs, bandits have no state transitions—each action choice is stateless and independent. MABs replace traditional static A/B testing in digital marketing, ad click optimization, and website UI layout experiments by dynamically routing traffic to high-performing variations while continuously testing alternatives.

Multi-Armed Bandit vs Full MDP

  FULL MARKOV DECISION PROCESS (MDP)            MULTI-ARMED BANDIT (MAB)
  State s_t ──► Action a_t ──► Reward r_{t+1}   Action a_t ──► Reward r_t (Stateless!)
                └──────► Next State s_{t+1}

Multi-Armed Bandits are Stateless Single-Step MDPs:

Why Bandits Replace Static A/B Testing

  STATIC A/B TEST (Fixed 50/50 Allocation for 14 Days):
  Variation A (Winning):  50% Traffic ──► 10,000 Conversions
  Variation B (Losing):   50% Traffic ──► 2,000 Conversions  <-- Wasted 50% traffic on losing B!

  BANDIT ALGORITHM (Dynamic Traffic Allocation):
  Day 1: 50% A / 50% B ──► Day 3: 75% A / 25% B ──► Day 7: 95% A / 5% B
  Minimizes Opportunity Cost & Cumulative Regret!

Regret Bounds

Let $\mu^* = \max_{a} \mu_a$ be the expected reward of the true optimal arm.

Suboptimal arm gap $\Delta_a = \mu^* - \mu_a$.

$$\text{Cumulative Regret}(T) = \sum_{a=1}^K \mathbb{E}[N_a(T)] \cdot \Delta_a$$

Say this out loud

"Multi-Armed Bandits model stateless decision-making across K choices to maximize cumulative reward. Bandits replace static A/B testing by dynamically routing traffic to winning variations in real-time, minimizing cumulative regret. Optimal algorithms like Thompson Sampling and UCB achieve logarithmic O(ln T) regret bounds."

Follow-ups to expect

Check yourself

Question 1 of 3

Why are Multi-Armed Bandits (MAB) superior to traditional static A/B testing for real-time website UI optimization?

More in Reinforcement Learning

See all →
Value-Based vs Policy-Based Methods5 minProximal Policy Optimization5 minMarkov Decision Processes4 min