ML Systems Lab Open interactive version →
Foundational 30 min read epsilon-greedyexplorationannealingnon-stationary

Epsilon-Greedy Exploration

Simplest exploration strategy, annealing schedules, failure modes, non-stationary rewards

You have 5 headlines for the same news article and no idea which gets the highest CTR. The traditional approach commits equal traffic to all 5 until you have 10K samples per variant, then picks the winner. While you're collecting that data, 80% of readers see a non-optimal headline — every one of those impressions is a missed opportunity. Epsilon-greedy attacks this directly: with probability ε, pick a random headline; otherwise show whichever has the highest estimated CTR so far. After 1,000 impressions you already have a leading candidate, and the exploit step sends most traffic there. Exploration keeps running in the background to correct initial estimates and catch changes.

The mechanism is straightforward but hides a critical flaw: it explores uniformly. Headline A with estimated CTR 3.1%, headline C with 4.2%, and headline D with 2.1% all get the same ε/K share of exploration traffic. Headline D is clearly worse — spending exploration budget there wastes capacity that could go toward distinguishing A from C. There is no mechanism to focus exploration where it matters.

The second flaw is deeper. With ε=0.1, every round has a 10% chance of random arm selection. In every such exploration round, the expected regret is Δ̄ — the average gap to the best arm — since exploration picks uniformly among all K arms; since a round is an exploration round with probability ε, the expected per-round regret averaged over all rounds is ε·Δ̄. Over T rounds, total exploration regret ≥ ε·T·Δ̄ — linear in T. No matter how small ε is, as long as it is fixed and positive, regret grows without bound. Annealing ε to zero is not optional — it is mathematically necessary for sub-linear regret.

NOT this. "Smaller ε is always better after initial exploration." If the arm rewards are non-stationary — headline CTR changes as the news cycle evolves — a decaying ε that goes to 0 stops adapting. The algorithm freezes on whatever was best when exploration stopped, even as the world changes. For non-stationary settings, maintain a minimum ε floor or switch to a method that tracks changing rewards explicitly.

Key points

Takeaway

Fixed ε causes linear regret because the exploration cost ε·T grows without bound — annealing ε_t → 0 is mathematically required, not optional. Uniform exploration is the core inefficiency: ε/K budget goes to every arm equally, wasting capacity on clearly inferior arms that UCB and Thompson Sampling would deprioritize automatically. The two critical production failure modes are cold start and stale means, both of which require patches that principled algorithms handle natively.

Recap

Check your understanding

Q1. You deploy ε=0.1 greedy for ad serving with K=50 ads. After 3 months, CTR on most ads has dropped 30% due to creative fatigue, but a new batch of ads was just added. Select the two problems actually occurring.

Q2. Prove informally that ε-greedy with fixed ε has linear regret (O(T)) even with optimal ε.

Q3. In a production system you compare two ε-greedy schedules over T=10,000 rounds with K=10 arms: (a) fixed ε=0.05, (b) annealed ε_t = c/t. Which achieves lower regret as T grows, and why?

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 →