Q-Learning is a temporal-difference off-policy control algorithm that learns the optimal action-value function
Q∗ directly, with update
Q(s,a)←Q(s,a)+α[r+γmaxa′Q(s′,a′)−Q(s,a)], where
α is the learning rate,
r the immediate reward,
γ the discount factor,
s′ the resulting next state, and
maxa′Q(s′,a′) the greedy maximum over next-state actions (the target), the whole bracket being the TD error.It is off-policy: the behavior policy (how actions are sampled, e.g.
ε-greedy) is separated from the target policy (what is learned, greedy
max) — experience collected under any exploratory policy is used to optimize the greedy target
π(s)=argmaxaQ(s,a).Tabular convergence requires every
(s,a) visited infinitely often and step sizes satisfying the Robbins-Monro conditions
∑tαt=∞,∑tαt2<∞ (e.g.
αt=1/t), giving
Q→Q∗.