Technical Note: Q-Learning: With Bounded Rewards and Learning Rates with Σα = ∞, Σα² < ∞ at Every State–Action Pair, Tabular Q-Learning Converges to Q* with Probability 1Research Paper
Motivation
Q-learning is the basic model-free algorithm of reinforcement learning: an agent that does not know the transition probabilities or the reward structure of a controlled Markov process learns the optimal action values from experience alone, by a one-line update applied after every observed transition. It was introduced in C. J. C. H. Watkins' 1989 thesis, and the convergence theorem posed here is the one proved in C. J. C. H. Watkins and P. Dayan, Technical Note: Q-Learning, Machine Learning 8 (1992), 279–292 (doi:10.1023/A:1022676722315). Every later analysis of tabular temporal-difference control, and much of deep reinforcement learning's vocabulary, starts from this algorithm.
Timeline.
- 1989: Watkins' thesis introduces Q-learning and sketches a convergence argument.
- 1992: Watkins and Dayan publish the proof via the action-replay process, for bounded rewards, discount and learning rates satisfying condition (3) at every state–action pair.
- 1994: Jaakkola, Jordan and Singh (Neural Computation 6) and Tsitsiklis (Machine Learning 16) give proofs through stochastic approximation for asynchronous iterations, with predictable random choices of state, action and step.
- Later work (Szepesvári 1997; Even-Dar and Mansour 2003) quantifies the convergence rate.
Setting
A finite controlled Markov process has a finite state set , a finite nonempty action set (the same in every state), mean rewards and transition probabilities . Rewards received steps later are discounted by with . The optimal action-value function is the unique solution of the Bellman optimality equation
In the -th episode the agent observes a state , performs an action , observes the next state and a reward of mean , and updates its table with a learning rate :
from given initial values . Episodes need not form a single trajectory. Writing for the episode of the -th visit to , the learning-rate condition is
The proof uses the action-replay process (ARP): from the recorded episodes one builds a finite-horizon process with states (a real state and a level ), in which taking at replays a randomly chosen earlier episode that tried in , emitting its reward and dropping to the level below that episode. Its expected one-step reward is and its aggregated transition probabilities are .
Formalization targets
Goal: the Theorem (p. 282)
Given bounded rewards , learning rates and (3),
Milestones (the paper's appendix, in attack order)
- Lemma A (p. 288): for all and .
- Lemma B.1 (p. 289): the values of actions with and without a continuation policy differ by at most .
- Lemma B.2 (p. 289): started high enough, the ARP strays below any level within actions with arbitrarily small probability.
- The stochastic-convergence theorem quoted in the proof of B.3 (p. 290): with , and bounded of mean converges to almost surely.
- Lemma B.3 (p. 290): almost surely and .
- Lemma B.4 (p. 291): rewards within and transition rows within give values of actions within .
A further item states that the optimality equation has exactly one solution for .
Significance
The result. The theorem is the first guarantee that an agent can find optimal behaviour in an unknown finite Markov decision process from samples, with a per-step cost independent of the model. It is the template for convergence results on SARSA, TD(), double Q-learning and asynchronous value iteration, and it is the reference point against which finite-sample rates and function-approximation counterexamples are measured.
Formalizing it. The theorem has been proved since 1992–1994; this mission asks for a machine-checked proof. Two parts are reusable beyond Q-learning: the almost-sure convergence of scalar stochastic averaging with adapted steps (a Robbins–Siegmund type statement), and the perturbation bounds for finite-horizon values of Markov chains (B.1, B.4). The paper's own assembly in §3.2 bounds the error for each fixed action sequence and then passes to optimal behaviour; that passage is not justified on the page, so a complete development may route the final step differently. The milestones are the paper's lemmas as stated, with the corrections listed below.
Difficulty
The update touches one table entry at a time, at random times chosen by the agent, and its target depends on the current estimates, so the iteration is neither a plain average nor a contraction applied synchronously. Treating each entry as a separate Robbins–Monro average fails because the targets move with the other entries. The paper's device is to recognize as exact optimal values of the ARP (Lemma A), which turns the analysis into showing that the ARP, viewed from a high level, behaves like the real process for many steps; the probabilistic content is then concentrated in Lemma B.3, and the deterministic content in B.1, B.2 and B.4.
Formalization scope
Everything lives in the namespace QLearning.Convergence, with one definitions module QLearning.Convergence.Setting. Conventions:
- and are
Fintypes with decidable equality, is nonempty, and isFinset.sup'. The process is a structure withR x aandP x a y, rows nonnegative and summing to . - enters the goal through the predicate
IsOptimalQ M γ Q(the optimality equation), which has exactly one solution (separate item); it is not defined by a limit or a choice. - Lean index is the paper's episode ; index of the episode data is unused and
qIter … 0. - Condition (3) is written over episodes: the learning rate charged to at episode is if and otherwise; its partial sums tend to and its squares are summable. This equals (3) and forces infinitely many visits.
- Probability model (pinned). The paper describes it in words only. On a filtered probability space, are -measurable, are -measurable, , , , , and (3) holds almost surely. Fixed episode schedules with independent outcomes are a special case.
- The ARP deck at level includes card (as in the card game and Lemma A's proof); keeps the printed range of levels ; ARP optimality is over deterministic Markov policies of the ARP. Finite action sequences are lists of actions with terminal reward.
- Corrections disclosed in the items. B.1 is stated with (the page's strict inequalities fail for a constant reward). B.4 assumes closeness of transition rows in and : with the page's entrywise closeness the printed constant is false once . The stochastic-convergence theorem is read with conditional mean and adapted steps.
Trivializing formalizations are ruled out: the optimality predicate is satisfiable, conditional expectations are taken only of bounded measurable variables, the goal is the almost-sure statement under the probability model above rather than a pathwise or fixed-schedule one, and the ARP's optimal value is a supremum over policies, not the Q-learning recursion.
The development needs finite Markov chain values and contraction arguments (available in Mathlib in pieces), conditional expectations and almost-sure convergence for adapted sequences (Mathlib's martingale library), and the ARP construction above. Proofs of any milestone, alternative routes to the goal, and reusable lemmas on stochastic averaging are welcome. §4's extensions (absorbing undiscounted processes, multiple updates per episode) and equation (4) are not posed.
Selected references
- C. J. C. H. Watkins and P. Dayan, Technical Note: Q-Learning, Machine Learning 8 (1992), 279–292. https://doi.org/10.1023/A:1022676722315
- C. J. C. H. Watkins, Learning from Delayed Rewards, PhD thesis, University of Cambridge, 1989.
- T. Jaakkola, M. I. Jordan and S. P. Singh, On the Convergence of Stochastic Iterative Dynamic Programming Algorithms, Neural Computation 6 (1994), 1185–1201. https://doi.org/10.1162/neco.1994.6.6.1185
- J. N. Tsitsiklis, Asynchronous Stochastic Approximation and Q-Learning, Machine Learning 16 (1994), 185–202. https://doi.org/10.1007/BF00993306
- H. J. Kushner and D. S. Clark, Stochastic Approximation Methods for Constrained and Unconstrained Systems, Springer, 1978. https://doi.org/10.1007/978-1-4684-9352-8