Exploration Strategies

An RL agent only learns from the states it actually visits. That makes exploration more than a data-collection trick: it shapes which errors can be corrected. If the policy becomes confident too early, a useful action can remain invisible because the agent never tries the first step that would reveal it.

The core design question is where to put the exploration pressure. Some methods change how actions are sampled. Some change the values the agent starts with. Some add a bonus to reward. Others change the objective so uncertainty or randomness is part of what the policy optimizes.

The map below compares those choices. Use it to separate methods that add broad randomness from methods that deliberately point the agent toward novelty, uncertainty, or information.

Exploration map

Where does the exploration pressure come from?

Select a method to see whether it adds random action pressure or directs the agent toward uncertainty, novelty, or information.

Undirected exploration

Adds randomness so the agent keeps trying actions.

3 methods

Directed exploration

Points exploration toward states or actions that may teach the agent something.

6 methods

Undirected

Epsilon-greedy

Action choice
1
Rank actions by Q
2
Occasionally override
3
Try a random action

What changes

Sometimes ignore the best-looking action and pick randomly.

Signal used

A fixed random-action probability.

With epsilon = 0.10, 90% of choices use argmax Q and 10% are random.

Undirected methods keep the policy from collapsing too early. Directed methods try to spend exploration on places where new evidence is most likely to matter.

Entropy bonuses are one especially important way to add exploration pressure because they change the learning objective itself. Instead of only asking, "How much reward did this policy get?", the objective also asks, "Did the policy keep multiple actions available while it was still uncertain?"

Entropy is a measure of how spread out a policy is. A deterministic policy has low entropy because nearly all probability sits on one action. A stochastic policy has higher entropy because it keeps alternatives alive.

A common soft-RL objective adds entropy to return:

Jsoft(π)=Eπ[∑trt+αH(π(⋅∣st))]J_{soft}(\pi)=\mathbb{E}_{\pi}\left[\sum_t r_t+\alpha H(\pi(\cdot\mid s_t))\right]

Each term has a role. Jsoft(π)J_{soft}(\pi) is the objective being optimized for policy π\pi. Eπ\mathbb{E}_{\pi} means the score is averaged over trajectories generated by following that policy. ∑trt\sum_t r_t is the total reward collected across time steps. rtr_t is the reward at time tt.

The entropy term is H(π(⋅∣st))H(\pi(\cdot\mid s_t)). Here sts_t is the state at time tt, and π(⋅∣st)\pi(\cdot\mid s_t) is the full action distribution the policy assigns in that state. HH measures how spread out that distribution is: higher entropy means the policy keeps more actions possible. α\alpha sets how much that entropy bonus matters compared with reward.

The coefficient α\alpha controls the tradeoff. Larger α\alpha rewards exploration pressure; smaller α\alpha lets the policy become greedier. The goal is not chaos. The goal is to avoid locking onto a brittle behavior before the agent has enough evidence.

Exploration pressure

How much randomness should survive?

A sparse grid task has a known-looking path and a rarely discovered shortcut. Choose how strongly the policy keeps alternate actions alive.

alpha

0.12

policy entropy

71%

shortcut found

68%

Forward38%
Left25%
Right17%
Inspect20%

Objective effect

A larger entropy bonus makes premature certainty expensive, so the policy keeps multiple actions viable while it gathers evidence.

Probability is spread across several actions.

Training return

63%

The agent sacrifices some immediate return to keep gathering information. This is often helpful in sparse, changing, or continuous-control tasks.

Entropy bonuses do not mean random behavior forever. They make premature certainty expensive while the agent is still learning.
⚠

Sparse Rewards Make Exploration Expensive

When reward arrives only after a long action sequence, random exploration may almost never stumble onto success. A policy can learn that standing still, spinning, or repeating a safe local action has better expected value than taking risky steps toward a distant payoff.

Checkpoint

Why can an entropy bonus help in a sparse-reward environment?