In state there are three actions with and the policy is -greedy with (random choice uniform over all three actions). The agent took action in with , got , and moved to . With and , compute the Expected SARSA update. How does it compare to SARSA and Q-learning, and why does it have lower variance than SARSA?
Reinforcement learning, Temporal-difference learning
Level L2 Elementary. Length Medium. Nature Th+Mat Both.
What's being asked
Whether you can compute the expectation of under the policy and explain how it removes the randomness of the sampled next action.
Key idea
Expected SARSA uses the target . It takes the exact expectation over the next action instead of sampling one action, so it keeps SARSA's policy but removes the variance from the next-action choice.
Steps
- Find the policy probabilities. The greedy action has probability and each other action has .
- Compute the expected next value: .
- Target: . Update: .
- Compare with SARSA. Its target is with the sampled . This equals if the greedy action is sampled, for the first action and for the third. Its average is , but individual updates vary a lot.
- Compare with Q-learning: the target is , which assumes a greedy next action.
- Explain variance. SARSA's target has the extra randomness of which is drawn, and Expected SARSA averages this out analytically. The cost is one extra sum over actions per update. With it becomes Q-learning.
Common mistakes
- Using as the greedy action's probability, forgetting the part.
- Saying Expected SARSA is off-policy in all cases. It is on-policy when the expectation uses the behaviour policy, and off-policy if the expectation uses a different target policy such as the greedy one.
- Claiming it removes all variance. Randomness in the reward and next state remains.
How long your answer should be
Half a page; 4–5 minutes.
Read this
Previous in Reinforcement learning: One episode with visits states A, B, A, C in that order and then ends. The rewards received after leaving each state are respectively. What are the returns from each time step and the first-visit and every-visit Monte Carlo estimates of , and from this single episode?
Next in Reinforcement learning: An episode has rewards , , , and then ends, with . The current estimates are , and . What are the -step returns for , and how does trade off bias and variance?