Concepts / TD Errors

TD Errors

The reward prediction error hypothesis links dopamine neuron activity with reward prediction errors.

  • Programming

From Rewards to Learning Signals

Reinforcement learning theory describes signals that help an agent learn from the consequences of its behavior. Neuroscientists have searched for brain activity that could play a comparable role. The reward prediction error hypothesis proposes that dopamine neuron activity represents one such signal: a reward prediction error. The hypothesis became influential because the behavior of TD errors in reinforcement learning theory shows striking parallels with the phasic activity of dopamine neurons.

A TD error is not simply a description of whether a reward occurred. It is a learning quantity that compares an existing estimate with a better estimate formed after new information arrives. This makes TD errors relevant to dopamine research: both are studied as signals that may indicate how learning should respond to what happens over time.

Dopamine Prediction Errors

The reward prediction error hypothesis links dopamine neuron activity with reward prediction errors. Its central evidence is the parallel between TD-error behavior and phasic dopamine activity. Phasic dopamine activity functions as a reinforcement signal that reaches multiple brain areas and supports learning.

Unexpected rewardTD-error parallelphasic dopamine activityPredictive cueOmitted rewardexperimental comparisonexperimental comparisonobserved pattern compared with TD errorsobserved pattern compared with TD errorsobserved pattern compared with TD errors
How did experimental observations provide evidence for parallels between phasic dopamine activity and TD-error behavior?

Wolfram Schultz and colleagues conducted influential experiments in the late 1980s and 1990s. Those experiments revealed parallels between dopamine neuron activity and TD errors, helping lead scientists to the reward prediction error hypothesis. The important contribution was the comparison between a computational description and experimental observations, not the name of dopamine by itself.

The One-Step Comparison

Definition

The TD error is the difference between the current estimate V(S_t) and the one-step estimate R_t+1 + γV(S_t+1). The one-step estimate is formed from the next reward and the discounted estimate of the next state.

Formula

The expression has two sides to compare. V(S_t) is the current estimate for the state at time t. R_t+1 + γV(S_t+1) is a one-step-better estimate because it uses information from the next transition: the reward received and the estimated value of the next state. The TD error records the difference between that newer one-step estimate and the old estimate.

V(S_t)current estimateδ_tdifferenceR_t+1 + γV(S_t+1)one-step estimatecompare withcompare with
What two estimates are compared when a TD error is calculated?
Worked example

Reading a TD Error Symbolically

An agent has a current estimate V(S_t), then observes the next reward R_t+1 and the next state S_t+1. Which information belongs in the one-step estimate?

  1. 1
    Start with the current estimate

    The old estimate is V(S_t), the value assigned to the state at time t.

  2. 2
    Add the next reward

    The transition supplies R_t+1, the reward received at the next time step.

  3. 3
    Include the next-state estimate

    The value of S_t+1 is discounted and contributes γV(S_t+1).

  4. 4
    Compare the estimates

    The TD error is the one-step estimate R_t+1 + γV(S_t+1) minus the old estimate V(S_t).

Result

The sample backup target is R_t+1 + γV(S_t+1), and the TD error is its difference from V(S_t).

Why the Error Arrives Later

The label δ_t refers to the error in the estimate V(S_t), but calculating it requires R_t+1 and S_t+1. Those are next-step observations. Therefore, the TD error associated with time t becomes available at time t+1.

S_tV(S_t)R_t+1next rewardδ_tavailable at t+1Transitiontime t to t+1S_t+1next statecurrent estimaterevealsrevealsneeded forneeded for
What information arrives at time t+1, and how does it allow the error for time t to be calculated?
Key point

The subscript t identifies which estimate is being evaluated. It does not mean that every quantity needed for the calculation was already known at time t.

Building the Backup Target

After the transition from S_t to S_t+1, two pieces of new information are available: the next reward R_t+1 and the next state S_t+1. The reward is included directly. The estimate of the next state is multiplied by γ, the discount factor, and then included. Together they form the sample backup target R_t+1 + γV(S_t+1).

R_t+1next rewardγV(S_t+1)discounted estimateR_t+1 + γV(S_t+1)sample backup targetV(S_t+1)next-state estimatecombine directlymultiply by γcombine
How do the next reward and the estimated value of the next state combine into the one-step backup target?

This target is called a sample backup target because it uses the particular reward and next state observed in one transition. The TD error then compares this target with the estimate that existed for S_t.

What do you think happens?

Which quantity must be observed before δ_t can be calculated?

  • Only the current state S_t

  • The next reward R_t+1 and next state S_t+1

  • Only the current estimate V(S_t)

Reveal answer
Answer:

The next reward R_t+1 and next state S_t+1

The one-step estimate requires both R_t+1 and γV(S_t+1). Without the next transition information, the comparison cannot be completed.

Three Learning Signals

The sign of the TD error describes how the one-step estimate compares with the current estimate. A positive error means the one-step estimate is greater than V(S_t); a negative error means it is lower; and a zero error means the two estimates match. As a reinforcement signal, this difference can indicate whether the current estimate should move upward, downward, or not change in response to the new transition.

V(S_t)current estimatePositive δ_tone-step estimate is higherNegative δ_tone-step estimate is lowerZero δ_testimates matchcomparecomparecompare
How does a positive, negative, or zero prediction error guide the interpretation of a current estimate?

This is why phasic dopamine activity is discussed as a possible reinforcement signal. The hypothesis connects changes in dopamine neuron activity with a computational difference that tells a learning system how new consequences compare with its prior prediction.

TD and Monte Carlo Errors

TD error and Monte Carlo error use different references. TD error uses a one-step sample backup: the next reward plus the discounted estimate of the next state. Monte Carlo error is based on the actual return. The source gives an important relationship between them: the Monte Carlo error can be written as a sum of TD errors.

V(S_t)initial estimateδ_tfirst TD errorActual returndifference from initialestimateδ_t+1next TD errorTD errorssuccessive termsaccumulatecontinuecontinuesum relates tocompare with
How do successive TD errors accumulate into the difference between the final return and the initial value estimate?
ErrorReferenceTime perspective
TD errorOne-step sample backupUses the next reward and next-state estimate
Monte Carlo errorActual returnCan be represented as a sum of TD errors

The defining difference is the reference used for the comparison.

Rule

Common Interpretation Mistakes

  • Common mistake

    Treating a TD error as the reward itself

    What it looks like

    Calling R_t+1 alone the TD error

    Why it fails

    The TD error compares a current estimate with a one-step estimate that includes both the next reward and the discounted next-state estimate.

    Do this instead
    Use δ_t = [R_t+1 + γV(S_t+1)] − V(S_t).
  • Common mistake

    Assuming δ_t is available before the next transition

    What it looks like
    Calculating δ_t using only V(S_t)
    Why it fails

    The calculation requires R_t+1 and S_t+1, which are next-step observations.

    Do this instead

    Associate δ_t with the estimate at time t, but recognize that it becomes available at time t+1.

  • Common mistake

    Confusing the TD target with the TD error

    What it looks like
    Calling R_t+1 + γV(S_t+1) the error
    Why it fails

    That expression is the one-step estimate or sample backup target. The error is its difference from V(S_t).

    Do this instead

    First form the target, then subtract the current estimate.

  • Common mistake

    Treating Monte Carlo error and TD error as the same comparison

    What it looks like

    Saying both errors directly use the actual return

    Why it fails

    TD error uses a one-step sample backup, whereas Monte Carlo error is based on the actual return.

    Do this instead

    Remember that the Monte Carlo error can be represented as a sum of TD errors.

Check Your Understanding

MEDIUM

Explain, in your own words, why the error labeled δ_t is not available until time t+1. Then identify the two quantities that must be compared to calculate it.

Hints
  • Start with the information known at time t.
  • Identify what the transition reveals at time t+1.
  • State the current estimate and the one-step estimate separately.
MEDIUM

Compare TD error with Monte Carlo error. Your answer should name the reference used by each error and explain how a sequence of TD errors relates to the Monte Carlo error.

Hints
  • TD error uses a one-step sample backup.
  • Monte Carlo error uses the actual return.
  • The source describes the Monte Carlo error as a sum of TD errors.

Key Takeaways

  1. 1
    The reward prediction error hypothesis proposes that dopamine neuron activity represents a reward prediction error.
  2. 2
    TD errors compare the current estimate V(S_t) with the one-step estimate R_t+1 + γV(S_t+1).
  3. 3
    The error labeled δ_t becomes available at time t+1 because the next reward and next state are required.
  4. 4
    Phasic dopamine activity is studied as a possible reinforcement signal because its activity shows parallels with TD-error behavior.
  5. 5
    Monte Carlo error uses the actual return and can be written as a sum of TD errors.

At a glance

  • A TD error measures the difference between an existing value estimate and a one-step-better estimate.
  • The one-step estimate combines the next reward with the discounted estimate of the next state.
  • Although δ_t concerns the estimate at time t, it becomes available at time t+1 because next-step information is needed.
  • The reward prediction error hypothesis connects this reinforcement-learning signal with phasic dopamine activity.
  • Monte Carlo error is based on the actual return and can be represented as a sum of TD errors.

Related concepts

More concepts starting with T