Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Regularized and Residual-Based Policy Learning

DDPG and TD3 address continuous actions by learning a deterministic policy that amortizes the arg⁡max⁡aq(s,a)\arg\max_a q(s,a) operation. But deterministic policies have a fundamental limitation: they require external exploration noise (Gaussian perturbations in TD3) and can converge to suboptimal deterministic behaviors without adequate coverage of the state-action space.

Gradient estimators make stochastic actors trainable, while regularized dynamic programming specifies the stochastic policy they should approach. Can these pieces avoid both the continuous-action integral in the soft Bellman equation and the repeated optimization of a hard maximum?

The smoothing chapter presents an alternative: entropy-regularized MDPs, where the agent maximizes expected return plus a bonus for policy randomness. This yields stochastic policies with exploration built into the objective itself. The smooth Bellman operator replaces the hard max with a soft-max:

v∗(s)=1βlog⁡∑a∈Aexp⁡(β⋅q∗(s,a))v^*(s) = \frac{1}{\beta} \log \sum_{a \in \mathcal{A}} \exp\left(\beta \cdot q^*(s,a)\right)

where β=1/α\beta = 1/\alpha is the inverse temperature and α\alpha is the entropy regularization weight. For finite action spaces, this log-sum-exp is easy to compute. But for continuous actions A⊂Rm\mathcal{A} \subset \mathbb{R}^m, the sum becomes an integral:

v∗(s)=1βlog⁡∫Aexp⁡(β⋅q∗(s,a))dav^*(s) = \frac{1}{\beta} \log \int_{\mathcal{A}} \exp\left(\beta \cdot q^*(s,a)\right) da

This integral is intractable. We face an infinite-dimensional sum over the continuous action space. The very smoothness that gives us stochastic policies creates a new computational barrier, distinct from but analogous to the arg⁡max⁡\arg\max problem in standard FQI.

From Intractable Integral to Tractable Expectation

How can the continuous-action log-partition integral be rewritten as an expectation under the policy being learned?

Soft actor-critic (SAC) Haarnoja et al., 2018Haarnoja et al., 2018 exploits an equivalence between the intractable integral and an expectation. The optimal policy under entropy regularization is the Boltzmann distribution π∗(a∣s)∝exp⁡(β⋅q∗(s,a))\pi^*(a|s) \propto \exp(\beta \cdot q^*(s,a)). Under this policy, the soft value function becomes:

v∗(s)=Ea∼π∗(⋅∣s)[q∗(s,a)−αlog⁡π∗(a∣s)]v^*(s) = \mathbb{E}_{a \sim \pi^*(\cdot|s)}\left[q^*(s,a) - \alpha \log \pi^*(a|s)\right]

This converts the intractable integral into an expectation we can estimate by sampling. SAC learns a parametric policy πϕ\pi_{\boldsymbol{\phi}} that approximates the Boltzmann distribution, enabling fast action selection via a single forward pass. For bootstrap targets, SAC samples a~′∼πϕ(⋅∣s′)\tilde{a}' \sim \pi_{\boldsymbol{\phi}}(\cdot|s') and computes:

y=r+γ[min⁡j=1,2qθtargetj(s′,a~′)−αlog⁡πϕ(a~′∣s′)]y = r + \gamma \left[\min_{j=1,2} q^j_{\boldsymbol{\theta}_{\text{target}}}(s', \tilde{a}') - \alpha \log \pi_{\boldsymbol{\phi}}(\tilde{a}'|s')\right]

The minimum over twin Q-networks applies the clipped double-Q trick from TD3. Exploration comes from the policy’s stochasticity rather than external noise.

Learning the Policy: Matching the Boltzmann Distribution

Which divergence or equivalent stochastic objective moves the actor toward the Boltzmann distribution induced by the soft Q-function?

The Q-network update assumes a policy πϕ\pi_{\boldsymbol{\phi}} that approximates the Boltzmann distribution π∗(a∣s)∝exp⁡(β⋅q∗(s,a))\pi^*(a|s) \propto \exp(\beta \cdot q^*(s,a)). Training such a policy presents a problem: the Boltzmann distribution requires the partition function Z(s)=∫Aexp⁡(β⋅q(s,a))daZ(s) = \int_{\mathcal{A}} \exp(\beta \cdot q(s,a))da, the very integral we are trying to avoid. SAC sidesteps this by minimizing the KL divergence from the policy to the (unnormalized) Boltzmann distribution:

min⁡ϕEs∼D[DKL(πϕ(⋅∣s)∥exp⁡(β⋅qθ(s,⋅))Zθ(s))]\min_{\boldsymbol{\phi}} \mathbb{E}_{s \sim \mathcal{D}}\left[D_{KL}\left(\pi_{\boldsymbol{\phi}}(\cdot|s) \| \frac{\exp(\beta \cdot q_{\boldsymbol{\theta}}(s,\cdot))}{Z_{\boldsymbol{\theta}}(s)}\right)\right]

Since log⁡Zθ(s)\log Z_{\boldsymbol{\theta}}(s) does not depend on ϕ\boldsymbol{\phi}, this reduces to:

min⁡ϕEs∼DEa∼πϕ(⋅∣s)[αlog⁡πϕ(a∣s)−qθ(s,a)]\min_{\boldsymbol{\phi}} \mathbb{E}_{s \sim \mathcal{D}}\mathbb{E}_{a \sim \pi_{\boldsymbol{\phi}}(\cdot|s)}\left[\alpha \log \pi_{\boldsymbol{\phi}}(a|s) - q_{\boldsymbol{\theta}}(s,a)\right]

This pushes probability toward high Q-value actions while the log⁡πϕ\log \pi_{\boldsymbol{\phi}} term penalizes concentrating probability mass, maintaining entropy. The entropy bonus comes from the KL divergence structure rather than from an explicit regularization term.

To estimate gradients of this objective, we face a technical problem: the policy parameters ϕ\boldsymbol{\phi} appear in the sampling distribution πϕ\pi_{\boldsymbol{\phi}}, making ∇ϕEa∼πϕ[⋅]\nabla_{\boldsymbol{\phi}} \mathbb{E}_{a \sim \pi_{\boldsymbol{\phi}}}[\cdot] difficult to compute. SAC uses a Gaussian policy πϕ(a∣s)=N(μϕ(s),σϕ(s)2)\pi_{\boldsymbol{\phi}}(a|s) = \mathcal{N}(\mu_{\boldsymbol{\phi}}(s), \sigma_{\boldsymbol{\phi}}(s)^2) with the reparameterization trick. Express samples as a deterministic function of parameters and independent noise:

a=fϕ(s,ϵ)=μϕ(s)+σϕ(s)⊙ϵ,ϵ∼N(0,I)a = f_{\boldsymbol{\phi}}(s, \epsilon) = \mu_{\boldsymbol{\phi}}(s) + \sigma_{\boldsymbol{\phi}}(s) \odot \epsilon, \quad \epsilon \sim \mathcal{N}(0, I)

This moves ϕ\boldsymbol{\phi} out of the sampling distribution and into the integrand:

min⁡ϕEs∼DEϵ∼N(0,I)[αlog⁡πϕ(fϕ(s,ϵ)∣s)−qθ(s,fϕ(s,ϵ))]\min_{\boldsymbol{\phi}} \mathbb{E}_{s \sim \mathcal{D}}\mathbb{E}_{\epsilon \sim \mathcal{N}(0,I)}\left[\alpha \log \pi_{\boldsymbol{\phi}}(f_{\boldsymbol{\phi}}(s,\epsilon)|s) - q_{\boldsymbol{\theta}}(s,f_{\boldsymbol{\phi}}(s,\epsilon))\right]

We can now differentiate through fϕf_{\boldsymbol{\phi}} and the Q-network, as DDPG differentiates through a deterministic policy. SAC extends this by sampling noise ϵ\epsilon at each gradient step rather than outputting a single deterministic action.

The algorithm interleaves three updates. The Q-networks (lines 7-10) follow fitted Q-iteration with the soft Bellman target: sample a next action a~i′\tilde{a}'_i from the current policy, compute the entropy-adjusted target yi=ri+γ[min⁡jqtargetj(si′,a~i′)−αlog⁡πϕ(a~i′∣si′)]y_i = r_i + \gamma[\min_j q^j_{\text{target}}(s'_i, \tilde{a}'_i) - \alpha \log \pi_{\boldsymbol{\phi}}(\tilde{a}'_i|s'_i)], and minimize squared error. The minimum over twin Q-networks mitigates overestimation as in TD3. The policy (lines 12-13) updates to match the Boltzmann distribution induced by the current Q-function, using the reparameterization trick for gradient estimation. Target networks update via EMA (lines 15-16) to stabilize training.

The stochastic policy serves the same amortization purpose as in DDPG and TD3: it replaces the intractable arg⁡max⁡\arg\max operation with a fast network forward pass. SAC’s entropy regularization produces exploration through the policy’s inherent stochasticity rather than external noise. This makes SAC more robust to hyperparameters and eliminates the need to tune exploration schedules.

Path Consistency Learning (PCL)

Can a soft-optimal policy be trained by enforcing multi-step consistency directly rather than constructing one-step Bellman targets?

DDPG, TD3, and SAC all follow the same solution template from fitted Q-iteration: compute Bellman targets using the current Q-function, fit the Q-function to those targets, repeat. This is successive approximation, the function iteration approach vk+1=PLvkv_{k+1} = \Proj \Bellman v_k from the projection methods chapter.

Path Consistency Learning (PCL) Nachum et al., 2017 solves the Bellman equation differently. Instead of iterating the operator, it directly minimizes a residual. This is the least-squares approach from projection methods: solve N(v)=0\Residual(v) = 0 by minimizing ∥N(v)∥2\|\Residual(v)\|^2. The method exploits special structure (smooth Bellman operators under deterministic dynamics) that conventional methods cannot leverage.

The Path Consistency Property

Consider the entropy-regularized Q-function Bellman equation from the smoothing chapter. Under general stochastic dynamics, it involves an expectation over next states:

q∗(s,a)=r(s,a)+γEs′[v∗(s′)]q^*(s,a) = r(s,a) + \gamma \mathbb{E}_{s'}[v^*(s')]

Suppose the dynamics are deterministic: s′=f(s,a)s' = f(s,a). The next state is uniquely determined, so the expectation disappears:

q∗(s,a)=r(s,a)+γv∗(f(s,a))q^*(s,a) = r(s,a) + \gamma v^*(f(s,a))

The value function relates to Q-functions through the soft-max:

v∗(s)=αlog⁡∫Aexp⁡(q∗(s,a)/α)dav^*(s) = \alpha \log \int_{\mathcal{A}} \exp(q^*(s,a)/\alpha) da

Contrast two cases: general policies versus the optimal Boltzmann policy.

For general policies, the value equals an expectation:

vπ(s)=Ea∼π(⋅∣s)[qπ(s,a)−αlog⁡π(a∣s)]v^\pi(s) = \mathbb{E}_{a \sim \pi(\cdot|s)}[q^\pi(s,a) - \alpha \log \pi(a|s)]

This is an average. For a single observed action aa, we have:

qπ(s,a)−αlog⁡π(a∣s)=vπ(s)+ε(s,a)q^\pi(s,a) - \alpha\log\pi(a|s) = v^\pi(s) + \varepsilon(s,a)

where ε(s,a)\varepsilon(s,a) is sampling error with Ea∼π[ε(s,a)]=0\mathbb{E}_{a \sim \pi}[\varepsilon(s,a)] = 0. Individual actions give noisy estimates that fluctuate around the mean.

For the optimal policy under entropy regularization, the Boltzmann structure produces an exact pointwise identity. The optimal policy is:

π∗(a∣s)=exp⁡(q∗(s,a)/α)exp⁡(v∗(s)/α)\pi^*(a|s) = \frac{\exp(q^*(s,a)/\alpha)}{\exp(v^*(s)/\alpha)}

Taking logarithms and rearranging:

v∗(s)=q∗(s,a)−αlog⁡π∗(a∣s)for all av^*(s) = q^*(s,a) - \alpha \log \pi^*(a|s) \quad \text{for all } a

This holds exactly for every action aa, not just in expectation. There is no sampling error. The advantage q∗(s,a)−v∗(s)q^*(s,a) - v^*(s) is encoded in the log-probability: suboptimal actions have low q∗(s,a)q^*(s,a) but also large −αlog⁡π∗(a∣s)-\alpha\log\pi^*(a|s) (low probability means large negative log-probability), and these terms balance exactly to give v∗(s)v^*(s).

Now take a trajectory segment (s0,a0,s1,a1,…,sd)(s_0, a_0, s_1, a_1, \ldots, s_d) where each transition follows the deterministic dynamics st+1=f(st,at)s_{t+1} = f(s_t, a_t). Start with q∗(s0,a0)=r0+γv∗(s1)q^*(s_0, a_0) = r_0 + \gamma v^*(s_1) and use equation (15) to substitute v∗(s1)=q∗(s1,a1)−αlog⁡π∗(a1∣s1)v^*(s_1) = q^*(s_1,a_1) - \alpha\log\pi^*(a_1|s_1) exactly:

q∗(s0,a0)=r0+γ[q∗(s1,a1)−αlog⁡π∗(a1∣s1)]q^*(s_0, a_0) = r_0 + \gamma[q^*(s_1,a_1) - \alpha\log\pi^*(a_1|s_1)]

Substitute q∗(s1,a1)=r1+γv∗(s2)q^*(s_1,a_1) = r_1 + \gamma v^*(s_2):

q∗(s0,a0)=r0+γr1−γαlog⁡π∗(a1∣s1)+γ2v∗(s2)q^*(s_0, a_0) = r_0 + \gamma r_1 - \gamma\alpha\log\pi^*(a_1|s_1) + \gamma^2 v^*(s_2)

Continue this telescoping for dd steps. Each substitution is exact:

q∗(s0,a0)=∑t=0d−1γtrt−α∑t=1d−1γtlog⁡π∗(at∣st)+γdv∗(sd)q^*(s_0, a_0) = \sum_{t=0}^{d-1} \gamma^t r_t - \alpha \sum_{t=1}^{d-1} \gamma^t \log\pi^*(a_t|s_t) + \gamma^d v^*(s_d)

Apply equation (15) once more to get v∗(s0)=q∗(s0,a0)−αlog⁡π∗(a0∣s0)v^*(s_0) = q^*(s_0,a_0) - \alpha\log\pi^*(a_0|s_0):

v∗(s0)=∑t=0d−1γt[rt−αlog⁡π∗(at∣st)]+γdv∗(sd)v^*(s_0) = \sum_{t=0}^{d-1} \gamma^t [r_t - \alpha\log\pi^*(a_t|s_t)] + \gamma^d v^*(s_d)

Rearranging gives the path consistency residual:

R(s0:sd;π∗,v∗)=v∗(s0)−γdv∗(sd)−∑t=0d−1γt[rt−αlog⁡π∗(at∣st)]=0R(s_0:s_d; \pi^*, v^*) = v^*(s_0) - \gamma^d v^*(s_d) - \sum_{t=0}^{d-1} \gamma^t[r_t - \alpha\log\pi^*(a_t|s_t)] = 0

The telescoping produces an exact identity: R=0R = 0 for every action sequence, not just in expectation. The behavior policy never appears because the constraint holds as a deterministic identity for any observed (s0,a0,…,sd)(s_0, a_0, \ldots, s_d). This enables off-policy learning without importance sampling.

Remark 1 (Contrasting General Policies and Optimal Boltzmann Policies)

The distinction between equations (12) and (15) is subtle but crucial.

For general policies (equation (12)), the value is an average over actions sampled from the policy. Individual actions give noisy estimates: if we draw a∼π(⋅∣s)a \sim \pi(\cdot|s), then qπ(s,a)−αlog⁡π(a∣s)=vπ(s)+εq^\pi(s,a) - \alpha\log\pi(a|s) = v^\pi(s) + \varepsilon where ε\varepsilon is a zero-mean random variable. We need to average many samples to estimate vπ(s)v^\pi(s) accurately. Multi-step telescoping would accumulate these sampling errors ε0,ε1,…,εd−1\varepsilon_0, \varepsilon_1, \ldots, \varepsilon_{d-1}, producing noisy residuals even at the true solution. Off-policy learning would require importance weights to correct for using actions from a different behavior policy.

For the optimal entropy-regularized policy (equation (15)), the Boltzmann structure collapses the expectation to a pointwise identity. The relationship v∗(s)=q∗(s,a)−αlog⁡π∗(a∣s)v^*(s) = q^*(s,a) - \alpha\log\pi^*(a|s) holds exactly for every action aa, optimal or not. A suboptimal action has low q∗(s,a)q^*(s,a) (low expected return) and low π∗(a∣s)\pi^*(a|s) (low probability), making −αlog⁡π∗(a∣s)-\alpha\log\pi^*(a|s) large. These terms balance precisely to give v∗(s)v^*(s). No sampling error exists. The telescoping is exact, producing a residual that equals zero for every action sequence, not just in expectation. Off-policy learning works because the constraint holds as a deterministic identity for any observed path.

This property is unique to soft-max operators. For hard-max, v∗(s)=max⁡aq∗(s,a)v^*(s) = \max_a q^*(s,a) holds only when aa is optimal. Suboptimal actions satisfy v∗(s)>q∗(s,a)v^*(s) > q^*(s,a), an inequality that cannot be used to construct a residual.

Structural Requirements: Deterministic Dynamics and Entropy Regularization

PCL’s two structural requirements (deterministic dynamics and entropy regularization) are not arbitrary design choices. Each addresses a fundamental theoretical issue.

Deterministic Dynamics: Avoiding the Double Sampling Problem

Under stochastic dynamics, the Q-function Bellman equation has an expectation over next states:

q∗(s,a)=r(s,a)+γEs′∼p(⋅∣s,a)[v∗(s′)]q^*(s,a) = r(s,a) + \gamma \mathbb{E}_{s' \sim p(\cdot|s,a)}[v^*(s')]

The exact relationship (15) still holds, so we can write the path consistency constraint. But now consider what PCL minimizes: the squared residual E[R2]\mathbb{E}[R^2] where

R=vϕ(s0)−γdvϕ(sd)−∑t=0d−1γt[rt−αlog⁡πθ(at∣st)]R = v_{\boldsymbol{\phi}}(s_0) - \gamma^d v_{\boldsymbol{\phi}}(s_d) - \sum_{t=0}^{d-1} \gamma^t[r_t - \alpha\log\pi_{\boldsymbol{\theta}}(a_t|s_t)]

At the true optimum (v∗,π∗)(v^*, \pi^*), the constraint is E[R]=0\mathbb{E}[R] = 0, which implies (E[R])2=0(\mathbb{E}[R])^2 = 0. But PCL minimizes E[R2]\mathbb{E}[R^2], and by Jensen’s inequality:

E[R2]≥(E[R])2\mathbb{E}[R^2] \geq (\mathbb{E}[R])^2

with equality only when RR has zero variance. Under stochastic dynamics, even at optimality, individual trajectory residuals are random variables with mean zero but positive variance (due to transition noise). Minimizing E[R2]\mathbb{E}[R^2] to zero would require driving Var(R)→0\text{Var}(R) \to 0, which is impossible and pushes the solution away from the true optimum.

This is Baird’s double sampling problem Baird, 1995. To get an unbiased gradient of (E[R])2(\mathbb{E}[R])^2, we need:

∇(E[R])2=2E[R]⋅∇E[R]=2E[R]⋅E[∇R]\nabla (\mathbb{E}[R])^2 = 2\mathbb{E}[R] \cdot \nabla \mathbb{E}[R] = 2\mathbb{E}[R] \cdot \mathbb{E}[\nabla R]

This requires two independent samples of the next state from the same (s,a)(s,a) pair: one for estimating E[R]\mathbb{E}[R] and one for E[∇R]\mathbb{E}[\nabla R]. With a simulator, this is possible. With real trajectories, it is not.

Under deterministic dynamics, RR is deterministic (no transition noise), so E[R2]=(E[R])2\mathbb{E}[R^2] = (\mathbb{E}[R])^2 and Jensen’s inequality holds with equality. Minimizing the squared residual is equivalent to solving E[R]=0\mathbb{E}[R] = 0.

Entropy Regularization: Enabling All-Action Consistency

Attempt the same path consistency derivation with the hard-max Bellman operator. Under deterministic dynamics, the Q-function satisfies:

q∗(s,a)=r(s,a)+γv∗(f(s,a))q^*(s,a) = r(s,a) + \gamma v^*(f(s,a))

where v∗(s)=max⁡a′q∗(s,a′)v^*(s) = \max_{a'} q^*(s,a') and the optimal policy is π∗(s)=arg⁡max⁡aq∗(s,a)\pi^*(s) = \arg\max_a q^*(s,a) (deterministic).

Now try to relate v∗(s)v^*(s) to an arbitrary observed action aa. For the optimal action a∗∈arg⁡max⁡a′q∗(s,a′)a^* \in \arg\max_{a'} q^*(s,a'), we have:

v∗(s)=q∗(s,a∗)v^*(s) = q^*(s,a^*)

But for a suboptimal action a≠a∗a \ne a^*:

v∗(s)=max⁡a′q∗(s,a′)>q∗(s,a)v^*(s) = \max_{a'} q^*(s,a') > q^*(s,a)

This is an inequality, not an equation. There is no formula expressing v∗(s)v^*(s) in terms of q∗(s,a)q^*(s,a) for suboptimal actions.

Attempt the multi-step telescoping. Start with q∗(s0,a0)=r0+γv∗(s1)q^*(s_0, a_0) = r_0 + \gamma v^*(s_1). To continue, we need to express v∗(s1)v^*(s_1) using the observed action a1a_1. But we only have:

v∗(s1)≥q∗(s1,a1)v^*(s_1) \geq q^*(s_1, a_1)

with equality only if a1a_1 happens to be optimal at s1s_1. We cannot substitute this into the Q-function equation to get an exact telescoping. The derivation breaks at the first step.

Compare this to the soft-max case. The Boltzmann structure gives equation (15): v∗(s)=q∗(s,a)−αlog⁡π∗(a∣s)v^*(s) = q^*(s,a) - \alpha\log\pi^*(a|s) for all actions aa. The log-probability term compensates exactly for suboptimality: low-probability actions have large −αlog⁡π∗(a∣s)-\alpha\log\pi^*(a|s), which adds to the low q∗(s,a)q^*(s,a) to recover v∗(s)v^*(s). This enables exact substitution at every step:

v∗(s1)=q∗(s1,a1)−αlog⁡π∗(a1∣s1)(exact for any a1)v^*(s_1) = q^*(s_1, a_1) - \alpha\log\pi^*(a_1|s_1) \quad \text{(exact for any } a_1\text{)}

The telescoping proceeds without inequalities or restrictions on which actions were chosen. Multi-step hard-max Q-learning lacks theoretical justification for off-policy data because when we observe a trajectory with suboptimal actions, we cannot write an exact path consistency constraint.

Both requirements are structural:

RequirementAddresses
Deterministic dynamicsDouble sampling bias: ensures E[R2]=(E[R])2\mathbb{E}[R^2] = (\mathbb{E}[R])^2
Entropy regularizationAll-action consistency (equation (15))

Without deterministic dynamics, residual minimization is biased. Without entropy regularization, the constraint holds only for optimal actions.

The Learning Objective

Equation (20) provides a constraint that the optimal (v∗,π∗)(v^*, \pi^*) must satisfy: the residual equals zero for every observed path. For parametric approximations (vϕ,πθ)(v_{\boldsymbol{\phi}}, \pi_{\boldsymbol{\theta}}) that are not yet optimal, the residual is nonzero:

R(s0:sd;θ,ϕ)=vϕ(s0)−γdvϕ(sd)−∑t=0d−1γt[rt−αlog⁡πθ(at∣st)]R(s_0:s_d; \boldsymbol{\theta}, \boldsymbol{\phi}) = v_{\boldsymbol{\phi}}(s_0) - \gamma^d v_{\boldsymbol{\phi}}(s_d) - \sum_{t=0}^{d-1} \gamma^t[r_t - \alpha \log \pi_{\boldsymbol{\theta}}(a_t|s_t)]

PCL minimizes the squared residual over observed path segments:

min⁡θ,ϕ∑segments12R(si:si+d;θ,ϕ)2\min_{\boldsymbol{\theta}, \boldsymbol{\phi}} \sum_{\text{segments}} \frac{1}{2} R(s_i:s_{i+d}; \boldsymbol{\theta}, \boldsymbol{\phi})^2

This is the least-squares residual approach from the projection methods chapter. SAC computes targets yiy_i and fits to them (successive approximation). PCL directly minimizes the residual without computing targets or performing a separate fitting step.

Gradient descent gives:

θk+1=θk+ηπ∑iRi⋅α∑t=0d−1γt∇θlog⁡πθk(ai+t∣si+t)ϕk+1=ϕk−ηv∑iRi[∇ϕvϕk(si)−γd∇ϕvϕk(si+d)]\begin{align} \boldsymbol{\theta}_{k+1} &= \boldsymbol{\theta}_k + \eta_\pi \sum_i R_i \cdot \alpha \sum_{t=0}^{d-1} \gamma^t \nabla_{\boldsymbol{\theta}} \log \pi_{\boldsymbol{\theta}_k}(a_{i+t}|s_{i+t}) \\ \boldsymbol{\phi}_{k+1} &= \boldsymbol{\phi}_k - \eta_v \sum_i R_i \left[\nabla_{\boldsymbol{\phi}} v_{\boldsymbol{\phi}_k}(s_i) - \gamma^d \nabla_{\boldsymbol{\phi}} v_{\boldsymbol{\phi}_k}(s_{i+d})\right] \end{align}

where Ri=R(si:si+d;θk,ϕk)R_i = R(s_i:s_{i+d}; \boldsymbol{\theta}_k, \boldsymbol{\phi}_k). Large residuals drive larger updates.

The algorithm collects trajectories from the current policy and stores them in a replay buffer. At each iteration, it samples a trajectory (possibly old) and performs gradient descent on the path residual for all dd-step segments. The replay buffer enables off-policy learning: trajectories from old policies, expert demonstrations, or exploratory behavior all provide valid training signals.

Unified Parameterization: Single Q-Network

Algorithm 2 uses separate networks for policy and value. But we can use a single Q-network qθ(s,a)q_{\boldsymbol{\theta}}(s,a) and derive both:

vθ(s)=αlog⁡∑aexp⁡(qθ(s,a)/α),πθ(a∣s)=exp⁡(qθ(s,a)/α)∑a′exp⁡(qθ(s,a′)/α)v_{\boldsymbol{\theta}}(s) = \alpha \log \sum_{a} \exp(q_{\boldsymbol{\theta}}(s,a)/\alpha), \qquad \pi_{\boldsymbol{\theta}}(a|s) = \frac{\exp(q_{\boldsymbol{\theta}}(s,a)/\alpha)}{\sum_{a'} \exp(q_{\boldsymbol{\theta}}(s,a')/\alpha)}

The path residual becomes:

R(si:si+d;θ)=vθ(si)−γdvθ(si+d)−∑t=0d−1γt[ri+t−αlog⁡πθ(ai+t∣si+t)]R(s_i:s_{i+d}; \boldsymbol{\theta}) = v_{\boldsymbol{\theta}}(s_i) - \gamma^d v_{\boldsymbol{\theta}}(s_{i+d}) - \sum_{t=0}^{d-1} \gamma^t[r_{i+t} - \alpha \log \pi_{\boldsymbol{\theta}}(a_{i+t}|s_{i+t})]

and the gradient combines both value and policy contributions through the same parameters. This unified architecture eliminates the actor-critic separation: one Q-network serves both roles.

Connection to Existing Methods

Single-step case (d=1d=1): The path residual becomes R(s:s′;θ,ϕ)=vϕ(s)−γvϕ(s′)−r+αlog⁡πθ(a∣s)R(s:s'; \boldsymbol{\theta}, \boldsymbol{\phi}) = v_{\boldsymbol{\phi}}(s) - \gamma v_{\boldsymbol{\phi}}(s') - r + \alpha\log\pi_{\boldsymbol{\theta}}(a|s). For unified parameterization where vθ(s)=qθ(s,a)−αlog⁡πθ(a∣s)v_{\boldsymbol{\theta}}(s) = q_{\boldsymbol{\theta}}(s,a) - \alpha\log\pi_{\boldsymbol{\theta}}(a|s) exactly, this becomes R=qθ(s,a)−r−γvθ(s′)R = q_{\boldsymbol{\theta}}(s,a) - r - \gamma v_{\boldsymbol{\theta}}(s'), the soft Bellman residual. Minimizing ∑iRi2\sum_i R_i^2 is equivalent to soft Q-learning, though SAC solves this via successive approximation (compute targets, fit) rather than direct residual minimization.

No entropy (α→0\alpha \to 0): The residual becomes R=v(si)−γdv(si+d)−∑tγtrtR = v(s_i) - \gamma^d v(s_{i+d}) - \sum_t \gamma^t r_t, the negative dd-step advantage. But unlike A2C/A3C where vv tracks the current policy’s value, PCL’s value converges to v∗v^* because the residual couples policy and value through the optimality condition.

Multi-step with hard-max: No analog exists. The hard-max Bellman operator max⁡aq(s,a)\max_a q(s,a) does not have an exact pointwise relationship like equation (15). Multi-step telescoping would accumulate errors from the max operator, making the constraint valid only in expectation under the optimal policy. The soft-max structure enables exact off-policy path consistency.

PCL vs SAC: Residual Minimization vs Successive Approximation

Both methods solve entropy-regularized MDPs but use fundamentally different solution strategies:

AspectSACPCL
Solution methodSuccessive approximation: compute targets yiy_i, fit qq to targetsResidual minimization: minimize ∑iRi2\sum_i R_i^2 directly
Update structureTarget computation + regression stepSingle gradient step on squared residual
Target networksRequired (mark outer-iteration boundaries)None (residual constraint, not target fitting)
Temporal horizonSingle-step TD: y=r+γV(s′)y = r + \gamma V(s')Multi-step paths: accumulate over dd steps
Off-policy handlingReplay buffer with single-sample biasNo importance sampling (works for any trajectory)
Dynamics requirementGeneral stochastic transitionsDeterministic transitions s′=f(s,a)s' = f(s,a)
ArchitectureTwin Q-networks + policy networkSingle Q-network (unified parameterization)

PCL requires deterministic dynamics. It gains multi-step telescoping and off-policy learning without importance weights, but only for deterministic systems (robotic manipulation, many control tasks). SAC works for general stochastic MDPs.

PCL as Amortization

PCL amortizes at a different level than DDPG/TD3/SAC. Those methods amortize the action maximization: learn a policy network that outputs arg⁡max⁡aq(s,a)\arg\max_a q(s,a) directly. PCL amortizes the solution of the Bellman equation itself. Instead of repeatedly applying the Bellman operator (which requires ∫Aexp⁡(q/α)da\int_{\mathcal{A}} \exp(q/\alpha) da at every iteration), PCL samples path segments and minimizes their residual. The computational cost of verifying optimality across all states and path lengths is distributed across training through sampled gradient updates.

Model Predictive Path Integral Control

How does online trajectory optimization compare with amortizing action selection into a learned policy?

The MPPI development constructs a distribution over finite control sequences by exponentially tilting a reference distribution toward low-cost trajectories. A shifted Gaussian proposal makes these trajectories easier to sample. Importance weights then correct for the change of proposal, and their weighted perturbations update the nominal sequence. The controller applies its first action and shifts the remaining sequence to initialize the next optimization.

This calculation shares an exponential form with the policies derived from entropy regularization, but the distributions and optimization problems require separate definitions. SAC regularizes a state-conditional action policy. The information-theoretic MPPI construction regularizes a distribution over trajectories relative to a specified reference law Williams et al., 2017. In the separate continuous-time path-integral derivation, the reference law is generated by an uncontrolled diffusion, and the quadratic control cost must match its noise covariance. Neither derivation identifies an arbitrary MPPI implementation with SAC or PCL’s soft Bellman solution.

The Gaussian mean update fits the tilted trajectory distribution by minimizing KL divergence from that distribution to the Gaussian family. It need not minimize the original expected-cost objective over Gaussian policies. Its sampled implementation also has discretization and finite-sampling error. The aircraft example also estimates each candidate’s expected cost across possible wind futures. For the matched stochastic-control model, the Brownian passage examples compare sampled feedback with analytic and numerical reference solutions.

Online Optimization and Amortization

An actor network distributes computation across training examples and returns an action through a forward pass. MPPI spends model evaluations at the current state, with a warm start from the previous plan. A new cost function can be used in its next optimization, although finite computation and a poor proposal can still prevent a useful update.

The computational comparison separates where effort is spent from the errors that remain:

AspectLearned actorMPPI
Action selectionPolicy-network evaluationRepeated batches of model rollouts
Reuse across decisionsTrained parametersShifted nominal control sequence
Model use at deploymentOften unnecessaryA rollout model is required
Approximation sourcesPolicy and value approximation, estimation, optimizationModel error, discretization, restricted proposal, finite sampling
Changed objectiveUsually requires further trainingEnters subsequent rollout costs

For a deterministic rollout model, one MPPI iteration with KK sequences and HH time steps uses KHKH transition evaluations. Estimating each sequence’s expected cost across LL disturbance scenarios increases that count to KHLKHL. These evaluations can be batched across sequences and scenarios, while each trajectory still advances through time. The practical choice depends on model cost, available parallel computation, and the accuracy required at each decision.

An Alternative: Euler Equation Methods

Can first-order optimality eliminate the value function and yield a functional equation directly in the policy?

The methods developed in this chapter all parameterize policies, but they remain rooted in the Bellman equation. NFQCA, DDPG, TD3, and SAC learn Q-functions through successive approximation, then derive policies by maximizing these Q-functions. PCL minimizes a path residual derived from the soft Bellman equation. The policy serves as an amortized optimizer for a value-based objective.

There is a different approach, developed in computational economics Judd, 1992Rust, 1996Judd, 1998, that also parameterizes policies but solves an entirely different functional equation. Consider a control problem with continuous states and actions, deterministic dynamics s′=f(s,a)s' = f(s,a), and differentiable reward r(s,a)r(s,a). The optimal action π∗(s)\pi^*(s) satisfies the first-order condition:

∂r(s,a)∂a∣a=π∗(s)+γ ∂v∗(s′)∂s′∣s′=f(s,π∗(s)) ∂f(s,a)∂a∣a=π∗(s)=0.\frac{\partial r(s,a)}{\partial a}\Big|_{a=\pi^*(s)} + \gamma\, \frac{\partial v^*(s')}{\partial s'}\Big|_{s'=f(s,\pi^*(s))}\, \frac{\partial f(s,a)}{\partial a}\Big|_{a=\pi^*(s)} = 0.

This Euler equation expresses optimality through derivatives rather than through the max operator. For problems with special structure (the Euler class, where dynamics are affine in the controlled state), envelope theorems eliminate v∗v^* entirely, yielding a closed functional equation E(π)(s)=0\mathcal{E}(\pi)(s) = 0 in the policy alone.

With a parameterized policy πθ(s)\pi_{\boldsymbol{\theta}}(s), we can discretize via collocation or Galerkin projection:

G(θ):=[E(πθ)(s1)⋮E(πθ)(sN)]=0.G(\boldsymbol{\theta}) := \begin{bmatrix} \mathcal{E}(\pi_{\boldsymbol{\theta}})(s_1) \\ \vdots \\ \mathcal{E}(\pi_{\boldsymbol{\theta}})(s_N) \end{bmatrix} = 0.

This is root-finding, not fixed-point iteration. Newton-type methods replace the successive approximation of fitted Q-iteration. The Euler operator is not a contraction, so convergence guarantees are problem-dependent.

What does this mean for reinforcement learning? The Euler approach shares the amortization idea: learn a policy network that directly outputs actions. But the training objective comes from first-order optimality conditions rather than from Bellman residuals or Q-function maximization. This raises questions worth considering. Could Euler-style objectives provide useful training signals for actor-critic methods? When dynamics are known or learned, could first-order conditions offer advantages over value-based objectives? The connection between these traditions remains underexplored.

Summary

SAC converts the soft value integral into an expectation under a learned stochastic policy. PCL instead minimizes a multi-step consistency residual, and MPPI updates a finite-horizon trajectory distribution at each decision. The Euler approach supplies a further alternative: solve a first-order policy equation rather than a Bellman fixed point.

MPPI avoids a persistent actor approximation by performing online sampling and optimization. Its exponential weights resemble those of entropy-regularized policies, but its reference distribution, horizon, and sampling assumptions define a different optimization problem. Finite computation and model error remain in either approach.

All of these objectives retain an optimality equation derived from a value or path-consistency relation. Can expected return be differentiated directly without first treating a Bellman equation as the training objective? Policy gradients and actor-critic methods use the trajectory score and bring value functions back as variance-reducing critics.

Self-checks

Solution to Exercise 1

MPPI spends many model rollouts at every decision and avoids a persistent actor approximation, but retains model, discretization, proposal, and finite-sampling errors. An actor is cheap online but can introduce error because its parameters only approximate the desired decision rule. A warm-started MPPI sequence and a trained actor reuse computation in different ways.

References
  1. Haarnoja, T., Zhou, A., Abbeel, P., & Levine, S. (2018). Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. Proceedings of the 35th International Conference on Machine Learning (ICML), 1861–1870.
  2. Haarnoja, T., Zhou, A., Hartikainen, K., Tucker, G., Ha, S., Tan, J., Kumar, V., Zhu, H., Gupta, A., Abbeel, P., & Levine, S. (2018). Soft actor-critic algorithms and applications. arXiv Preprint arXiv:1812.05905.
  3. Nachum, O., Norouzi, M., Xu, K., & Schuurmans, D. (2017). Bridging the Gap Between Value and Policy Based Reinforcement Learning. Advances in Neural Information Processing Systems, 30, 2775–2785.
  4. Baird, L. (1995). Residual algorithms: Reinforcement learning with function approximation. Proceedings of the Twelfth International Conference on Machine Learning, 30–37.
  5. Williams, G., Drews, P., Goldfain, B., Rehg, J. M., & Theodorou, E. A. (2017). Information Theoretic Model Predictive Control: Theory and Applications to Autonomous Driving. 10.48550/arXiv.1707.02342
  6. Judd, K. L. (1992). Projection methods for solving aggregate growth models. Journal of Economic Theory, 58(2), 410–452.
  7. Rust, J. (1996). Chapter 14 Numerical dynamic programming in economics. In Handbook of Computational Economics (pp. 619–729). Elsevier. 10.1016/s1574-0021(96)01016-7
  8. Judd, K. L. (1998). Numerical Methods in Economics. MIT Press.