Q-learning is an off-policy TD control algorithm that directly learns the optimal action-value function .
Update rule:
Off-policy: the means we update toward the best possible action, regardless of what action the behavior policy actually took. The agent can explore (e.g., -greedy) while learning the optimal policy.
Algorithm (tabular):
- Initialize arbitrarily
- For each step: observe , take action (e.g., -greedy), observe
- Apply the update rule above
- Converges to given sufficient exploration and decaying learning rate
-greedy exploration:
- With probability : random action (explore)
- With probability : greedy action (exploit)
- Decay over time for convergence
Convergence: guaranteed to converge to in the tabular case under standard conditions (all state-action pairs visited infinitely often, learning rate decays appropriately).
Scaling up: tabular Q-learning fails for large/continuous state spaces → Deep Q-Network uses a neural network to approximate .
See also: SARSA, Miscoral Difference Learning, Deep Q-Network