Prove the performance difference lemma: for two policies π and π′ with J(π)=Es0[Vπ(s0)], J(π′)−J(π)=11−γ Es∼dπ′, a∼π′[Aπ(s,a)], where dπ′(s)=(1−γ)∑t≥0γtP(st=s∣π′). What does it imply for policy improvement and for TRPO?

Reinforcement learning, Policy gradients
Level L5 Expert. Length Long. Nature Mat Mathematical.

What's being asked

Whether you can prove the lemma with a telescoping argument and explain why it underlies policy improvement and trust-region methods.

Key idea

Along a trajectory generated by π′, the advantage of π, Aπ(st,at)=rt+1+γVπ(st+1)−Vπ(st) in expectation, has discounted sum that telescopes to (∑tγtrt+1)−Vπ(s0). Taking expectations gives J(π′)−J(π).

Steps

  1. Recall Aπ(s,a)=Qπ(s,a)−Vπ(s) and Qπ(s,a)=E[r+γVπ(s′)∣s,a]. So for any transition, Es′[r+γVπ(s′)−Vπ(s)]=Aπ(s,a).
  2. Take a trajectory from π′ and consider Eτ∼π′[∑tγtAπ(st,at)]=Eτ∼π′[∑tγt(rt+1+γVπ(st+1)−Vπ(st))].
  3. Telescope. ∑tγt(γVπ(st+1)−Vπ(st))=−Vπ(s0)+lim⁡T→∞γTVπ(sT)=−Vπ(s0), since Vπ is bounded.
  4. Hence Eτ∼π′[∑tγtAπ(st,at)]=Eπ′[∑tγtrt+1]−Es0[Vπ(s0)]=J(π′)−J(π). Both policies must start from the same initial-state distribution, so that the s0 term is the same for π and π′.
  5. Rewrite the left side with the discounted state distribution. ∑tγt E[Aπ(st,at)]=11−γ Es∼dπ′,a∼π′[Aπ(s,a)], since dπ′ includes the normalising factor (1−γ).
  6. Policy improvement. If Ea∼π′[Aπ(s,a)]≥0 for every state, then J(π′)≥J(π). The greedy policy with respect to Qπ satisfies this, which proves the policy improvement theorem.
  7. TRPO. The expectation is over states from dπ′, which we cannot sample before we have π′. TRPO replaces dπ′ by dπ in the surrogate, and bounds the resulting error by a function of max⁡sKL(π∥π′), which is why the step is constrained.

Common mistakes

How long your answer should be

A page; 8–10 minutes.

Last checked on 4 December 2026.

Read this

Previous in Reinforcement learning: Show that the policy maximising Ey∼π[r(y)]−β KL(π ∥ πref) is π∗(y)=πref(y) er(y)/β/Z with Z=∑yπref(y)er(y)/β. For πref=(0.5,0.5), r=(1,0), find π∗ and the optimal objective value for β=1, and π∗ for β=0.5. What happens as β→0 and β→∞, and how does this lead to direct preference optimisation (DPO)?
Next in Reinforcement learning: For on-policy linear TD(0) with features ϕ, show that the expected update is α(b−Aw) and that the fixed point is wTD=A−1b, where A=E[ϕ(ϕ−γϕ′)⊤] and b=E[rϕ]. For the Markov reward process with P=(010.50.5), R=(0,1), γ=0.5 and a single feature ϕ=(1,0), what is wTD, and how does it compare with the best least-squares fit of the true values V=(0.8,1.6) under the stationary distribution?