Epsilon-Greedy Algorithm
Take the best-known action most of the time and a random one with probability ε.
The idea
With probability 1 − ε exploit (choose the action with the highest estimated value); with probability ε explore (choose uniformly at random). It is trivial to implement. ε is usually decayed, say from 1.0 to 0.05, so the agent explores a lot early and exploits later.
a = random with prob. ε, else argmax Q(s, a)
Watch it run
This is a real computation, not a drawing. Pause, step, change the settings, or try new random data.
- estimated value
- true value (dashed)
- arm just pulled
Pull 1: Exploit: pick the arm that looks best so far. Got reward 0.51.
- pulls:
- 1
- regret:
- 0.84
Bars are what the agent believes; dashed lines are the truth it is trying to discover.
Step by step
- 1Draw a random number between 0 and 1.
- 2If it is below ε, pick a random action.
- 3Otherwise pick the action with the highest estimated value.
- 4Observe the reward, update the estimate, lower ε a little.
Where it is used
The default exploration in Q-learning and DQN.
Watch out for
Explores blindly: it wastes tries on options already known to be bad.