The Bellman equation expresses the value of a state recursively: it equals the expected immediate reward plus the discounted value of the state that follows. Almost every value-based reinforcement learning algorithm is a way of solving it, exactly or approximately.
The Bellman expectation equation
For a fixed policy , the value function satisfies
Here is the transition probability, the expected reward and the discount factor. It follows from the recursive form of the return, . In a finite MDP it is a linear system with one equation per state, so can be solved for directly.
The Bellman optimality equation
The optimal value function replaces the average over actions with a maximum:
The max makes the system nonlinear, but the operator on the right is a -contraction: applying it to any two value estimates shrinks their largest difference by at least a factor of . Repeated application, which is value iteration, therefore converges to the unique fixed point from any starting guess.
Worked example
One state offers two actions: stay earns 1 and returns to the same state, go earns 5 and ends the episode. The optimality equation is . With , staying forever is worth , so . Value iteration from gives 5, 5.5, 5.95, 6.36, and creeps toward 10 with the error shrinking by 0.9 per sweep. With , staying forever is worth only , and : check that .
Where it shows up
- Dynamic programming: policy evaluation, policy iteration and value iteration apply the equations as exact backups.
- TD learning and Q-learning apply sampled versions, replacing the sum over with one observed transition.
- Deep RL minimises a squared Bellman residual, the TD error, with a neural network.
Why it matters
The Bellman equation is what lets an agent reason about the long run using only one step of experience at a time. It also explains common failure modes: bootstrapping from your own estimates propagates errors, and combining bootstrapping, function approximation and off-policy data can diverge. Understanding the equation is the shortest route to understanding why deep RL is sometimes unstable.
Related terms
Sources
- Richard S. Sutton, Andrew G. Barto. Reinforcement Learning: An Introduction (2nd edition), 2018. incompleteideas.net
- Martin L. Puterman. Markov Decision Processes: Discrete Stochastic Dynamic Programming, 1994. doi.org