Concepts / Value Iteration

Value Iteration

GPI describes a feedback relationship, not one fixed algorithm.

  • Programming

Two Processes in Feedback

Value iteration is best understood through generalized policy iteration, or GPI. GPI is not one fixed algorithm. It is a feedback relationship between two processes: policy evaluation improves the value function for the current policy, while policy improvement changes the policy using the current value function.

evaluateupdatesuseproducesevaluate againCurrent policyPolicy evaluationvalue function changesCurrent valuefunctionPolicy improvementpolicy changesImproved policy
How do policy evaluation and policy improvement feed into each other, and what changes after each step?

The central idea is mutual correction: the value function becomes more accurate for the current policy, and the policy becomes better with respect to the current value function.

Evaluation Versus Improvement

During policy evaluation, the policy is treated as the current policy and the value function is updated so that it better reflects that policy. The policy itself is not the object being improved during this process.

During policy improvement, the current value function is used to change the policy. The new policy becomes greedy with respect to that value function. In this process, the policy changes because the value function provides the basis for selecting better behavior.

ProcessUsesPrimary change
Policy evaluationThe current policyThe value function
Policy improvementThe current value functionThe policy
evaluatesimprovesPolicycurrentPolicyupdatedValue functionupdatedValue functioncurrent
During policy evaluation, does the policy or the value function change, and during policy improvement, which one changes?

Separating the Two Changes

An agent has a current policy and a value function that estimates how well that policy performs. Identify the change made by each process.

Evaluation: Keep the current policy and update the value function so that it better represents the policy.

Improvement: Keep the current value function as the basis for comparison and change the policy to be greedy with respect to it.

Interaction: Use the improved policy as the current policy for another evaluation process.

Evaluation changes the value function; improvement changes the policy. GPI is their continuing interaction.

Scheduling the Interaction

Different reinforcement learning methods can implement the same two broad processes with different schedules and levels of granularity. The distinction is not whether evaluation and improvement exist, but how much of one process occurs before the other resumes.

  • Policy iteration alternates the processes: one process completes before the other begins.
  • Value iteration performs only a single iteration of policy evaluation between policy improvements.
  • Asynchronous dynamic programming can interleave the processes at an even finer level, including updating one state in one process before returning to the other.

This makes value iteration a middle point in the scheduling picture. It does not wait for a complete policy evaluation before improving the policy. Instead, it uses a limited amount of evaluation before the next improvement. Asynchronous methods make the schedule still more fine-grained.

GPI is a framework for understanding the relationship. Policy iteration, value iteration, and asynchronous dynamic programming are different ways of scheduling the relationship.

When Both Processes Stabilize

The stopping idea for GPI is stabilization. If policy evaluation stops producing changes, the value function is consistent with the policy. If policy improvement also stops producing changes, the policy is no longer improved with respect to that value function.

When both conditions hold, the value function and policy are optimal. The value function is consistent with the policy, and the policy cannot be improved using that value function. Stability therefore connects the two local stopping conditions to the global conclusion of optimality.

Asynchronous State Updates

A full value-iteration sweep suggests updating every state before beginning the next round. Asynchronous value iteration uses a different update pattern: at each step, it selects one state and applies the value iteration backup to that state only. The update is made in place, and the selected state may change from step to step.

update allnext selectionnext selectionState setA, B, CFull sweepA, B, CState AselectedState Cselected nextState Bselected later
Which states are backed up next in asynchronous value iteration, and how does that differ from updating every state in one sweep?

The convergence guarantee is about coverage, not synchronization. In the discounted setting, states do not need to be selected equally often, and they do not need to be updated in a coordinated sweep. The required condition is that no state is permanently left out.

Reading an Asynchronous Selection Sequence

Suppose an asynchronous procedure selects states in the order A, C, B, A, B, C, and continues indefinitely. What property should you check for the discounted convergence guarantee?

Inspect coverage: Check whether every state appears in the selected-state sequence.

Ignore equal frequency: The guarantee does not require every state to be selected equally often.

Check indefinite recurrence: For the stated guarantee, every state must occur infinitely often.

The important property is infinite occurrence of every state, not a synchronized sweep or equal selection frequency.

Discounted Convergence

For asynchronous value iteration, the stated asymptotic convergence guarantee has two conditions. The discount parameter must satisfy 0 ≤ γ < 1, and every state must occur in the selected-state sequence infinitely many times.

checkandselect statesconverges asymptoticallyInitial values0 ≤ γ < 1condition oneRepeated backupsin placeOptimal valuefunctionv*Every stateinfinitely often
Why does a discount factor below one make repeated backups converge toward a unique fixed-point value function?

When both conditions hold, asynchronous value iteration converges asymptotically to the optimal value function v*. A stochastic state-selection sequence can satisfy the requirement if it continues to include every state.

Why Backup Order Matters

Asynchronous updates are made in place. Therefore, a later backup can use a value that was updated earlier in the same sequence. Changing the order changes which newly updated values are available to later backups.

new value availablenew value availableState Aupdated firstState Bcan use AState Ccan use B
How does changing the order of state backups affect which updated values are used by later backups?

This ordering effect is especially important in the undiscounted episodic case. Some backup orderings may fail to converge there. Consequently, the sequence of backups is not merely an implementation detail in every setting; it can affect whether convergence occurs.

  • Assuming asynchronous updates are equivalent to a full sweep.

    In-place asynchronous updates allow later backups to use values produced by earlier backups.

    Fix: Track the selected state and remember that the order determines which updated values are available.

  • Assuming any backup order converges in every setting.

    Some backup orderings may fail to converge in the undiscounted episodic case.

    Fix: Treat the discounted guarantee and the undiscounted episodic case as distinct situations.

Mixed Backup Strategies

Asynchronous dynamic programming does not have to use only one kind of backup. Policy evaluation backups and value iteration backups can be interspersed, allowing information to propagate through the state values while the two GPI processes are interleaved.

selectselectupdateupdatecontinueState valuescurrent estimatesEvaluation backupcurrent policyUpdated state valuesin placeValue-iterationbackupimprovement-oriented
How can evaluation-style backups and value-iteration backups be interleaved while information propagates through the state values?

This procedure is described as a kind of asynchronous truncated policy iteration. The important point is that evaluation-style and value-iteration-style backups need not be separated into large, completed phases. They can be mixed at a fine-grained level.

Practice and Diagnosis

MEDIUM

A method updates one selected state at a time. Its discount parameter satisfies 0 ≤ γ < 1. The state-selection sequence includes some states repeatedly but permanently excludes one state. Does the stated asymptotic convergence guarantee apply? Explain why.

Hints
  • Check both parts of the discounted convergence condition.
  • Ask whether every state occurs infinitely often.
EASY

A value function changes while the policy is held fixed. Then the policy changes using the current value function. Identify which step is evaluation and which step is improvement, and explain why.

Hints
  • Evaluation updates the value function for the current policy.
  • Improvement updates the policy using the current value function.
HARD

Consider an undiscounted episodic setting in which two asynchronous backup orders are possible. Why should you avoid assuming that both orders have the same convergence behavior?

Hints
  • Asynchronous backups are made in place.
  • The source notes that some backup orderings may fail to converge in the undiscounted episodic case.

Key Takeaways

  1. Generalized policy iteration is the interaction between policy evaluation and policy improvement, not one fixed algorithm.
  2. Evaluation updates the value function for the current policy; improvement updates the policy using the current value function.
  3. Policy iteration, value iteration, and asynchronous dynamic programming differ in how finely they schedule and interleave these processes.
  4. Asynchronous value iteration updates one selected state at a time, and discounted convergence requires every state to be selected infinitely often when 0 ≤ γ < 1.
  5. In-place backup order matters, especially in the undiscounted episodic case, and evaluation backups can be interspersed with value-iteration backups.

Key Takeaways

  • GPI describes a feedback relationship between improving a value function and improving a policy.
  • Policy evaluation changes values, while policy improvement changes the policy.
  • Value iteration and asynchronous dynamic programming use progressively finer interleavings of these processes.
  • For 0 ≤ γ < 1, asynchronous value iteration has the stated asymptotic guarantee when every state is selected infinitely often.
  • In-place backup order can affect behavior, and some orderings may fail to converge in the undiscounted episodic case.