This Reinforcement Learning concept is the current idea: keep the same invariant visible across Intuition, Math, Code, Interactive Demo.
Reinforcement Learning
Exploration and Exploitation
Exploration and exploitation is the horizon tradeoff: take known reward now, or spend pulls reducing uncertainty so future actions regret less.
Concept Structure
Exploration and Exploitation
Start with the picture, metaphor, or geometric mechanism.
Make the objects explicit and connect them with notation.
Mirror the equations with runnable implementation details.
Manipulate the mechanism and watch the idea respond.
Learner Contract
What this page should let you do.
1 prerequisite listed; refresh them before leaning on the math or code.
Explain the mechanism, trace the main notation, and test one prediction in the live demo.
Read the intuition before the notation; the math should name a mechanism you already felt.
Follow this edge after making one prediction here; the next page should reuse the result, not restart the route.
Claim/source review status
Substantive review recorded
1/1 claims have bounded review metadata; still check caveats and source scope.Metadata-derived; review may be AI-assisted. Not a human certification.01
Intuition
Build the mental picture first so the rest of the page has something to attach to.
Exploration and exploitation is not "curiosity versus greed" as a personality trait. It is a horizon problem.
At a single decision, exploitation is usually right: choose the arm with the largest current estimate and collect the reward that looks best. Across many decisions, that can fail. If the estimate is wrong because early samples were lucky or unlucky, the learner keeps training on data produced by its own mistake.
Exploration deliberately spends some reward opportunity to learn. That cost is real: trying a worse-looking arm can create immediate regret. The reason it can still be rational is that the information affects future choices. One exploratory pull may prevent many later exploitative pulls from going to the wrong action.
The key phrase is selected feedback. The learner only sees the reward for the action it took. Pulling Arm A does not reveal what Arm C would have paid. So every policy is also a data-collection policy.
Three behaviors are worth separating:
- Greedy exploitation follows the largest current estimate and can lock in when early evidence is misleading.
- Epsilon-greedy keeps a small random exploration budget, so every action can still receive samples.
- UCB explores more deliberately by adding an uncertainty bonus to under-sampled actions.
Regret is the accounting system that makes the tradeoff visible. Exploration may increase regret today, but if it identifies the better action, it can lower cumulative regret over the horizon.
02
Math
Translate the story into symbols, assumptions, and a derivation you can inspect.
Start with a stationary finite bandit. Each arm has an unknown mean reward
and the best mean is
The learner maintains an estimate from the rewards it actually observed after choosing arm . If is the number of observed pulls of arm before round , then a sample-average estimate is
Greedy exploitation chooses
This maximizes the current estimate, not necessarily the true mean. If an early lucky arm has a high and an early unlucky arm has a low , greedy selection can stop gathering the data that would correct the mistake.
Epsilon-greedy forces continued sampling:
UCB turns uncertainty into an action score:
The first term exploits the estimate. The second term explores arms with small . After an arm is sampled, its count grows and the bonus shrinks.
The expected regret of one action is
The cumulative pseudo-regret over a horizon is
This is why exploration cannot be judged from one reward. A low reward on a useful probe can still improve the future action sequence.
03
Code
Keep the implementation aligned with the notation so the algorithm is legible.
import math
true_mean = {"A": 0.55, "B": 0.45, "C": 0.72}
pulls = {"A": 3, "B": 2, "C": 1}
successes = {"A": 3, "B": 1, "C": 0}
plans = {
"greedy": ["A", "A", "A", "A", "A", "A", "A", "A"],
"epsilon": ["A", "C", "A", "B", "C", "A", "C", "C"],
"ucb": ["C", "A", "C", "C", "A", "C", "C", "C"],
}
def estimate(arm):
return successes[arm] / pulls[arm]
best = max(true_mean.values())
for name, actions in plans.items():
regret = 0.0
local_pulls = pulls.copy()
local_successes = successes.copy()
for arm in actions:
regret += best - true_mean[arm]
local_pulls[arm] += 1
local_successes[arm] += int(true_mean[arm] > 0.5)
final_q = {a: local_successes[a] / local_pulls[a] for a in true_mean}
print(name, "regret", round(regret, 3), "final estimates", final_q)
q = {a: estimate(a) for a in true_mean}
ucb = {a: q[a] + 0.8 * math.sqrt(math.log(7) / pulls[a]) for a in true_mean}
print("current estimates", q)
print("ucb scores", ucb)
The starting estimates make Arm A look safest, even though Arm C has the largest true mean. The difference between policies is not their first reward. It is the future data they cause themselves to collect.
04
Interactive Demo
Use direct manipulation to connect the explanation to a moving system.
Use the Regret Horizon Lab to predict which exploration behavior explains an eight-pull plan.
Inspect the starting estimates and counts, choose the behavior that best explains the hidden pull tape, and reveal only after committing. The lab then shows true means, policy regret, reward tape, and why an information cost can be better than greedy lock-in.
Live Concept Demo
Explore Exploration and Exploitation
The stage is code-native and interactive. Use it to test the explanation against the mechanism.
Manipulate one control and predict the visible change.
Commit to what Exploration and Exploitation should make visible before reading the result.
After The First Pass
Turn the concept into an inspected object.
Once the invariant is visible in the intuition, math, code, and demo, use these panels to inspect the mechanism visually, check source support, practice the idea, and attach a grounded research question.
Mechanism Storyboard
See the idea move before the page explains it
Exploration and exploitation is the horizon tradeoff: take known reward now, or spend pulls reducing uncertainty so future actions regret less.
Start with the picture, metaphor, or geometric mechanism.
Before reading further, choose the kind of change Exploration and Exploitation should make visible.
Visual Inquiry
Make the image answer a mathematical question
Exploration and exploitation is the horizon tradeoff: take known reward now, or spend pulls reducing uncertainty so future actions regret less.
Which visible object should carry the first intuition?
Pick the cue that should make Exploration and Exploitation easier to reason about before the page gives the answer.
Source Grounding
Canonical references for the mechanism on this page.
Canonical source for the exploration/exploitation dilemma, selected evaluative feedback, epsilon-greedy action selection, UCB action selection, and greedy long-run failure on bandit testbeds.
Open sourceGraduate RL source for exploration as decision-dependent information: decisions affect what the learner observes, and rewards are only observed for decisions actually made.
Open sourceGraduate source for finite-armed regret, pseudo-regret, explore-then-commit tradeoffs, epsilon-greedy context, and optimism via upper confidence bounds.
Open sourceClaim Review
Exploration and exploitation is the horizon tradeoff: take known reward now, or spend pulls reducing uncertainty so future actions regret less.
Claims without a substantive review badge still need exact source-support review.
sutton-barto-2018-rl, stanford-cs234-intro-rl-2026, lattimore-szepesvari-2020-bandit-algorithms
Use equations, runnable code, and demos to check whether the source support is operational.
The sources support the selected-feedback setting, the one-step versus long-run reward tradeoff, greedy lock-in under early noise, random exploration in epsilon-greedy, directed exploration through UCB optimism, and regret as the expected cost of action choices against the best arm.
Sources: Reinforcement Learning: An Introduction, Second Edition, Stanford CS234: Lecture 1, Introduction to Reinforcement Learning, Bandit AlgorithmsStationary finite Bernoulli bandit horizon lab only; excludes contextual/adversarial/nonstationary bandits, Thompson sampling, MDP exploration bonuses, proofs, and offline RL.A bounded review summary is present; still check caveats and exact reference scope.Checked Sutton/Barto Chapter 2, Stanford CS234 Lecture 1, and Lattimore/Szepesvari Chapters 6-7 for selected feedback, greedy lock-in, epsilon-greedy, UCB optimism, explore-then-commit tradeoff, and regret framing. GPT Pro critique remains pending because 127.0.0.1:51672 is unavailable.
Reviewer: codex-local-source-review; reviewed 2026-07-03Source support candidates
book 2018Reinforcement Learning: An Introduction, Second EditionCanonical source for the exploration/exploitation dilemma, selected evaluative feedback, epsilon-greedy action selection, UCB action selection, and greedy long-run failure on bandit testbeds.
course-notes 2026Stanford CS234: Lecture 1, Introduction to Reinforcement LearningGraduate RL source for exploration as decision-dependent information: decisions affect what the learner observes, and rewards are only observed for decisions actually made.
book 2020Bandit AlgorithmsGraduate source for finite-armed regret, pseudo-regret, explore-then-commit tradeoffs, epsilon-greedy context, and optimism via upper confidence bounds.
Practice Loop
Try the idea before it explains itself
Exploration and exploitation is the horizon tradeoff: take known reward now, or spend pulls reducing uncertainty so future actions regret less.
Before touching the demo, predict one visible change that should happen in Exploration and Exploitation.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
A concrete answer is on the canvas.
The answer names why the claim should hold.
It touches the page context or a neighboring idea.
Research Room
Attach the question to a claim, equation, code, or demo
Pick the concept, equation, source, runnable code, claim, misconception, or demo state before asking for help. The handoff keeps that page item in context.Open the draft below to save one note and next action in this browser.
Exploration and Exploitation
What is the smallest example that makes Exploration and Exploitation click without losing the math?
Local action draftNo local draft saved yetExpand only when ready to capture one local next action
This draft stays in this browser, attached to the selected learning item.
- References to inspect: attached references on this page.
- Definition, prerequisite, and contrast concept links
- The equation or runnable code that makes the concept operational
- One demo state that shows the invariant instead of a slogan
- The learner can state the mechanism in their own words
- The learner can name the prerequisite that would repair confusion
- The learner can predict how the mechanism changes under one perturbation
I am working in Continuous Function's research reading room. Object: concept - Exploration and Exploitation Selected item key: recorded for copy. Context: Reinforcement Learning Page anchor: recorded for copy. Open question: What is the smallest example that makes Exploration and Exploitation click without losing the math? Evidence to inspect: - References to inspect: attached references on this page. - Definition, prerequisite, and contrast concept links - The equation or runnable code that makes the concept operational - One demo state that shows the invariant instead of a slogan What would resolve this: - The learner can state the mechanism in their own words - The learner can name the prerequisite that would repair confusion - The learner can predict how the mechanism changes under one perturbation Answer as a careful research tutor: stay source-grounded, separate verified evidence from assumptions, name the relevant math objects, and end with one next action.
concept/concept-notebook/reinforcement-learning/exploration-exploitation
concept:reinforcement-learning/exploration-exploitation