Skip to content

Value iteration

A Bellman planning algorithm that repeatedly improves state values, with a continuing-state example and a residual-based value-error certificate.

Value iteration is a planning algorithm that repeatedly applies a Bellman optimality update to estimates of state values. In a finite model of inventory or execution, it provides a way to compare actions using both immediate rewards and their future consequences. The computation solves the specified decision model; it does not establish that the model represents a changing market.

Turn the optimality equation into an update

Take a finite, fully observed Markov decision process with finite action sets, fixed transition probabilities P(s′∣s,a)P(s'\mid s,a), bounded expected immediate rewards r(s,a)r(s,a) and discount 0≤γ<10\leq\gamma<1. Define the optimality operator TT by

(TV)(s)=max⁡a{r(s,a)+γ∑s′P(s′∣s,a)V(s′)}.(TV)(s)=\max_a\left\{r(s,a)+\gamma\sum_{s'}P(s'\mid s,a)V(s')\right\}.
The Bellman equation requires V∗=TV∗V^*=TV^*. Value iteration instead starts with a finite table V0V_0 and calculates Vk+1=TVkV_{k+1}=TV_k. In a synchronous implementation, every new state value uses the same previous table. Starting from zero, VkV_k is the best expected discounted reward over the next kk decisions, with zero continuation value afterward. This is a dynamic programming construction: solved shorter horizons supply the longer one. See Berkeley CS188 §4.3.

A state that pays repeatedly

Consider a fictional one-state model. Action A pays 1 reward unit now, B pays 0, and either action returns to the same state with certainty. The process continues forever and γ=0.5\gamma=0.5. Thus
Vk+1=max⁡{1+0.5Vk,  0.5Vk}.V_{k+1}=\max\{1+0.5V_k,\;0.5V_k\}.
Backup countValueInterpretation from a zero start
00No future decisions counted
11One reward from A
21.5Two discounted rewards from A
31.75Three discounted rewards from A

A beats B by exactly one unit for any common continuation estimate. Its infinite reward stream is 1+0.5+0.25+⋯=21+0.5+0.25+\cdots=2, so V∗=2V^*=2 and always choosing A is optimal. The value has not reached 2 after three backups, even though the preferred action is already correct.

Fictional continuing one-state MDP with discount 0.5. Values after zero, one, two and three backups are 0, 1, 1.5 and 1.75, approaching the optimal value 2. At backup three the residual is 0.125 and the value-error bound is 0.25, equal to the actual error.
Fictional continuing one-state MDP with discount 0.5. Values after zero, one, two and three backups are 0, 1, 1.5 and 1.75, approaching the optimal value 2. At backup three the residual is 0.125 and the value-error bound is 0.25, equal to the actual error.
Original exact-model illustration. Each backup adds one reward horizon when starting from zero; the Bellman residual measures the remaining inconsistency, not the immediate reward.
This is a continuing state, not a terminal one. If either action instead ended the process immediately, there would be no continuation reward: A would be worth 1, not 2. A terminal state can be represented by an absorbing state paying zero thereafter, as described in Poole and Mackworth §12.5.
INTERACTIVE EXPLORER

Bellman planning and two-arm UCB

Distinguish model-based value updates from learning rewards through actions.

What convergence certifies

Under the finite discounted assumptions above, TT is a contraction in the maximum norm:

∥TV−TW∥∞≤γ∥V−W∥∞.\lVert TV-TW\rVert_\infty\leq\gamma\lVert V-W\rVert_\infty.
Here the norm is the largest absolute difference across states. Repeated synchronous updates converge from any finite initial table to the unique optimal value function. Choosing an action that maximises the backup using V∗V^* yields an optimal policy. The policy need not be unique: different actions can tie. MIT's Bellman notes give the contraction argument and explicitly distinguish value uniqueness from policy uniqueness.
Exact equality may require infinitely many backups. A useful stopping certificate for a current table VV is its Bellman residual, δ=∥TV−V∥∞\delta=\lVert TV-V\rVert_\infty. The contraction gives
∥V−V∗∥∞≤δ+γ∥V−V∗∥∞⟹∥V−V∗∥∞≤δ1−γ.\lVert V-V^*\rVert_\infty \leq\delta+\gamma\lVert V-V^*\rVert_\infty \quad\Longrightarrow\quad \lVert V-V^*\rVert_\infty\leq\frac{\delta}{1-\gamma}.
For the example's current value 1.75, the next backup is 1.875. The residual is 0.125; dividing by 1−0.51-0.5 gives an error bound of 0.25, exactly the actual gap to 2. This bounds value error within the model. It is not a bound on market forecast error or, by itself, the performance loss of an extracted policy.

Updating values is not learning the environment

Asynchronous value iteration updates selected states in place using the latest table. In this discounted tabular setting, convergence requires a fair schedule that updates every state infinitely often. Repeatedly updating a convenient subset is insufficient. Sutton and Barto's §4.5 states this condition; Poole and Mackworth §12.5.2 describes the in-place variant. A single small change at one visited state is not the full-table residual used above.
Policy iteration evaluates a chosen policy and then improves it. Value iteration takes optimality backups directly. Either can serve as a planner inside model-based reinforcement learning, where the transition and reward model must first be learned. Fitting a neural value function adds approximation error; re-estimating a market model changes the operator being solved. The exact fixed-operator contraction argument does not automatically cover either case.
For a fuller finite-state treatment, the SelfMadeQuant lesson Markov Decision Processes and Value/Policy Iteration develops Bellman planning and the two solvers. Its purpose and outline are public; the full lesson requires membership.

Sources

Last updated
  • reinforcement learning
  • bellman equation
  • dynamic programming
  • planning
  • convergence
← Back to the glossaryBack to top ↑