Log inStart free
LESSON 15.12 · 5 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

Multi-armed bandits and regret

Watch an agent pull 5 slot-machine arms and pay for every wrong pull.


Pro lesson. Stage 1 is free to watch. Pro opens all 5 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 15.12 · BANDIT BAY5 ARMS · BEST CHANCE 0.7 · Q₀ = 0
01
Stage 1 of 5 · The bandit
A multi-armed bandit has 5 arms. Each pull pays 1 with a hidden chance, else 0.
Explain it simply

Think of 5 slot machines in a row. Each one pays 1 point with its own chance, shown by the dashed marks. The agent cannot see those marks. It only has its guesses, the bars, and they all start at 0.

Five arms. Their hidden chances to pay are 0.2, 0.5, 0.7, 0.4, 0.6. Arm 3 is best. Every estimate starts at 0.

hidden chanceestimate Qexploit pullexplore pullregret
arm 1arm 2arm 3arm 4arm 5020pull t →0.2arm 1Q 0.00n 00.5arm 2Q 0.00n 00.7arm 3Q 0.00n 00.4arm 4Q 0.00n 00.6arm 5Q 0.00n 0armspullsQ₁ = … = Q₅ = Q₀ = 0arm 1arm 2arm 3arm 4arm 5020pull t →0.2arm 1Q 0.00n 00.5arm 2Q 0.00n 00.7arm 3Q 0.00n 00.4arm 4Q 0.00n 00.6arm 5Q 0.00n 0armspullsQ₁ = … = Q₅ = Q₀ = 0
Toy: 5 arms, 1,000 pulls, 3 seeded runs
STAGE 1 / 5
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
P(r=1)=μa,Qa=Q0P(\sy{r}{data}{r} = 1) = \sy{mu}{ink}{\mu_a}, \quad \sy{q}{out}{Q_a} = \sy{q0}{param}{Q_0}
μ=(0.2,0.5,0.7,0.4,0.6),Q0=0\mu = (0.2, 0.5, 0.7, 0.4, 0.6), \quad Q_0 = 0

Arm a pays 1 with chance mu; every estimate starts at Q₀.

Common mix-ups

MYTHAlways pulling the arm that looks best is enough.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01In run 1 with ε = 0, does the start guess Q₀ = 1 lower the regret?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 5
Unlock the full explainer
  • 4 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.