10.2 — The Average-Reward Setting (and Why Discounting Fails with FA)¶
Chapter 10: On-policy Control with Approximation · Book sections: §10.3–§10.6 Previous: 10.1 — Episodic Semi-gradient Control · Next: 11.1 — Off-policy Challenges & the Deadly Triad
🌱 The Big Picture¶
For continuing tasks (no episodes, life goes on forever) with function approximation, the book introduces a third classical setting alongside episodic and discounted: average reward. Surprise twist: in this regime, discounting turns out to be conceptually broken — a deep and underappreciated point.
📊 The average-reward criterion (§10.3)¶
Define the reward rate of a policy — the long-run average reward per step:
(μ_π = steady-state distribution under π, assumed independent of the start state — an ergodicity assumption: in the long run, where you started doesn't matter.)
Policies are ranked by \(r(\pi)\): "How much reward do you collect per unit time, forever?" ⏱️
Differential returns and values¶
Since total reward is infinite, measure everything relative to the average. Returns become sums of differences between rewards and the average reward:
This is the differential return; the corresponding value functions are differential value functions ("how much better than average is it to be here?"). Bellman equations carry over with \(r - r(\pi)\) replacing \(r\) and no γ.
Differential TD errors:
where \(\bar R_t\) is a running estimate of \(r(\pi)\) (updated by \(\bar R \mathrel{+}= \beta \delta_t\)). Plug into the usual semi-gradient updates → differential semi-gradient Sarsa (and n-step versions, §10.5):
differential semi-gradient Sarsa:
take A → R, S′; choose A′
δ = R − R̄ + q̂(S′,A′,w) − q̂(S,A,w)
R̄ += β δ
w += α δ ∇q̂(S,A,w)
(Book Example 10.2: an access-control queuing task — accept/reject customers of different priorities at limited servers — solved nicely by this method.)
💣 Deprecating the discounted setting (§10.4)¶
Here's the bombshell. For continuing tasks with function approximation, consider ranking policies by discounted value over the on-policy distribution. The book proves:
The average of the discounted returns is proportional to the average reward — the ordering of policies is identical for every γ. The discount rate does nothing! 🤯
Why discounting "fails" here, at root: with function approximation we've lost the policy improvement theorem. In tabular land, improving the action in one state could only help. With FA, we can't update states independently — there's no guarantee that a step of "improvement" helps overall, for discounted or average criteria. (The lack of such guarantees is a recurring theoretical hole; policy-gradient methods in Ch. 13 bring back a different kind of guarantee.)
Practical reading: γ stays perfectly meaningful for episodic tasks and as a solution-method parameter; but for continuing control with FA, the average-reward formulation is the principled one.
🎯 Key Takeaways¶
- Average-reward setting: rank policies by reward rate \(r(\pi)\); values become differential ("better than average?").
- All TD machinery survives: replace \(R\) with \(R - \bar R\), drop γ, keep semi-gradients.
- Discounting is vacuous for continuing tasks with FA — it induces the same policy ordering as average reward.
- Root cause: function approximation breaks the per-state policy improvement guarantee.
➡️ Next chapter: 11.1 — Off-policy Methods with Approximation — the danger zone: why off-policy + bootstrapping + FA can blow up, starring Baird's infamous counterexample.