A tabular value function is for states A, B, C. One episode goes A B C end with rewards . Use TD() with accumulating traces, , and , and update every state at every step. What is after the episode? How does this differ from TD(0)?
Reinforcement learning, Eligibility traces
Level L3 Intermediate. Length Medium. Nature Mat Mathematical.
What's being asked
Whether you can run the backward view of TD(): update every state in proportion to its eligibility trace.
Key idea
At each step compute the TD error . Decay all traces by , add to the trace of the current state, and update every state by .
Steps
- Step 1 (at A): . Trace . No value changes because .
- Step 2 (at B): decay by , so , then . again, so is unchanged.
- Step 3 (at C): decay, so and , then . The reward arrives: (the end state has value ).
- Update every state: , , .
- Compare with TD(0). TD(0) would update only C, giving and leaving . The trace passes credit back to earlier states in one episode, with weights for a state steps back.
- State the limits: is TD(0) and behaves like Monte Carlo, with trace weights .
Common mistakes
- Forgetting to decay the trace by (not just ) at each step.
- Updating only the current state. All states with a non-zero trace are updated.
- Resetting traces to zero at every step. Traces are reset only at the start of an episode.
How long your answer should be
Half a page; 5 minutes.
Last checked on 4 December 2026.
Read this
Previous in Reinforcement learning: Four episodes are generated by a behaviour policy . For a target policy , the importance ratios and the returns are , , and . Compute the ordinary and weighted importance-sampling estimates of at the start state. Which is biased, and which has higher variance?
Next in Reinforcement learning: A two-armed bandit policy is with . The agent samples arm 1 and receives reward . Using the REINFORCE update with , what is the update (a) with baseline and (b) with ? What is the gradient of , and how do you show that the score function has zero mean?