An episode has rewards r1=1, r2=2, r3=0, r4=3 and then ends, with γ=0.9. The current estimates are V(S1)=6, V(S2)=5 and V(S3)=4. What are the n-step returns G0(n) for n=1,2,3,4, and how does n trade off bias and variance?

Reinforcement learning, n-step methods
Level L2 Elementary. Length Medium. Nature Th+Mat Both.

What's being asked

Whether you can compute n-step returns that bootstrap after n steps, and see that n=1 is TD(0) and n→∞ is Monte Carlo.

Key idea

The n-step return is Gt(n)=rt+1+γrt+2+⋯+γn−1rt+n+γnV(St+n). Larger n uses more real rewards and less of the estimate V, so bias falls and variance rises.

Steps

  1. n=1: G0(1)=r1+γV(S1)=1+0.9×6=6.4.
  2. n=2: G0(2)=1+0.9×2+0.81×V(S2)=2.8+0.81×5=6.85.
  3. n=3: G0(3)=1+1.8+0.81×0+0.729×V(S3)=2.8+0.729×4=5.716.
  4. n=4: the episode ends after r4, so there is nothing to bootstrap. G0(4)=1+1.8+0+0.729×3=4.987. This is the Monte Carlo return.
  5. Interpret. The estimates 6.4,6.85,5.716,4.987 differ because the current V values are not the true values. The more real rewards we use, the less the wrong V matters.
  6. State the trade-off. Small n: low variance (few random rewards) but bias from the possibly wrong V. Large n: low bias but high variance. An intermediate n, such as 4 to 8 in many tasks, often learns fastest.

Common mistakes

How long your answer should be

Half a page; 4 minutes.

Read this

Previous in Reinforcement learning: In state s′ there are three actions with Q(s′,⋅)=(2,4,1) and the policy is ε-greedy with ε=0.1 (random choice uniform over all three actions). The agent took action a in s with Q(s,a)=3, got r=1, and moved to s′. With α=0.5 and γ=0.9, compute the Expected SARSA update. How does it compare to SARSA and Q-learning, and why does it have lower variance than SARSA?
Next in Reinforcement learning: For a sampled transition, r=1, γ=0.99, and the next state s′ has online-network values Qθ(s′,⋅)=(2.0,3.0,2.5) and target-network values Qθ−(s′,⋅)=(2.8,2.2,3.4). Compute the target used by DQN and by double DQN. Why does the max in DQN cause over-estimation, and how does double DQN reduce it?