Concepts / Action Values and Policies in Reinforcement Learning

Action Values and Policies in Reinforcement Learning

A model-free decision retrieves cached information. A model-based decision uses an environment model to evaluate possible sequences before acting.

  • Programming

The Same Route, Different Reasoning

Imagine a rat beginning at state S1 in a maze. From S1, it can choose left or right, reach either S2 or S3, and then choose left or right again. Each terminal goal box delivers an associated reward. In the source task, both a model-free strategy and a model-based strategy select L at S1 and then R at S2. The important distinction is not the route itself. It is how the agent justifies the next action.

Key point

A model-free decision retrieves cached information. A model-based decision uses an environment model to evaluate possible sequences before acting.

S1Cached informationLS1Environment modelPossible sequencesLreadselectconsultsimulatechoose best sequence
How does a model-free agent choose from cached information while a model-based agent predicts consequences before acting?

Cached Action Values

In a model-free decision, the agent does not use an environment model to work out what will happen next. Instead, it uses cached values associated with actions in the current state. The current state is S1 in the maze example. The agent consults the cached action information for S1 and selects an action from that information. In the source task, this process leads to selecting L at S1 and later R at S2.

S1current stateLcached action valueLselected actionRcached action valuelook uplook upchoose
How does the agent map the current state to cached action values and select an action?
Key point

The key operation is retrieval: the agent uses cached action information for the current state rather than simulating a route through an environment model.

Cached Policies

A model-free agent can also use a cached policy. In this description, the policy provides the action to take for the current state. The policy therefore maps the current state directly to an action choice. At S1 in the maze task, the cached policy gives L; after reaching S2, it gives R.

S1Cached policyLinput statereturn action
How does a cached policy map the current state directly to the action the agent should take?

The Environment Model

Model-based reinforcement learning uses an environment model with two connected parts. The state-transition model represents what state follows from a state-action choice. In the maze description, this part is represented as a decision tree. The reward model associates distinctive goal-box features with the rewards available in those boxes. Rewards associated with S1, S2, and S3 are also part of the reward model, but they are zero in the described task and are not shown.

State-action choiceState-transitionmodelNext stateReward modelGoal-box rewardpredict destinationwhere it leadsevaluate outcomeassociate reward
What does each part of the environment model predict about a state-action choice?
Model componentQuestion it answersMaze role
State-transition modelWhat state follows from this state-action choice?Represents the possible maze routes as a decision tree.
Reward modelWhat reward is associated with the resulting goal-box features?Associates goal-box features with their available rewards.

The two model components provide different information, and together they support route evaluation.

Simulating Candidate Routes

A model-based agent can compare several possible action sequences before choosing. Starting at S1, it considers a first action such as L or R. The transition model predicts the state reached by that choice. The agent then continues through the possible sequence, using the transition model to follow predicted consequences. When the sequence reaches a terminal goal box, the reward model identifies the reward associated with that outcome. The agent compares the predicted return of this sequence with the predicted returns of other simulated sequences.

S1Route beginning LTerminal outcomePredicted returnsLselected first actionRoute beginning RTerminal outcomesimulatesimulatefollow predicted consequencesfollow predicted consequencesevaluateevaluatechoose highest predicted return
How does the agent simulate routes, identify their predicted outcomes, compare returns, and choose the first action?
Worked example

The maze choice at S1

Trace how the model-based strategy selects the first action in the source maze task.

  1. 1
    Represent alternatives

    At S1, the agent considers the available left and right choices as possible beginnings of routes.

  2. 2
    Predict consequences

    The state-transition model predicts the states reached by the choices and continues the possible sequences through the maze.

  3. 3
    Evaluate terminal outcomes

    When a simulated sequence reaches a terminal goal box, the reward model identifies the reward associated with that outcome.

  4. 4
    Compare routes

    The agent compares the predicted return of each simulated route. This comparison is a simple form of planning.

  5. 5
    Select the first action

    In the source task, the sequence with the highest predicted return begins with L, so the model-based agent selects L at S1.

Result

The model-based agent selects L at S1 by comparing predicted route returns, not by merely retrieving an action associated with S1.

Key point

Planning is the comparison of predicted returns from simulated routes. The selected action is the action that belongs to the sequence with the highest predicted return.

Reading the Difference

QuestionModel-free decisionModel-based decision
What information is consulted?Cached action values or a cached policy.A state-transition model and a reward model.
How is the action selected?Retrieve the action associated with the current state.Simulate possible sequences and compare their predicted returns.
What happens at S1 in the source task?Select L from cached information.Select L after evaluating simulated routes.
What happens at S2 in the source task?Select R from cached information.Select R as part of the route with the highest predicted return.

The same action can result from different decision processes.

Common Mistakes

  • Common mistake

    Assuming that a route proves an agent is model-based.

    What it looks like

    Both strategies in the maze select L at S1 and R at S2.

    Why it fails

    The same route can be produced by cached information or by simulated route comparison.

    Do this instead

    Inspect the decision process: retrieval indicates model-free behavior, while predicted state transitions, rewards, and returns indicate model-based behavior.

  • Common mistake

    Treating the transition model and reward model as the same component.

    What it looks like

    Saying that one model both predicts the next state and supplies the goal-box reward.

    Why it fails

    The source distinguishes the questions answered by the two components.

    Do this instead

    Use the transition model to predict where a choice leads and the reward model to associate the resulting goal-box features with rewards.

  • Common mistake

    Calling cached action selection planning.

    What it looks like

    Describing a policy lookup at S1 as a simulated route comparison.

    Why it fails

    Model-free behavior retrieves a cached value or policy rather than evaluating possible sequences with an environment model.

    Do this instead

    Reserve planning for the comparison of predicted returns from simulated routes.

  • Common mistake

    Looking only at the first action and ignoring how it was chosen.

    What it looks like

    Concluding that two agents use the same strategy because both choose L at S1.

    Why it fails

    The action is identical, but the justifications can differ.

    Do this instead

    Ask whether the agent retrieved L from cached information or selected it after comparing simulated consequences.

Check Your Understanding

EASY

An agent is at S1 in the maze. It consults information already cached for S1 and selects L without using a state-transition model or a reward model. Is this decision model-free or model-based? What evidence supports your answer?

Hints
  • Identify whether the agent retrieved cached information or simulated possible routes.
  • A model-free decision uses cached action values or a cached policy.
MEDIUM

A second agent at S1 uses a decision-tree-like state-transition model to follow possible routes, uses a reward model for terminal goal-box outcomes, and compares predicted returns. What makes this planning, and which first action does the source task say it selects?

Hints
  • Planning is the comparison of predicted returns from simulated routes.
  • The source task says the selected route begins with L.

Key Takeaways

  1. 1
    Model-free reinforcement learning selects actions from cached action values or a cached policy instead of using an environment model.
  2. 2
    A model-based environment model has a state-transition component and a reward component.
  3. 3
    The transition component predicts the next state after a state-action choice, while the reward component associates outcomes with rewards.
  4. 4
    Model-based planning compares predicted returns from simulated action sequences.
  5. 5
    In the source maze, both approaches choose L at S1 and R at S2, but they arrive at those choices through different decision processes.

At a glance

  • Model-free decisions retrieve cached values or a cached policy.
  • Model-based decisions use transition and reward models to simulate possible routes.
  • Planning means comparing the predicted returns of those simulated routes.
  • The same action sequence can be selected by both strategies, so the decision process matters more than the route alone.

Related concepts

More concepts starting with A