but it learns an action's consequences only by taking that action. Exploitation chooses the behavior currently believed to be best. Exploration chooses behavior that may improve what the agent knows.
Sparse reward makes the distinction temporal. Suppose reward requires one particular action at each of L steps. Uniform random behavior succeeds with probability
P(successful sequence)=(∣A∣1)L.
If an ϵ-greedy policy must explore correctly at every step, the probability is approximately
P(successful exploratory sequence)≈(∣A∣ϵ)L.
Independent action noise therefore becomes exponentially ineffective with the depth of the required behavior.
Shallow exploration asks which single action pays more. Deep exploration asks which coherent strategy eventually reveals reward. The second problem motivates episode-level hypotheses, intrinsic motivation, goals, and reusable skills.
Bandits Isolate the Exploration Tradeoff
A stochastic multi-armed bandit has actions a∈A with unknown reward distributions
rt∼Rat,
and mean values
Q(a)=E[r∣a].
The optimal arm satisfies
a∗∈argamaxQ(a),V∗=Q(a∗).
Bandits remove state transitions and delayed credit assignment while retaining uncertainty about which action is best.
After Nt(a) pulls, the empirical mean is
Qt(a)=Nt(a)1τ=1∑trτ1{aτ=a}.
Pure greed chooses the largest empirical mean. An unlucky early reward can make a suboptimal arm look best, after which greed gathers no evidence capable of correcting itself.
Regret prices exploration
Define the arm gap
Δa=V∗−Q(a)≥0.
Cumulative expected regret is
LT=E[t=1∑T(V∗−Q(at))].
It decomposes into the cost of each suboptimal arm times how often it is selected:
LT=a∈A∑ΔaE[NT(a)].›See derivation
Replace instantaneous regret by the selected arm's gap:
LT=E[t=1∑TΔat].
Group time steps by action:
t=1∑TΔat=a∈A∑Δat=1∑T1{at=a}.
The inner sum is exactly
NT(a).
Taking expectations gives the result.
Sublinear regret,
LT=o(T),
implies vanishing average regret LT/T→0. Fixed-rate exploration and permanent greed can both suffer linear regret: one wastes actions forever, while the other may never correct an early mistake.
A contextual bandit observes st before acting and learns
Q(s,a)=E[r∣s,a],
but actions still do not affect future contexts. It introduces generalization without sequential credit assignment.
Simple Rules Inject Local Randomness
Under the common convention that uniform exploration may also select the greedy action,
GLIE schedules become greedy in the limit while preserving infinite exploration:
Nt(s,a)→∞,πt(a∣s)→1{a∈arga′maxQt(s,a′)}.
This requires ϵt→0 slowly enough that exploration does not disappear after finitely many trials.
Boltzmann exploration distinguishes among alternatives by value:
πτ(a∣s)=∑a′eQ(s,a′)/τeQ(s,a)/τ.
As τ→0, it becomes greedy; as τ→∞, it approaches uniform. Value magnitude is not calibrated uncertainty, however. A confidently poor estimate and an uncertain estimate can receive the same probability.
Optimistic initialization instead starts with
Q0(s,a)≈1−γRmax.
Greedy action selection tries unvisited actions because their estimates remain high. The optimism is transient, can generalize incorrectly under function approximation, and still does not sustain a coherent multi-step hypothesis.
All three methods perturb individual actions. They are useful baselines, but deep exploration needs uncertainty that persists across time.
Optimism Turns Uncertainty into Value
Upper confidence bounds assign each arm an optimistic score
Ut(a)=Qt(a)+bt(a),
then select
at∈argamaxUt(a).
If an optimistic arm is good, it produces reward. If it is poor, sampling shrinks its uncertainty until its score falls.
Assume rewards are σ-sub-Gaussian. For n independent samples with mean μ,
P(μ−μn≥ε)≤exp(−2σ2nε2).
Solving for a failure probability δ gives the one-sided confidence radius
b(n,δ)=n2σ2log(1/δ).›See derivation
Set the tail bound equal to δ:
exp(−2σ2nε2)=δ.
Taking logarithms and rearranging,
ε2=n2σ2log(1/δ).
Since a radius is nonnegative,
ε=n2σ2log(1/δ).
For unit-sub-Gaussian rewards, a horizon-aware UCB rule is
at∈argamax[Qt(a)+Nt(a)2logT].
The bonus decays as Nt(a)−1/2. A suboptimal arm remains plausible until
NT(a)logT≲Δa,
or
NT(a)≳Δa2logT.
Each pull costs Δa, suggesting regret
LT=O(a:Δa>0∑ΔalogT).
Uncertainty is not an inconvenience added to value—it becomes a temporary source of value that disappears when evidence resolves it.
Thompson Sampling Commits to a Plausible World
Bayesian exploration places a posterior over unknown reward or dynamics parameters:
p(θ∣D)∝p(D∣θ)p(θ).
Thompson sampling draws one plausible model and acts optimally in it:
θt∼p(θ∣ht),at∈argamaxQθt(a).
Beta–Bernoulli updates
For binary rewards,
r∣θ∼Bernoulli(θ),θ∼Beta(α,β).
After S successes and F failures,
θ∣D∼Beta(α+S,β+F).›See derivation
Ignoring normalization constants,
p(θ∣D)∝θS(1−θ)Fθα−1(1−θ)β−1=θα+S−1(1−θ)β+F−1.
This is the kernel of a Beta(α+S,β+F) density.
For each arm, sample
θa∼Beta(αa,βa),
select argmaxaθa, and update only the chosen arm. Exploration decays automatically as poor arms become unlikely under the posterior.
Thompson sampling implements probability matching:
The expectation of an indicator is the probability of its event, giving the posterior probability that a is optimal.
In an MDP, posterior sampling can draw an entire environment
(P,R)∼p(P,R∣hk),
plan in it, and follow its optimal policy for a full episode. Posterior Sampling for Reinforcement Learning therefore maintains one coherent hypothesis across many steps:
at∈argamaxQP,R∗(st,a).
If the sampled world suggests that a distant corridor is valuable, the policy commits long enough to test that hypothesis. This is deep exploration rather than independently resampled action noise.
Posterior Sampling for Reinforcement LearningMaintain p(P,R∣hk).At the beginning of episode k:(Pk,Rk)∼p(P,R∣hk),πk←PLAN(Pk,Rk),follow πk for the whole episode,update the posterior with the new trajectory.
Exact posterior inference and repeated planning are usually expensive. Bootstrapped Q-heads, Bayesian last layers, and sampled ensembles approximate the same persistent-hypothesis idea in deep RL.
Exploration Bonuses in Large State Spaces
Bandit optimism becomes an augmented reward in an MDP:
r+(s,a)=r(s,a)+rint(s,a).
A tabular bonus may use
rint(s,a)∝N(s,a)1
or a faster-decaying 1/N(s,a). The optimistic Q update is
Exact counts fail for pixels and continuous states because almost every observation is unique. Novelty must generalize across similar observations.
Density-model pseudo-counts
Let a density model assign probability
ρ=pθ(s)
before learning from s, and
ρ′=pθ′(s)
afterward. Define imaginary tabular quantities by
ρ=nN(s),ρ′=n+1N(s)+1.
Solving gives
N(s)=ρ′−ρρ(1−ρ′).›See derivation
From ρ=N/n,
N=nρ.
Substitute into the post-update probability:
ρ′=n+1nρ+1.
Rearranging,
n=ρ′−ρ1−ρ′.
Multiplying by ρ yields
N(s)=ρ′−ρρ(1−ρ′).
A learning-positive density model has ρ′>ρ, so the denominator is positive.
A large probability increase means the observation taught the model a lot, producing a small pseudo-count and a large novelty bonus. If the model barely changes, the state behaves as familiar.
Prediction-error novelty
Random Network Distillation fixes a random target fξ and trains a predictor fϕ:
rint(s)=∥fϕ(s)−fξ(s)∥22.
Visited observations become easy to predict, while unfamiliar observations retain error. A forward model can similarly reward
An agent rewarded for error may stare forever at an inherently unpredictable screen—the noisy-TV problem. Learning progress and posterior information gain better target reducible uncertainty.
Generalization Changes What a Count Means
With function approximation, one observation changes predictions at many state-action pairs. Uncertainty depends on coverage in representation space, not literal repetition.
The bonus is large in feature directions poorly covered by previous data. It is the geometric analogue of 1/N(a).
Deep representations make this geometry nonstationary and their uncertainty harder to calibrate. Ensembles and bootstrapped heads provide useful approximations, but they do not inherit tabular guarantees automatically.
Curiosity Values Information
State-marginal entropy measures breadth of visitation:
H(dπ)=−Es∼dπ[logdπ(s)].
Maximizing it encourages coverage, although not every reachable state is equally relevant.
Intrinsic rewards differ in what they call interesting:
Information gain directly measures how much an observation changes beliefs about an uncertain model parameter Θ:
IG(x)=DKL(p(θ∣D,x)∥p(θ∣D)).
Before observing the outcome, the expected information gain of an action is
Ex∼p(x∣a,D)[DKL(p(θ∣D,x)∥p(θ∣D))].
This equals conditional mutual information:
Ex[IG(x)]=I(Θ;X∣D).
Curiosity should reward observations that reduce epistemic uncertainty, not outcomes that remain surprising because of irreducible aleatoric noise.
Choosing an Exploration Strategy
The right mechanism depends on both uncertainty and temporal depth.
Use ϵ-greedy or Boltzmann sampling as cheap local baselines.
Use UCB when calibrated confidence sets or meaningful counts are available.
Use Thompson sampling when a posterior can represent coupled uncertainty and a sampled hypothesis can persist.
Use pseudo-counts or RND when state spaces are large and novelty must generalize.
Use information gain or learning progress when stochastic distractions make raw prediction error unreliable.
Exploration always depends on representation. A count, posterior, or density model declares two observations similar according to its features. Bad features turn principled formulas into misleading bonuses.
The progression is
random actions⟶uncertainty-aware actions⟶coherent hypotheses⟶information-seeking behavior.
When useful behavior must persist beyond a single decision, exploration can be lifted into temporally extended goals and skills. That is the subject of skill learning.
Exploration is therefore not synonymous with randomness. Useful exploration selects behavior whose outcomes can change what the agent knows.