Policy Iteration for Optimal Decision Making
The important change is not merely renaming v* as q*. A complete solution must specify what is stored, how policy evaluation and policy improvement operate on that representation, and how the final q* result is obtained.
From v* to q*
Policy iteration is not restricted to state values. The central task is to reformulate the policy-iteration process so that action values are the quantities represented, computed, and updated throughout. The target of this action-value version is q*, in analogy with the state-value target v* named in the source exercise.
The important change is not merely renaming v* as q*. A complete solution must specify what is stored, how policy evaluation and policy improvement operate on that representation, and how the final q* result is obtained.
The Iteration Loop
The action-value algorithm can be organized by adapting the policy-iteration approach used for v*. First choose or receive a policy and establish an action-value representation. Then evaluate that policy using action values. Next improve the policy using the evaluated action values. Repeat evaluation and improvement until the policy and its action-value representation reach the optimal result. The final action-value result is identified as q*.
- 1Represent the quantities to be computed as action values for state-action pairs.
- 2Start with a policy, whether supplied by the problem or selected as the initial policy for the algorithm.
- 3Evaluate the current policy using the action-value representation.
- 4Improve the policy by using the evaluated action values to select the preferred action in each state.
- 5Repeat evaluation and improvement while the policy is still changing.
- 6When the policy-iteration process has reached its stable result, report the corresponding action-value result as q*.
A Representation to Track
The representation determines what the algorithm can evaluate and improve. For v*, the central quantity is organized by state. For q*, the central quantity must distinguish actions as well as states. That means the action-value representation must make it possible to refer to the value associated with a particular state-action pair and to compare the available action values when improving the policy.
This organization is why an action-value solution cannot simply copy a state-value solution and change the final symbol. The algorithm must retain action-specific information throughout policy evaluation and policy improvement. Otherwise, there would be no action-value basis for revising the policy.
Abstract Walkthrough
Consider a generated abstract setting with two states and several available actions. No rewards, transitions, numerical values, initial policy, or discount information are supplied here. The purpose of this example is therefore to trace the structure of the algorithm, not to calculate q* numerically.
Tracing the Action-Value Version
Organize policy iteration for a setting in which each state has more than one available action, with q* as the desired result.
- 1Represent
Create an action-value representation that distinguishes the value associated with each state-action pair. This is the quantity that the algorithm will evaluate and update.
- 2Initialize
Begin with a policy. The policy identifies the current action choice associated with each state.
- 3Evaluate
Evaluate the current policy using action values. The result describes the action values associated with following the current policy.
- 4Improve
Use the evaluated action values to revise the policy. In each state, the action-value information provides the basis for selecting the preferred action.
- 5Repeat
Return to policy evaluation after an improvement. Continue alternating the two stages while the policy is not yet stable.
- 6Report
When the iteration reaches its stable optimal result, report the corresponding action-value function as q*.
The complete action-value policy-iteration design connects the q representation, repeated evaluation and improvement, and the final q* result.
The example is complete as an algorithmic outline but deliberately not numerical. The source material does not specify an environment or numerical inputs from which particular q* values could be calculated.
Inputs Before Calculation
Before attempting a numerical q* computation, check whether the problem supplies the information needed to define and run the iteration. The supplied source does not provide a particular environment, action set, reward description, initial policy, or earlier v* algorithm. Consequently, it supports an algorithm-design answer but not a numerical q* result.
Common mistake Treating q* as though it were only a renamed v*.
What it looks likeThe solution discusses only values organized by state and changes the final answer symbol to q*.
Why it failsThe action-value formulation must use action values as the main quantities being represented and updated.
Do this insteadDescribe the representation, evaluation stage, improvement stage, and final result in action-value terms.
Common mistake Giving only the policy-improvement step.
What it looks likeThe solution says to choose the highest-valued action but does not explain how the action values are obtained or how the process repeats.
Why it failsA complete algorithm must connect representation, iteration, and the q* result.
Do this insteadInclude both policy evaluation and policy improvement, together with the stopping and reporting stages.
Common mistake Inventing numerical q* values when the problem supplies no numerical environment.
What it looks likeA solution reports specific action values even though no environment, action set, reward description, initial policy, or earlier algorithm is provided.
Why it failsThe supplied material supports an algorithm-design answer, not a numerical calculation.
Do this insteadState which inputs are missing and give the complete abstract algorithm instead.
Common mistake Stopping after policy evaluation.
What it looks likeThe solution evaluates one policy and calls its action values q*.
Why it failsPolicy iteration requires the evaluation and improvement stages to alternate toward the optimal result.
Do this insteadImprove the policy after evaluation and repeat until the process reaches its stable result.
Practice Check
Write a six-step outline for an action-value policy-iteration algorithm. Your outline should begin with the q representation, include policy evaluation and policy improvement, explain when the process repeats, and identify the final result. Then list the information you would request before attempting a numerical computation.
Hints
- Use action-value language rather than replacing q* with v*.
- Separate evaluating the current policy from improving the policy.
- Check for the environment, action set, reward description, initial policy, and discount information.
What do you think happens?
If an exercise gives no particular environment, action set, reward description, initial policy, or earlier v* algorithm, can it determine numerical q* values?
Reveal answer
No. It can support an algorithm-design answer, but the missing numerical information prevents a numerical q* calculation.
The source explicitly describes the supplied material as defining the scope of the exercise rather than providing a numerical calculation.
What to Remember
- 1Policy iteration applies to action values as well as state values.
- 2The action-value target is q*, while v* is the state-value target named in the source exercise.
- 3A complete q* algorithm must specify the action-value representation, policy evaluation, policy improvement, repetition, and final reporting.
- 4Policy improvement uses the evaluated action values to select the preferred action in each state.
- 5Numerical q* computation requires supplied problem information; the source material alone provides an algorithm-design task rather than numerical inputs.
At a glance
- The action-value version of policy iteration is intended to compute q*.
- q* is organized around state-action pairs, whereas v* is the state-value target named in the source exercise.
- The algorithm alternates action-value policy evaluation and policy improvement.
- A valid solution connects representation, iteration, and the final q* result.
- Without an environment, actions, rewards, initial policy, and other required information, only the algorithmic structure—not numerical q* values—can be given.