Action-value methods
Learning objective
Section titled “Learning objective”Be able to write down the sample-average estimate of , convert it to incremental form, and explain why the incremental form is the one worth memorising.
Intuition
Section titled “Intuition”You cannot see . You can see rewards. So estimate the value of an action by averaging the rewards you have actually received from it. Pull a machine ten times, win four, and your estimate of its payout rate is 0.4.
The obvious method is the right one here. What matters is the form you write it in.
The sample average
Section titled “The sample average”By the law of large numbers as the denominator grows. If an action has never been taken the estimate is undefined, so it is initialised to some default — usually 0.
The incremental form
Section titled “The incremental form”Storing every reward to recompute the mean wastes memory that grows without bound. Let be the estimate after rewards. Then:
Derivation. With ,
Constant memory, constant work per step, identical answer.
The update pattern
Section titled “The update pattern”That last line is worth reading closely, because the same shape appears in every method in this book:
The bracketed quantity is the error. The update moves the estimate a fraction of the way toward the target. TD learning, Q-learning, and gradient-based policy updates are all this expression with a different target substituted in.
Constant step size
Section titled “Constant step size”Replacing with a constant gives:
Expanding the recursion shows what this does:
The weight on a reward decays exponentially with how long ago it arrived. This is an exponential recency-weighted average: it never fully converges, which is exactly what you want when drifts over time. For the stationary bandit in this chapter, is the better choice; for anything nonstationary, a constant is. Tracking a nonstationary problem takes that claim apart: what the exponential weighting costs, and why an estimator that never converges is the one you want when the target moves.
Common mistakes
Section titled “Common mistakes”Recomputing the mean from stored rewards. Correct, but the memory grows forever, and the incremental form makes the connection to every later algorithm visible.
Using on a non-stationary problem. The step size shrinks toward zero, so the estimate eventually stops responding to change at all.
Forgetting that ties need breaking. With for every , the first greedy choice is a -way tie. Break it uniformly at random, or the first arm wins by index order and the run looks broken.
Personal takeaways
Section titled “Personal takeaways”error = target - estimate, then step toward it. Writing the sample average in
that form once makes TD learning look like a small change of target rather than a
new idea.
Where next
Section titled “Where next”Estimates alone do not tell you when to act on them. Epsilon-greedy is the simplest rule for deciding when to trust and when to look elsewhere.
References
Section titled “References”- Sutton, R. S. & Barto, A. G. Reinforcement Learning: An Introduction, 2nd ed., §2.3–2.5.