Trace an on-policy SARSA target

Keep each reward, discount and value next to its number. · 173 words

A library cart receives a reward of one for reaching the next aisle. Its current estimate for the move it just took is two. In the new aisle the cart actually selects a left turn worth four according to its current action values. An unchosen right turn has an estimated value of seven. SARSA learns from the next action selected by the behavior policy. With a discount factor of one half, the target for the earlier move is one plus one half of four, which equals three.

The difference between the target and the old estimate is one. With a learning rate of one quarter, the updated estimate is two plus one quarter, or 2.25. The larger value of seven belongs to an action the cart did not select in this transition. Using the maximum next value would produce the target used by a different algorithm, Q-learning. Keeping the next action in the recorded transition lets you reproduce the SARSA update even if the cart makes a different choice on its next visit.

Check your recall

Which next-action value enters this SARSA target, and what is the updated estimate?

Check your answer

The selected left turn contributes four, giving a target of three and an updated estimate of 2.25.

Sources and credits

Original KeyTouch lesson. Background reading · UC Berkeley · Introduction to Artificial Intelligence.