Concepts / Episodes, Returns, and State-Value Estimates

Episodes, Returns, and State-Value Estimates

Backup diagrams show what information feeds an update to a root state node.

  • Programming

Reading the Update

A backup diagram is a visual explanation of an update to a state-value estimate. Begin with the state whose estimate is being updated, then inspect the experience or transition information shown beneath it. The diagram answers a practical question: which rewards, estimated values, and transitions are being used to revise this particular state estimate?

Read a backup diagram from the value being updated outward. The top node is the root state, and the nodes below it show the information that contributes to the update.

contributes tocontributes tocontributes toRoot stateestimate being updatedTransitionsexperience informationRewardsupdate informationLeaf nodesrewards and estimatedvalues
What information flows toward the root state whose value estimate is being updated?

One Sampled Episode

A Monte Carlo backup diagram represents one sampled episode from the root state through the terminal state. It does not list every path that might have occurred. Instead, it records the single trajectory selected for that episode.

selectsproducesleads toselectsproducesleads toS0root stateA0actionR1rewardS1subsequent stateA1actionR2rewardTerminal stateend of episode
How does a root state connect to every subsequent state, action, and reward in one sampled episode?

Tracing a Monte Carlo Diagram

Suppose a generated diagram begins at root state S0 and shows the sampled path S0, A0, R1, S1, A1, R2, terminal state. What does the diagram tell you?

Find the root: S0 is the root state, so its state-value estimate is the one being updated.

Follow the displayed path: Read the connected states, actions, and rewards as one selected trajectory rather than as a list of alternatives.

Check the endpoint: The path reaches a terminal state, so the displayed trajectory extends through the complete sampled episode.

Identify the update information: The rewards and later state information shown along this trajectory are the information represented as contributing to the update of the root estimate.

The diagram represents one complete sampled episode beginning at S0, not every path that could have followed S0.

Transition Structure

Monte Carlo and Dynamic Programming diagrams differ in the transition information they display. A Monte Carlo diagram follows one sampled episode from the root through the terminal state. A Dynamic Programming diagram represents all possible one-step transitions from a state.

followspossible transitionpossible transitionpossible transitionRoot stateone sampled episodeRoot stateone-step transitionsSingle trajectorythrough terminal stateSuccessor state Apossible next stateSuccessor state Bpossible next stateSuccessor state Cpossible next state
What is the difference between following one sampled episode and branching over all possible one-step transitions?
Question to askMonte Carlo diagramDynamic Programming diagram
What transition information is shown?One sampled episodeAll possible one-step transitions
How far does the displayed information extend?From the root through the terminal stateOne step outward from the state
What does the structure look like?A single selected trajectoryA set of possible successor transitions

Classifying the Diagram

To classify an unfamiliar backup diagram, inspect two features together. First, ask which transitions are included. Second, ask how far those transitions extend. A single trajectory that continues from the root through a terminal state indicates sampled episode data. A diagram that branches over all possible one-step transitions indicates the Dynamic Programming structure described in the source.

one recorded pathpossible transitionpossible transitionpossible transitionRoot statestate being updatedOne trajectorysampled episodeSuccessor Apossible one-step outcomeSuccessor Bpossible one-step outcomeSuccessor Cpossible one-step outcome
Does the diagram show a single trajectory that occurred, or every successor state and outcome that could occur next?
  1. Locate the top node and name it the root state.
  2. Count the transition choices shown immediately below the root.
  3. Check whether the diagram follows one selected path or displays all possible one-step transitions.
  4. Check how far the displayed transitions extend: through a terminal state or only one step.
  5. Classify the diagram using both observations, not just its visual shape.

From Rewards to Estimates

In a backup diagram, later rewards and state information are shown as inputs to the update of the root state estimate. For a Monte Carlo diagram, these inputs are attached to the one complete sampled episode that begins at the root and reaches the terminal state. The diagram therefore connects the episode's later information to the value estimate for the state from which the episode was traced.

startscontainscontribute torevisesVisited stateroot of the backupSampled episodethrough terminal stateLater rewardsepisode informationUpdate informationfeeds the estimateState-value estimaterevised root value
How do rewards after a visited state become update information for that state's value estimate?

Common Classification Errors

  • Treating a Monte Carlo diagram as a list of every possible path

    A Monte Carlo backup diagram records the single trajectory selected for one episode.

    Fix: Look for one sampled path that extends from the root through the terminal state.

  • Ignoring how far the transitions extend

    The classification depends on both which transitions are included and how far those transitions extend.

    Fix: Check whether the information reaches the terminal state or represents all possible one-step transitions.

  • Starting the interpretation at a leaf instead of at the top node

    The top node is the root: the state node whose estimate is being updated.

    Fix: Locate the root first, then read outward to the transitions and leaf nodes.

  • Confusing sampled episode data with possible transitions

    A Dynamic Programming diagram represents all possible one-step transitions, while a Monte Carlo diagram follows one sampled episode.

    Fix: Determine whether the diagram shows one selected trajectory or a set of possible one-step outcomes.

Practice Classification

EASY

A diagram has root state S0. From S0, it shows one connected sequence of states, actions, and rewards, and the sequence ends at a terminal state. Is this diagram best classified as Monte Carlo or Dynamic Programming? Explain which two visual clues support your answer.

Hints
  • Check whether the diagram shows one selected path or all possible one-step transitions.
  • Check whether the displayed path continues through a terminal state.

What do you think happens?

A diagram branches from a root state to several possible successor states, with the displayed structure limited to those one-step transitions. Which structure does this represent?

  • A Monte Carlo backup through one complete sampled episode
  • A Dynamic Programming backup over all possible one-step transitions
  • A single sampled trajectory through a terminal state
Reveal answer

Answer: A Dynamic Programming backup over all possible one-step transitions

The defining clues are the set of possible one-step transitions and the absence of a single displayed trajectory extending through a terminal state.

Key Takeaways

  1. A backup diagram shows what information feeds an update to a root state node.
  2. The root is the state whose value estimate is being updated.
  3. A Monte Carlo backup follows one sampled episode from the root through the terminal state.
  4. A Dynamic Programming diagram represents all possible one-step transitions.
  5. To classify a diagram, inspect both the transitions included and how far they extend.

Key Takeaways

  • Backup diagrams identify the information used to update a root state's value estimate.
  • Monte Carlo diagrams show one complete sampled episode, not every path that could have occurred.
  • Dynamic Programming diagrams show all possible one-step transitions from a state.
  • Classify a diagram by inspecting both its transition choices and the distance those transitions extend.
  • Rewards, estimated values, and leaf-node information are represented as contributors to the root update.