Bellman Equations
The Bellman equations are recursive consistency conditions for value functions. They are the central equations of RL theory: every major algorithm is either a direct solution to, or an approximation of, the Bellman equations.
Bellman Expectation Equation
The value of a state equals the expected immediate reward plus the discounted value of the next state:
For $V^\pi$:
For $Q^\pi$:
In compact operator notation, defining the Bellman expectation operator $\mathcal{T}^\pi$:
$V^\pi$ is the unique fixed point: $\mathcal{T}^\pi V^\pi = V^\pi$.
$\mathcal{T}^\pi$ is a contraction mapping with modulus $\gamma$ under the $\ell_\infty$ norm. Repeated application converges to $V^\pi$ from any initialization.
Bellman Optimality Equation
The optimal value function satisfies a nonlinear equation: the agent takes the best action:
For $V^{\ast}$:
For $Q^{\ast}$:
The Bellman optimality operator $\mathcal{T}^{\ast}$:
$V^{\ast}$ is the unique fixed point of $\mathcal{T}^{\ast}$. Contraction with modulus $\gamma$. Value iteration applies $\mathcal{T}^{\ast}$ repeatedly to converge to $V^{\ast}$.
TD Error
The temporal difference (TD) error is the difference between the current value estimate and the Bellman target:
Interpretation: $r_t + \gamma V(s_{t+1})$ is a one-step estimate of $V(s_t)$ (the TD target). $\delta_t$ is the prediction error; a non-zero TD error means the value estimate is inconsistent with the Bellman equation.
TD(0) update:
Drives $V$ toward the TD target. Converges to $V^\pi$ for tabular MDPs with appropriate step sizes.
SARSA (on-policy Q-update):
Q-learning (off-policy):
Multi-Step Bellman Targets
The one-step TD target can be extended to $n$ steps:
$n$-step TD update:
- $n=1$: standard TD; low variance, biased.
- $n = T$ (end of episode): Monte Carlo; zero bias, high variance.
- Intermediate $n$: tradeoff.
Multi-step returns are used in A2C, PPO, and Rainbow DQN.
Bellman Equations in Matrix Form
For a finite MDP with $\lvert\mathcal{S}\rvert$ states under a fixed policy $\pi$:
where $P^\pi_{ss’} = \sum_a \pi(a \mid s) P(s’ \mid s,a)$ and $r^\pi_s = \sum_a \pi(a \mid s) R(s,a)$.
Direct solution is $O(\lvert\mathcal{S}\rvert^3)$; feasible only for small state spaces. Dynamic programming uses iterative methods instead.
Contraction and Convergence
The Bellman operators $\mathcal{T}^\pi$ and $\mathcal{T}^*$ are $\gamma$-contractions under $|\cdot|_\infty$:
By Banach’s fixed point theorem, repeated application converges to the unique fixed point at a geometric rate.
Error propagation: if $V$ is an $\epsilon$-approximate fixed point ($|\mathcal{T}^\pi V - V|_\infty \leq \epsilon$), then:
This $\frac{1}{1-\gamma}$ factor explains why small discount factors make RL easier: errors amplify less.