Hyoungseo Son
Reinforcement Learning Theory
Contents · Reinforcement Learning Theory

Part 1 · Bellman & Value Iteration

  • Bellman Operators and Value Iteration

Part 2 · Policy Gradients

Part 3 · Trust Regions

Part 1 · Bellman & Value Iteration

Bellman Operators and Value Iteration

Reinforcement learning and dynamic programming both rest on a single idea: apply one operator to a value function over and over, and the iterates converge. The reason they converge is not luck. The operator is a contraction, and its contraction rate is exactly the discount factor γ\gamma. That one fact powers value iteration, policy iteration, and every temporal-difference method that approximates a Bellman backup.

The Bellman optimality operator

Fix a finite Markov decision process (S,A,P,r,γ)(\mathcal{S}, \mathcal{A}, P, r, \gamma) with γ[0,1)\gamma \in [0, 1). A value function V:SRV : \mathcal{S} \to \mathbb{R} is just a vector in RS\mathbb{R}^{\lvert \mathcal{S} \rvert}. The Bellman optimality operator TT^{\ast} maps a value function to a new one by taking the best one-step lookahead:

(TV)(s)=maxaA sP(ss,a)[r(s,a,s)+γV(s)].(T^{\ast} V)(s) = \max_{a \in \mathcal{A}} \ \sum_{s'} P(s' \mid s, a)\,\bigl[\, r(s, a, s') + \gamma\, V(s') \,\bigr].

The optimal value function VV^{\ast} is characterized as the fixed point of this operator, the Bellman optimality equation V=TVV^{\ast} = T^{\ast} V^{\ast}.1 Value iteration simply applies the operator repeatedly from any start, Vk+1=TVkV_{k+1} = T^{\ast} V_k, and hopes to land on VV^{\ast}.

A gamma-contraction in the sup-norm

Measure value functions in the sup-norm V=maxsV(s)\lVert V \rVert_{\infty} = \max_s \lvert V(s) \rvert. The claim is that TT^{\ast} shrinks distances by at least γ\gamma:

TVTW  γVW.\lVert T^{\ast} V - T^{\ast} W \rVert_{\infty} \ \le \ \gamma\, \lVert V - W \rVert_{\infty}.

The proof is two lines. Start from the elementary inequality maxaf(a)maxag(a)maxa(f(a)g(a))\max_a f(a) - \max_a g(a) \le \max_a \bigl(f(a) - g(a)\bigr). Applying it at a fixed state ss and cancelling the reward and transition-probability terms, which do not depend on the value function,

(TV)(s)(TW)(s)  maxaγsP(ss,a)(V(s)W(s)).(T^{\ast} V)(s) - (T^{\ast} W)(s) \ \le \ \max_a\, \gamma \sum_{s'} P(s' \mid s, a)\,\bigl( V(s') - W(s') \bigr).

Each inner sum is a convex combination of the differences V(s)W(s)V(s') - W(s'), so it is bounded by VW\lVert V - W \rVert_{\infty}. The same bound holds with VV and WW swapped, giving (TV)(s)(TW)(s)γVW\lvert (T^{\ast} V)(s) - (T^{\ast} W)(s) \rvert \le \gamma \lVert V - W \rVert_{\infty} for every ss, and taking the max over ss finishes it.2 The discount factor is the entire budget for how much the operator can fail to contract.

Banach gives geometric convergence

The space (RS,)\bigl( \mathbb{R}^{\lvert \mathcal{S} \rvert}, \lVert \cdot \rVert_{\infty} \bigr) is complete, and TT^{\ast} is a contraction with modulus γ<1\gamma < 1. The Banach fixed-point theorem then delivers three facts at once: TT^{\ast} has a unique fixed point VV^{\ast}, the iterates Vk+1=TVkV_{k+1} = T^{\ast} V_k converge to it from any starting V0V_0, and the convergence is geometric,

VkV  γkV0V.\lVert V_k - V^{\ast} \rVert_{\infty} \ \le \ \gamma^{k}\, \lVert V_0 - V^{\ast} \rVert_{\infty}.

To reach accuracy ε\varepsilon takes on the order of log(1/ε)/log(1/γ)\log(1/\varepsilon) / \log(1/\gamma) iterations, which blows up as γ1\gamma \to 1: long-horizon problems are genuinely harder to solve, and the contraction rate says exactly how much.

A two-state worked example

Take two states {A,B}\{A, B\} and γ=0.9\gamma = 0.9. In BB the only move pays reward 11 and stays in BB; in AA the agent chooses between waiting (reward 00, stay in AA) and going (reward 00, move to BB). Both transitions are deterministic, so the operator is

(TV)(A)=max(γV(A), γV(B)),(TV)(B)=1+γV(B).(T^{\ast} V)(A) = \max\bigl( \gamma V(A),\ \gamma V(B) \bigr), \qquad (T^{\ast} V)(B) = 1 + \gamma V(B).

Apply TT^{\ast} to two different value functions,

V=[00],W=[510],VW=10.V = \begin{bmatrix} 0 \\ 0 \end{bmatrix}, \qquad W = \begin{bmatrix} 5 \\ 10 \end{bmatrix}, \qquad \lVert V - W \rVert_{\infty} = 10.

Then TV=(max(0,0), 1+0)=(0,1)T^{\ast} V = (\,\max(0, 0),\ 1 + 0\,) = (0, 1) and TW=(max(4.5,9), 1+9)=(9,10)T^{\ast} W = (\,\max(4.5, 9),\ 1 + 9\,) = (9, 10), so

TVTW=max(09, 110)=9=0.9×10=γVW.\lVert T^{\ast} V - T^{\ast} W \rVert_{\infty} = \max\bigl(\lvert 0 - 9 \rvert,\ \lvert 1 - 10 \rvert\bigr) = 9 = 0.9 \times 10 = \gamma\, \lVert V - W \rVert_{\infty}.

The bound is met with equality, so γ\gamma is the tightest possible constant. The fixed point solves V(B)=1+0.9V(B)V^{\ast}(B) = 1 + 0.9\,V^{\ast}(B), giving V(B)=10V^{\ast}(B) = 10 and V(A)=0.9×10=9V^{\ast}(A) = 0.9 \times 10 = 9. Running value iteration from V0=0V_0 = 0 makes the geometric law exact rather than merely an upper bound:

VkV=10(0.9)k=10, 9, 8.1, 7.29, \lVert V_k - V^{\ast} \rVert_{\infty} = 10\,(0.9)^{k} = 10,\ 9,\ 8.1,\ 7.29,\ \dots

Each sweep multiplies the error by precisely γ\gamma, so on a log axis the error falls along a straight line of slope logγ\log \gamma.

Value iteration in a gridworld

The demo runs the same operator on a stochastic gridworld. An action succeeds with probability 1slip1 - \text{slip} and otherwise slips to a perpendicular cell; the goal pays +1+1 and the pit pays 1-1. Stepping Vk+1=TVkV_{k+1} = T^{\ast} V_k fills in the value heatmap and the greedy policy arrows converge. The second panel plots VkV\lVert V_k - V^{\ast} \rVert_{\infty} against kk on a log axis, with the bound γkV0V\gamma^{k} \lVert V_0 - V^{\ast} \rVert_{\infty} overlaid.

Value iteration on a stochastic gridworldinteractive
0.00.00.00.0+10.00.00.0−10.00.00.00.01e-41e-31e-21e-11e01e10204060iteration k
iteration k
0
‖V_k − V*‖∞
8.81e+0
measured rate
n/a
contraction γ
0.90
‖V_k − V*‖∞ (measured)
γ^k ‖V_0 − V*‖∞ (bound)
Left: the value heatmap (low red, high green) with greedy policy arrows; the +1 goal and -1 pit are outlined. Right: the sup-norm error against iteration on a log axis. The measured error (accent) tracks the gamma-to-the-k bound (blue dashed) as a straight line, and the measured rate readout matches gamma. Raise gamma to watch convergence slow down; change slip to reshape the policy while the rate stays exactly gamma.

The measured decay rate equals γ\gamma no matter how large the grid is, how much noise the slip injects, or where the rewards sit. That invariance is the practical payoff of the contraction: the same geometric guarantee that makes this tiny gridworld converge is what lets approximate value iteration scale to problems with billions of states.

Footnotes

  1. Sutton & Barto, Reinforcement Learning: An Introduction (2018).

  2. Bertsekas, Dynamic Programming and Optimal Control.