Explore vs. Exploit
The timeless tension between sticking with what you know works and venturing into the unknown in search of something even better.
Imagine you have just moved to a new city. On your very first night, you wander into a cozy noodle shop on the corner. The broth is rich, the service is warm, and you leave with a smile.
The next evening, dinner rolls around again. Now you face a quiet little dilemma. You could walk straight back to that corner noodle shop—you already know it is good. Or you could step through the unmarked wooden door two blocks away. It might be the best meal you have ever tasted. Then again, it might be soggy and overpriced.
Every time you choose the reliable favorite, you are exploiting what you already know. Every time you try an unfamiliar door, you are exploring to gather new information.
In reinforcement learning, nobody hands the agent a guidebook. To earn the biggest rewards over time, an agent has to spend some of its turns testing options that might disappoint—just to be sure it isn't missing a hidden gem.
The Four Mystery Machines
Researchers love to strip this restaurant problem down to its purest visual form: a row of glowing arcade machines, often called a multi-armed bandit. Each machine has a lever you can pull, and each pull drops a handful of golden coins.
Here is the catch: every machine has its own hidden generosity. One might quietly average around 7 or 8 coins per pull, while another hovers near 2 or 3. Worse still, every machine is noisy—even a stingy machine occasionally gets lucky and spills a big pile of coins, and even the best machine has the occasional dry spell.
Before we talk about how a smart agent solves this, step up to the arcade yourself. You have four mystery machines in front of you. Click any machine to pull its lever, watch its average payout bar settle, and notice how the translucent uncertainty halo around each bar shrinks as you get to know that machine better.
Click any machine (or press keys 1–4) to pull its lever. Watch the glowing uncertainty band tighten as you gather evidence, and try to keep your haul close to the hidden best machine.
After 20 or 30 pulls, click Reveal Hidden Truths. Did you find the real jackpot, or did an early lucky splash trick you into loyalty to the second-best machine?
Two Ways to Fail
Playing the machines yourself reveals the two opposite traps waiting for any learner:
- Pure Greed gets trapped by early luck. Suppose you try each machine once. The true jackpot happens to have a sluggish first pull, while a mediocre machine gets lucky and drops a handful of coins. A purely greedy agent locks onto that mediocre machine immediately—and never looks back. Because it never pulls the jackpot again, it never discovers its mistake.
- Pure Curiosity wastes its turns. On the other extreme, an agent that always picks randomly will quickly learn which machine is the best—yet it keeps pulling the duds anyway, throwing away coins long after the mystery is solved.
Good decision-making lives in the balance between these two extremes. Somehow, an agent needs to be curious enough to escape early illusions, yet decisive enough to cash in once the picture becomes clear.
Two Visual Strategies That Work
There are two classic, deeply intuitive ways to strike that balance. You don't need a single formula to picture either of them.
1. Occasional Curiosity
Picture an agent with a simple Curiosity Dial set to, say, 15%. Most of the time—85% of turns—it walks straight to whichever machine currently looks best and pulls it. But on the remaining 15% of turns, it gets a sudden itch to explore and picks a machine completely at random.
That tiny dash of randomness acts like an escape hatch. Even if early luck fools the agent for a few rounds, its occasional curious pulls keep poking the other machines until the true winner's bar rises above the rest.
2. Optimism in the Face of Uncertainty
Look back at the glowing translucent bands in Lab 1. Every machine you have barely touched wears a wide uncertainty halo stretching high above its current average. That upper edge is the machine's hopeful ceiling: "Given how little I know about this machine, how good could it plausibly be?"
An optimistic agent follows one elegant rule: always pull the machine with the highest hopeful ceiling.
- Untried machines have a sky-high ceiling, so the optimist naturally tests them early.
- Every pull shrinks that machine's halo. If a machine turns out to be a dud, its average drops and its halo shrinks, so its ceiling collapses and the optimist moves on.
- If a machine genuinely pays well, its average stays high even after its halo shrinks—so its ceiling remains on top, and the optimist automatically settles in to harvest coins.
Notice the difference: Occasional Curiosity explores blindly—even pulling a machine it already knows is terrible just because a random coin flip said so. Optimism explores with purpose. It only spends curiosity on machines that still have a genuine chance of being the best.
Watch Three Personalities Compete
Let's put all three personalities side by side on the exact same four mystery machines for 150 pulls:
- Pure Greed — tests each machine once, then stubbornly pulls whichever looked best on that first impression.
- Curious Explorer — mostly picks its current favorite, with a random curious pull controlled by your Curiosity Dial.
- Hopeful Optimist — always pulls the machine with the highest hopeful ceiling (average + uncertainty halo).
Hit Run Race and watch both the growing coin curves on the left and the pull-count bars on the right. Try dragging the Curiosity Dial all the way down to 0% (so Curious Explorer becomes greedy) or up to 50% (so it wastes half its turns guessing), then hit New Machines to test another random arcade!
All three agents face the same hidden machines. Watch how early luck traps Pure Greed, while curiosity and optimism discover the starred jackpot and pull away.
Run a few fresh arcades with New Machines. Occasionally Pure Greed gets lucky on pull one and ties the leaders—but far more often, it locks onto a runner-up and falls steadily behind. Meanwhile, the Hopeful Optimist explores briskly at the start and then pours almost every remaining pull into the starred winner.
Key Takeaways
- Exploiting cashes in on your current favorite; exploring gathers information that can uncover a much better option.
- Pure greed is fragile because noisy early luck can lock an agent onto a mediocre choice forever.
- Occasional Curiosity breaks out of traps by reserving a small share of turns for random exploration.
- Optimism in the Face of Uncertainty explores smarter: it treats uncertainty as a hopeful bonus, naturally focusing curiosity on machines that might still beat the leader.