Q-learning estimates the optimal action-value function purely from experience, without ever modeling or .
Update rule
After taking action in state , observing reward and next state :
is the learning rate. The bracketed term is the TD error — the difference between current and the bootstrap target .
Why max in the target
The target uses — the value of acting optimally next, regardless of what the agent actually does. This is what makes Q-learning off-policy: you can learn the optimal Q-function while behaving according to some other policy (e.g., random exploration). Compare to SARSA, which uses for whatever was actually taken — on-policy.
Convergence
Tabular Q-learning converges to with probability 1 if:
- All state-action pairs are visited infinitely often.
- Learning rate satisfies Robbins-Monro: and .
- Bounded rewards.
In practice you use a small constant or slowly decaying and exploration strategies that visit every state-action pair sufficiently often.
Exploration
A greedy policy w.r.t. current may never explore — you'd never visit suboptimal actions and so never learn their values. Standard fix: -greedy — pick the greedy action with probability , a random action with probability . Decay over training.
More sophisticated: UCB-based exploration, Boltzmann (softmax over Q-values), intrinsic motivation (count-based bonuses).
Function approximation: deep Q-learning
When the state space is huge or continuous, you can't tabulate Q. Replace the table with a neural network: approximates . Train by minimizing TD error.
This is the basic idea of DQN (Mnih et al., 2015), which played Atari from pixels. Required tricks to make it stable:
- Experience replay: store transitions in a buffer, sample minibatches randomly. Decorrelates updates.
- Target network: a delayed copy of used to compute the bootstrap target. Reduces the chasing-its-own-tail dynamics.
Q-learning generalizes far past Atari. AlphaZero is conceptually MCTS guided by a learned value network — a richer cousin of Q-learning at the algorithmic level.