Simple Algorithm
Reinforcement Learning · Fixed Point · 28 min

The Policy Gradient Theorem in Depth

Episodic, discounted and average-reward forms, and the discounting mistake most code makes.

Most policy-gradient code follows a direction that is not the gradient of the discounted return and, as Nota and Thomas proved in 2020, in general not the gradient of any function at all. Seeing why takes the theorem in its three exact forms, episodic, discounted and average-reward, with proofs that show where each weighting of states comes from. This lesson gives them, dissects the missing γt\gamma^t, and sets the score-function estimator against its pathwise rival.

What you’ll learn

  • State the policy gradient theorem for the episodic, discounted and average-reward criteria, with the state weighting and normalization each one uses.
  • Prove the discounted form from the performance difference lemma and the average-reward form from stationarity.
  • Show with the symmetry of second derivatives that the usual update without γt\gamma^t is not a gradient, and construct a case where it converges to the worst policy.
  • Compare score-function and pathwise gradient estimators, and explain the deterministic policy gradient as the limit of stochastic ones.

Three objectives, three weightings

The three weightings differ in a way that will matter. The average-reward criterion weights states by how often the policy occupies them in the long run. The episodic criterion counts every visit equally. The discounted criterion weights a visit at time tt by γt\gamma^t, so states that occur late barely count: with γ=0.99\gamma=0.99, a state first reached after 500 steps carries weight 0.99500≈0.00660.99^{500}\approx0.0066.

Check your understanding

With γ=0.9\gamma=0.9, an estimator samples states from the normalized dμπd^\pi_\mu, actions from π\pi, and averages Aγπ(S,A) ∇log⁡π(A∣S)A^\pi_\gamma(S,A)\,\nabla\log\pi(A\mid S). By what factor must that average be multiplied to equal ∇Jγ\nabla J_\gamma?

  1. 1
  2. 0.9
  3. 0.1
  4. 10
Show the answer

D. 10

The theorem has 11−γ=10\frac{1}{1-\gamma}=10 in front of the expectation under the normalized distribution. The unnormalized discounted visits sum to 11−γ\frac{1}{1-\gamma}, the effective horizon, and normalizing moves that factor outside. In practice it is absorbed into the step size, but it matters when gradients are compared across discount factors.

Two proofs that the state distribution drops out

DerivationDiscounted case, from the performance difference lemma
  1. Jγ(θ′)−Jγ(θ)=11−γ∑sdμπθ′(s)∑aπθ′(a∣s) Aγπθ(s,a)J_\gamma(\boldsymbol\theta')-J_\gamma(\boldsymbol\theta)=\frac{1}{1-\gamma}\sum_sd^{\pi_{\boldsymbol\theta'}}_\mu(s)\sum_a\pi_{\boldsymbol\theta'}(a\mid s)\,A^{\pi_{\boldsymbol\theta}}_\gamma(s,a)

    The performance difference lemma (Kakade & Langford, 2002; proved in Advantages & the Performance Difference Lemma) compares two policies through the advantages of one and the state distribution of the other. Fix θ\boldsymbol\theta and let θ′\boldsymbol\theta' vary:

  2. ∇Jγ(θ)=11−γ∑s[∇dμπ(s) ∑aπ(a∣s) Aγπ(s,a)⏟= 0  +  dμπ(s)∑a∇π(a∣s) Aγπ(s,a)]\nabla J_\gamma(\boldsymbol\theta)=\frac{1}{1-\gamma}\sum_s\Big[\nabla d^\pi_\mu(s)\,\underbrace{\sum_a\pi(a\mid s)\,A^\pi_\gamma(s,a)}_{=\,0}\;+\;d^\pi_\mu(s)\sum_a\nabla\pi(a\mid s)\,A^\pi_\gamma(s,a)\Big]

    Differentiate in θ′\boldsymbol\theta' at θ′=θ\boldsymbol\theta'=\boldsymbol\theta. In a finite MDP the row vector dμπθ′=(1−γ) μ⊤(I−γPπθ′)−1d^{\pi_{\boldsymbol\theta'}}_\mu=(1-\gamma)\,\mu^\top\big(I-\gamma P^{\pi_{\boldsymbol\theta'}}\big)^{-1} is a smooth function of θ′\boldsymbol\theta', so the product rule applies:

  3. The term carrying the derivative of the state distribution is multiplied by the policy's average advantage over itself, which is zero in every state. Since ∑a∇π(a∣s)=0\sum_a\nabla\pi(a\mid s)=\mathbf 0, replacing AγπA^\pi_\gamma by QγπQ^\pi_\gamma, or by Qγπ−b(s)Q^\pi_\gamma-b(s), changes nothing. ■\blacksquare

DerivationAverage reward, from stationarity
  1. ∇V~π(s)=∑a∇π(a∣s) Q~π(s,a)+∑aπ(a∣s)[−∇rˉ+∑s′P(s′∣s,a) ∇V~π(s′)]\nabla\tilde V^\pi(s)=\sum_a\nabla\pi(a\mid s)\,\tilde Q^\pi(s,a)+\sum_a\pi(a\mid s)\Big[-\nabla\bar r+\sum_{s'}P(s'\mid s,a)\,\nabla\tilde V^\pi(s')\Big]

    Differentiate V~π(s)=∑aπ(a∣s) Q~π(s,a)\tilde V^\pi(s)=\sum_a\pi(a\mid s)\,\tilde Q^\pi(s,a) and the definition of Q~π\tilde Q^\pi. The gain depends on θ\boldsymbol\theta; the rewards and dynamics do not. (Differential values are defined up to a constant; fix it any smooth way, since constants cancel below.)

  2. ∇rˉ=∑a∇π(a∣s) Q~π(s,a)+∑s′Pπ(s′∣s) ∇V~π(s′)−∇V~π(s)for every s\nabla\bar r=\sum_a\nabla\pi(a\mid s)\,\tilde Q^\pi(s,a)+\sum_{s'}P^\pi(s'\mid s)\,\nabla\tilde V^\pi(s')-\nabla\tilde V^\pi(s)\qquad\text{for every }s

    The gain's derivative appears with total weight ∑aπ(a∣s)=1\sum_a\pi(a\mid s)=1. Solve for it:

  3. ∇rˉ=∑sdπ(s)∑a∇π(a∣s) Q~π(s,a)+∑s′dπ(s′) ∇V~π(s′)−∑sdπ(s) ∇V~π(s)⏟= 0■\nabla\bar r=\sum_sd_\pi(s)\sum_a\nabla\pi(a\mid s)\,\tilde Q^\pi(s,a)+\underbrace{\sum_{s'}d_\pi(s')\,\nabla\tilde V^\pi(s')-\sum_sd_\pi(s)\,\nabla\tilde V^\pi(s)}_{=\,0}\qquad\blacksquare

    The left side does not depend on ss, so average the right side over s∼dπs\sim d_\pi. Stationarity, ∑sdπ(s)Pπ(s′∣s)=dπ(s′)\sum_sd_\pi(s)P^\pi(s'\mid s)=d_\pi(s'), cancels the last two terms exactly:

The episodic form is the trajectory derivation of The Policy Gradient Theorem & REINFORCE with γ=1\gamma=1, and its conditions are where care is needed. Termination with probability 1 for every policy near θ\boldsymbol\theta keeps the expected length finite and lets the gradient pass through the sum over trajectories (dominated convergence). Without it JepJ_{\text{ep}} can be infinite: in the switched corridor, J(p)→−∞J(p)\to-\infty as pp approaches 0 or 1. The average-reward proof needs the unichain assumption for the same reason: with several recurrent classes, the gain depends on the start state and can jump as θ\boldsymbol\theta changes which class is reached. Average-Reward Dynamic Programming develops gain and differential values.

The missing γᵗ

Sampling states from dμπd^\pi_\mu means weighting step tt of every trajectory by γt\gamma^t. Almost no implementation does. REINFORCE, A2C and PPO codebases follow

g(θ)=E[∑t∇log⁡π(At∣St) Qγπ(St,At)]instead of∇Jγ=E[∑tγt ∇log⁡π(At∣St) Qγπ(St,At)],g(\boldsymbol\theta)=\E\Big[\sum_t\nabla\log\pi(A_t\mid S_t)\,Q^\pi_\gamma(S_t,A_t)\Big]\qquad\text{instead of}\qquad\nabla J_\gamma=\E\Big[\sum_t\gamma^t\,\nabla\log\pi(A_t\mid S_t)\,Q^\pi_\gamma(S_t,A_t)\Big],

with QγπQ^\pi_\gamma estimated by discounted returns or a discounted critic. In expectation gg weights states by their undiscounted visits while valuing actions with the discounted QγπQ^\pi_\gamma. Thomas (2014) showed that this mismatch makes several popular discounted natural actor–critic algorithms, including NAC-LSTD and eNAC, biased estimates of the natural gradient they were meant to follow. Then what does gg climb?

DerivationNot the gradient of anything (Nota & Thomas, 2020)
  1. g=∇f⟹∂gi∂θj=∂2f∂θj ∂θi=∂gj∂θig=\nabla f\quad\Longrightarrow\quad\frac{\partial g_i}{\partial\theta_j}=\frac{\partial^2f}{\partial\theta_j\,\partial\theta_i}=\frac{\partial g_j}{\partial\theta_i}

    If g=∇fg=\nabla f and gg is continuously differentiable, then ff is twice continuously differentiable and its Hessian, the Jacobian of gg, is symmetric (Clairaut–Schwarz). One point with unequal cross-derivatives therefore rules out every ff:

  2. g(θ)=(γ σ′(θ1) σ(θ2)⏟t=0, s1, σ(θ1) σ′(θ2)⏟t=1, s2),∇Jγ=(γ σ′(θ1) σ(θ2), γ σ(θ1) σ′(θ2))g(\boldsymbol\theta)=\Big(\underbrace{\gamma\,\sigma'(\theta_1)\,\sigma(\theta_2)}_{t=0,\ s_1},\ \underbrace{\sigma(\theta_1)\,\sigma'(\theta_2)}_{t=1,\ s_2}\Big),\qquad\nabla J_\gamma=\big(\gamma\,\sigma'(\theta_1)\,\sigma(\theta_2),\ \gamma\,\sigma(\theta_1)\,\sigma'(\theta_2)\big)

    Their example has two states and deterministic transitions. In s1s_1, action a1a_1 moves to s2s_2 with reward 0 and a2a_2 ends the episode with reward 0; in s2s_2, a1a_1 ends with reward 1 and a2a_2 ends with reward 0. Each state has its own parameter, π(a1∣si)=σ(θi)\pi(a_1\mid s_i)=\sigma(\theta_i) with the logistic function σ\sigma, so V(s2)=σ(θ2)V(s_2)=\sigma(\theta_2) and V(s1)=γ σ(θ1)σ(θ2)V(s_1)=\gamma\,\sigma(\theta_1)\sigma(\theta_2). Summing the undiscounted terms of gg over the two time steps:

  3. ∂g1∂θ2=γ σ′(θ1) σ′(θ2) ≠ σ′(θ1) σ′(θ2)=∂g2∂θ1\frac{\partial g_1}{\partial\theta_2}=\gamma\,\sigma'(\theta_1)\,\sigma'(\theta_2)\ \neq\ \sigma'(\theta_1)\,\sigma'(\theta_2)=\frac{\partial g_2}{\partial\theta_1}

    The cross-derivatives disagree whenever γ<1\gamma<1, so no function has gg as its gradient:

  4. gθs=∑tPr⁡(St=s)∑tγtPr⁡(St=s)  ∇θsJγ(one parameter block per state)g_{\boldsymbol\theta_s}=\frac{\sum_t\Pr(S_t=s)}{\sum_t\gamma^t\Pr(S_t=s)}\;\nabla_{\boldsymbol\theta_s}J_\gamma\qquad\text{(one parameter block per state)}

    Here g=diag⁡(1,1/γ) ∇Jγg=\operatorname{diag}(1,1/\gamma)\,\nabla J_\gamma still points uphill, and that is no accident. With a separate parameter block θs\boldsymbol\theta_s for each state, each block of gg is the true gradient's block times the ratio of undiscounted to discounted visits, a positive number. So for tabular policies gg is an ascent direction for JγJ_\gamma with the same stationary points; the trouble starts when states share parameters, as they always do with function approximation.

DerivationShared parameters: converging to the worst policy
  1. Qγ(s1,a1)−Qγ(s1,a2)=1,Qγ(s2,a1)=0.5×1.9=0.95,Qγ(s2,a2)=2Q_\gamma(s_1,a_1)-Q_\gamma(s_1,a_2)=1,\qquad Q_\gamma(s_2,a_1)=0.5\times1.9=0.95,\qquad Q_\gamma(s_2,a_2)=2

    A small example of the failure Nota and Thomas exhibit. Three states visited in order, γ=0.5\gamma=0.5, and one shared parameter: the agent cannot tell the states apart and plays a1a_1 with probability p=σ(θ)p=\sigma(\theta) everywhere. In s1s_1, a1a_1 pays 1 and a2a_2 pays 0, and both lead to s2s_2. In s2s_2, a1a_1 pays 0 and leads to s3s_3, while a2a_2 pays 2 and ends the episode. In s3s_3 either action pays 1.9 and ends it. The discounted action values:

  2. dJγdp=1⏟s1+γ⋅(0.95−2)⏟s2+γ2⋅0⏟s3=0.475>0\frac{dJ_\gamma}{dp}=\underbrace{1}_{s_1}+\gamma\cdot\underbrace{(0.95-2)}_{s_2}+\gamma^2\cdot\underbrace{0}_{s_3}=0.475>0

    Both objectives prefer a1a_1. The discounted return is Jγ(p)=p+0.5 (0.95 p+2(1−p))=1+0.475 pJ_\gamma(p)=p+0.5\,\big(0.95\,p+2(1-p)\big)=1+0.475\,p, and the undiscounted total is Jep(p)=p+1.9 p+2(1−p)=2+0.9 pJ_{\text{ep}}(p)=p+1.9\,p+2(1-p)=2+0.9\,p. Both are maximized at p=1p=1 and minimized at p=0p=0. The true discounted gradient weights s2s_2 by γ\gamma:

  3. g(θ)=σ′(θ) [ 1+(0.95−2)+p⋅0 ]=−0.05 σ′(θ)<0for every θg(\theta)=\sigma'(\theta)\,\big[\,1+(0.95-2)+p\cdot0\,\big]=-0.05\,\sigma'(\theta)<0\qquad\text{for every }\theta

    The update without γt\gamma^t weights each state by its visit count, 1 for s1s_1 and s2s_2 and pp for s3s_3, while still valuing actions with QγQ_\gamma, which discounts the delayed 1.9:

  4. So θ\theta decreases forever and the policy converges to always playing a2a_2, the worst policy for both objectives (Jγ=1J_\gamma=1 instead of 1.475, Jep=2J_{\text{ep}}=2 instead of 2.9), while the parameter diverges. Nota and Thomas build a counterexample of the same kind, whose limit is globally pessimal for the discounted and the undiscounted objective alike.

Predict before you look

In the three-state example with a general discount, the update without γt\gamma^t is proportional to 1+(1.9γ−2)1+(1.9\gamma-2). Above which γ\gamma does it point toward a1a_1 again?

Show the answer

0.53

1.9γ−1>01.9\gamma-1>0 when γ>1/1.9≈0.526\gamma>1/1.9\approx0.526. The true gradient, 1+γ(1.9γ−2)=1.9γ2−2γ+11+\gamma(1.9\gamma-2)=1.9\gamma^2-2\gamma+1, is positive for every γ\gamma (its discriminant 4−7.64-7.6 is negative), so for γ\gamma below 0.526 the two disagree about the sign, and the update heads for the worst policy.

Three readings are on offer. Keep γt\gamma^t: treat the discount as part of the problem, as Thomas's (2014) unbiased natural actor–critics do; the cost is that late states get almost no weight, which wastes most of the data in long episodes. Treat γ\gamma as a variance knob: the real objective is undiscounted, the critic's discount trades bias for variance (as in generalized advantage estimation), and gg is a biased estimate of the undiscounted gradient. Zhang, Laroche, van Seijen, Whiteson and Tachet des Combes (2022) interpret the critic's discounting in this setting as a bias–variance–representation trade-off, and, when the objective really is discounted, the dropped γt\gamma^t as an auxiliary task. Accept the heuristic: gg follows no objective, yet it usually works in practice. As of the mid-2020s, which fixed points it reaches with function approximation, and when they are good, is not well characterized.

Score function or pathwise?

Policy gradients are one case of a general problem: differentiate Ex∼pθ[f(x)]\E_{x\sim p_{\boldsymbol\theta}}[f(x)] with respect to the parameters of the distribution. Two classic estimators exist (reviewed by Mohamed, Rosca, Figurnov & Mnih, 2020).

EstimatorSingle-sample formNeedsVariance
Score function (likelihood ratio, REINFORCE)f(x) ∇θlog⁡pθ(x)f(x)\,\nabla_{\boldsymbol\theta}\log p_{\boldsymbol\theta}(x)a differentiable log⁡pθ\log p_{\boldsymbol\theta}; ff can be a black boxoften high; grows with the dimension; baselines help
Pathwise (reparameterization)∇θf(xθ(ε))\nabla_{\boldsymbol\theta}f\big(x_{\boldsymbol\theta}(\varepsilon)\big) with x=xθ(ε)x=x_{\boldsymbol\theta}(\varepsilon), ε∼p(ε)\varepsilon\sim p(\varepsilon) fixedff differentiable in xx, and a reparameterizationusually lower; controlled by the smoothness of ff
DerivationOne Gaussian, two estimators
  1. Var⁡=E[(ε+2ε2+ε3)2]−22=(1+12+15+6)−4=30\Var=\E\big[(\varepsilon+2\varepsilon^2+\varepsilon^3)^2\big]-2^2=(1+12+15+6)-4=30

    Estimate ddmEx∼N(m,1)[x2]\frac{d}{dm}\E_{x\sim\mathcal N(m,1)}[x^2], whose true value is 2m2m, at m=1m=1. Write x=1+εx=1+\varepsilon with ε∼N(0,1)\varepsilon\sim\mathcal N(0,1), and recall Eε4=3\E\varepsilon^4=3 and Eε6=15\E\varepsilon^6=15. Score function: x2 ∂mlog⁡p(x)=x2(x−m)=(1+ε)2ε=ε+2ε2+ε3x^2\,\partial_m\log p(x)=x^2(x-m)=(1+\varepsilon)^2\varepsilon=\varepsilon+2\varepsilon^2+\varepsilon^3, with mean 2 and

  2. Var⁡=Var⁡(2ε)=4\Var=\Var(2\varepsilon)=4

    Pathwise: differentiate through the sample, ddm(m+ε)2=2(m+ε)=2+2ε\frac{d}{dm}(m+\varepsilon)^2=2(m+\varepsilon)=2+2\varepsilon, with mean 2 and

  3. Var⁡[(x2−4)(x−1)]=E[(−3ε+2ε2+ε3)2]−4=18−4=14versus4\Var\big[(x^2-4)(x-1)\big]=\E\big[(-3\varepsilon+2\varepsilon^2+\varepsilon^3)^2\big]-4=18-4=14\quad\text{versus}\quad4

    Same mean, a variance 7.5 times smaller: the pathwise estimator uses the slope of ff, information the score function never sees. Even the best constant baseline, b⋆=E[ε2x2]/E[ε2]=4b^\star=\E[\varepsilon^2x^2]/\E[\varepsilon^2]=4, leaves the score function far behind:

In reinforcement learning, ff is the return, which depends on unknown and often non-differentiable dynamics, so for the true return the score function is the only option. The pathwise estimator becomes available once a learned critic stands in for the return: differentiate Qw(s,a)Q_{\mathbf w}(s,a) with respect to the action. Deterministic policy gradients and soft actor–critic do exactly that, trading variance for the critic's bias.

Key takeaways

  • Three exact forms: episodic, ∑sη(s)∑a∇π Qπ\sum_s\eta(s)\sum_a\nabla\pi\,Q^\pi with visit counts; discounted, 11−γEdμπ[Aγπ∇log⁡π]\frac{1}{1-\gamma}\E_{d^\pi_\mu}\big[A^\pi_\gamma\nabla\log\pi\big] with normalized discounted visits; average reward, ∑sdπ(s)∑a∇π Q~π\sum_sd_\pi(s)\sum_a\nabla\pi\,\tilde Q^\pi with the stationary distribution.
  • The derivative of the state distribution never appears: in the discounted proof it multiplies the policy's average advantage over itself, which is zero, and in the average-reward proof stationarity cancels it.
  • Dropping γt\gamma^t weights states by undiscounted visits while valuing actions with the discounted QγπQ^\pi_\gamma. The result has an asymmetric Jacobian, so it is the gradient of no function. Tabular policies still ascend JγJ_\gamma, but shared parameters can drive the policy to the worst one.
  • Score-function estimators need only log⁡pθ\log p_{\boldsymbol\theta}; pathwise estimators need a differentiable ff and usually have far lower variance (4 against 30 in the Gaussian example). The deterministic policy gradient is the pathwise limit of stochastic policy gradients.

Check yourself

In the interactive lesson these are scored with your confidence, and what you miss comes back for review.

Question 1

In the proof of the average-reward form, which step removes every derivative of the state distribution?

  1. Averaging over the stationary distribution: ∑sdπ(s)[∑s′Pπ(s′∣s)∇V~π(s′)−∇V~π(s)]=0\sum_sd_\pi(s)\big[\sum_{s'}P^\pi(s'\mid s)\nabla\tilde V^\pi(s')-\nabla\tilde V^\pi(s)\big]=0
  2. The differential values average to zero under dπd_\pi
  3. The gain rˉ\bar r does not depend on θ\boldsymbol\theta
  4. Discounting makes late states negligible
Show the answer

A. Averaging over the stationary distribution: ∑sdπ(s)[∑s′Pπ(s′∣s)∇V~π(s′)−∇V~π(s)]=0\sum_sd_\pi(s)\big[\sum_{s'}P^\pi(s'\mid s)\nabla\tilde V^\pi(s')-\nabla\tilde V^\pi(s)\big]=0

Differentiating the differential Bellman equation leaves terms in ∇V~π\nabla\tilde V^\pi at the current and the next state. Under the stationary distribution, the next state has the same distribution as the current one, so the two averages are equal and cancel, leaving only ∑sdπ(s)∑a∇π(a∣s)Q~π(s,a)\sum_sd_\pi(s)\sum_a\nabla\pi(a\mid s)\tilde Q^\pi(s,a).

Question 2

To prove that an update direction g(θ)g(\boldsymbol\theta) is not the gradient of any function, what is it enough to show?

  1. That gg vanishes at some suboptimal policy
  2. That following gg sometimes lowers the return
  3. That the Jacobian of gg is not symmetric at some point, for example ∂g1/∂θ2≠∂g2/∂θ1\partial g_1/\partial\theta_2\neq\partial g_2/\partial\theta_1
  4. That gg has a larger norm than ∇Jγ\nabla J_\gamma
Show the answer

C. That the Jacobian of gg is not symmetric at some point, for example ∂g1/∂θ2≠∂g2/∂θ1\partial g_1/\partial\theta_2\neq\partial g_2/\partial\theta_1

If g=∇fg=\nabla f with gg continuously differentiable, then ff is twice continuously differentiable and its Hessian, the Jacobian of gg, is symmetric by the Clairaut–Schwarz theorem. One asymmetric pair of cross-derivatives rules out every ff. Nota and Thomas's two-state example has ∂g1/∂θ2=γ ∂g2/∂θ1\partial g_1/\partial\theta_2=\gamma\,\partial g_2/\partial\theta_1.

Question 3

With a tabular policy, one parameter block per state, how does the update gg that omits γt\gamma^t relate to ∇Jγ\nabla J_\gamma?

  1. It is identical to ∇Jγ\nabla J_\gamma
  2. Each state's block is the true gradient's block times a positive factor, so gg still ascends JγJ_\gamma and has the same stationary points
  3. It points downhill on JγJ_\gamma
  4. It is exactly the gradient of the undiscounted return
Show the answer

B. Each state's block is the true gradient's block times a positive factor, so gg still ascends JγJ_\gamma and has the same stationary points

Block ss of gg uses the undiscounted visits ∑tPr⁡(St=s)\sum_t\Pr(S_t=s) where the gradient uses ∑tγtPr⁡(St=s)\sum_t\gamma^t\Pr(S_t=s); their ratio is positive. A positive per-block rescaling keeps g⊤∇Jγ>0g^\top\nabla J_\gamma>0 away from stationary points, but it is not a gradient field. Shared parameters mix the blocks, and then gg can point downhill, as in the three-state example.

Question 4

Why can't the pathwise (reparameterization) estimator replace REINFORCE when ff is the true return of an unknown environment?

  1. It is biased even when ff is differentiable
  2. It only works for discrete actions
  3. Its variance is always higher than the score function's
  4. It needs the derivative of the return with respect to the action, which requires known, differentiable dynamics and rewards, or a learned critic standing in for them
Show the answer

D. It needs the derivative of the return with respect to the action, which requires known, differentiable dynamics and rewards, or a learned critic standing in for them

The pathwise estimator differentiates ff through the sampled action, so ff must be a known differentiable function of it. A real environment offers only samples of the return. Replacing the return by a learned Qw(s,a)Q_{\mathbf w}(s,a) makes the pathwise route possible, as in DPG and SAC, at the price of the critic's bias.

Further reading

  • R. S. Sutton, D. McAllester, S. Singh & Y. Mansour, "Policy gradient methods for reinforcement learning with function approximation," NIPS 12 (2000).
  • P. S. Thomas, "Bias in natural actor-critic algorithms," ICML (2014).
  • C. Nota & P. S. Thomas, "Is the policy gradient a gradient?" AAMAS (2020).
  • S. Zhang, R. Laroche, H. van Seijen, S. Whiteson & R. Tachet des Combes, "A deeper look at discounting mismatch in actor-critic algorithms," AAMAS (2022).
  • S. Mohamed, M. Rosca, M. Figurnov & A. Mnih, "Monte Carlo gradient estimation in machine learning," JMLR 21(132), 1–62 (2020).