Bellman Equations: Value as Reward Plus What Comes Next

3 minute read

Published:

TL;DR: The Bellman equation decomposes value into immediate reward and discounted continuation value. Evaluating a policy averages over its actions; finding the optimal value selects the best action. Dynamic programming uses a transition model to perform these backups.

Break a long journey into one step and the remainder

Intuition first. To estimate the cost of a journey, combine the next segment with the estimated cost from its endpoint. RL uses the same recursive structure for expected reward.

With the reward convention from the MDP chapter, return satisfies \(G_t=R_{t+1}+\gamma G_{t+1}\). Taking the expectation under a policy gives the Bellman expectation equation:

\[ V^\pi(s)=\sum_a\pi(a\mid s)\sum_{s'}P(s'\mid s,a) \left[r(s,a,s')+\gamma V^\pi(s')\right]. \]

Here \(V^\pi(s)\) means expected return starting in state \(s\) and then following \(\pi\). The equation averages both the policy’s action choices and the environment’s outcomes.

Evaluation and optimisation answer different questions

Policy evaluation asks how a specified policy performs. Optimal control instead asks which action gives the highest expected continuation:

\[ V^*(s)=\max_a\sum_{s'}P(s'\mid s,a) \left[r(s,a,s')+\gamma V^*(s')\right]. \]

The maximum is outside the expectation over next states: the agent chooses an action before learning which stochastic outcome occurs. Moving it inside would give the agent information it does not have. Dynamic programming lecture.

One-step value decompositionA backup combines immediate reward with discounted next-state value. Average over possible outcomes before comparing actions. Immediate rewardNext-state valueCurrent value
A backup combines immediate reward with discounted next-state value. Average over possible outcomes before comparing actions.

Worked example: propagate the goal reward backwards

Use the chain A to B to Goal, rewards 0 then 1, and \(\gamma=0.9\). Start with all values zero and update each state from the values in the previous iteration. Terminal Goal always has value zero.

Synchronous iterationABGoal
Initial000
First backup010
Second backup0.910

The first backup finds B’s immediate reward. The second transfers that information to A. Updating A before or after B in place can change intermediate numbers, so specify the update convention when comparing traces.

Now add an action at A that terminates with reward 0.5. Optimal control chooses the route through B because \(0.9>0.5\). A policy that selects each action half the time has value \(0.5(0.9)+0.5(0.5)=0.7\) at A. Evaluating that policy does not turn it into the optimal one.

Why repeated backups can converge

For a finite discounted MDP with bounded rewards and \(\gamma<1\), the exact Bellman operators contract differences in the maximum norm by at most \(\gamma\). This gives unique fixed points and convergence of repeated exact backups under the standard assumptions.

That statement does not guarantee convergence for every neural-network training procedure. Function approximation, sampled data, and changing policies introduce additional issues. Keep the exact dynamic-programming result separate from the optimisation behaviour of a deep RL implementation.

The model is doing work here

Computing the full sum requires transition probabilities and expected rewards. If those are unknown, an agent can learn from sampled transitions instead. That is the bridge to temporal-difference learning.

Key Insight: A Bellman backup makes a current estimate consistent with one-step consequences. Choosing which policy or maximum appears in that backup determines the value function being learned.

References

  1. Silver, D. Reinforcement Learning course: Planning by Dynamic Programming.