Deterministic Policy Gradients: DDPG & TD3
The DPG theorem, its deep version, and three fixes for overestimation.
A policy that never randomizes has no score function, so the likelihood-ratio machinery of policy gradients seems not to apply. Silver et al. (2014) showed that it is not needed: a deterministic policy's return has a gradient, given by the chain rule through the critic; it is the zero-noise limit of the stochastic policy gradient; and it can be estimated off-policy without importance sampling. This lesson proves the theorem, builds compatible critics for deterministic actors, then follows the deep version from DDPG's overestimation to TD3's three fixes and their successors.
What you’ll learn
- State and prove the deterministic policy gradient theorem, and explain its relation to stochastic policy gradients as the noise vanishes, including what happens to the variance of the two estimators.
- Derive the off-policy deterministic actor–critic and the compatible critic , whose weights are the natural deterministic policy gradient.
- Reproduce the argument that an actor trained on an approximate critic overestimates, and explain how each of TD3's fixes responds, including the underestimation that clipped double Q-learning introduces.
- Summarize what is known about the brittleness of deep deterministic actor–critics, and the ensemble and distributional critics that followed TD3.
The deterministic policy gradient theorem
Take continuous actions and a deterministic policy (Silver et al.'s notation; the start distribution is written in this lesson). The return is . The parameters move the action in every state and, through it, every later state, so a gradient seems to need the derivative of the state distribution. It does not.
Write . The value of a deterministic policy is its action value at its own action:
The parameters enter through the action in the first two places and through in the third. The chain rule collects the first two into , since :
This is a Bellman equation for with "reward" . Unrolling it, which the regularity conditions justify, sums along the policy's own trajectory:
Average over ; by definition of the normalized discounted distribution, . The derivative of the state distribution never appears because it is absorbed into the recursion, exactly as in the stochastic theorem.
Silver et al. (Theorem 2) also show the two theorems are one. Let be stochastic policies whose densities concentrate on as , Gaussians among them. Under further regularity conditions, . The gradients agree in the limit. Their estimators do not.
For a one-dimensional Gaussian policy with mean and standard deviation , what is the variance of the score under the policy?
Show the answer
100
. A likelihood-ratio estimator multiplies returns by this score, so its variance grows without bound as exploration shrinks, even though its expectation converges to the deterministic gradient. The deterministic estimator has no score at all. On a continuous bandit with a quadratic cost, Silver et al. found the deterministic actor–critic's advantage over a stochastic one growing with the action dimension (10, 25 and 50).
Off-policy learning and compatible critics
Let a stochastic behavior policy generate the data, with discounted state distribution , and evaluate the deterministic target policy on those states, . Dropping the term that differentiates itself, as Degris, White and Sutton's off-policy actor–critic does for stochastic policies, gives the off-policy deterministic policy gradient:
Let be the error in the action gradient. By condition 1, , so the least-squares optimality condition of (2) reads
Rearranged, the critic's action gradient has the same projection onto the actor's Jacobian as the true one, which is all the gradient formula uses.
The compatible critic is linear in : a local model of the advantage of deviating from the policy's action, with features . As a global model of it is useless (it diverges for large deviations), but the gradient only looks at the slope at . It parallels the stochastic case (Compatible Features & Two-Timescale Actor–Critic), including the natural gradient: with the metric , the limit of the Fisher information as the policy's variance shrinks (up to scale), the compatible weights are the natural deterministic policy gradient: , so the actor can simply step along .
In practice the critic's weights are learned by TD methods, which do not minimize the error in condition 2, so the gradient is only approximately exact. Silver et al.'s COPDAC-GQ uses a gradient-TD critic (gradient Q-learning) on a faster timescale than the actor, which converges to the minimizer of the projected Bellman error under step-size conditions, where off-policy linear Q-learning may diverge.
The compatible critic is linear in the action deviation , while true action values are far from linear in . Why does it still give the exact gradient?
- Because true action values become linear in once the policy is optimal
- Because the deterministic gradient uses the critic only through its action gradient at , and the least-squares fit matches that slope where the actor's Jacobian can see it
- Because the baseline absorbs all the nonlinearity
- It does not: compatibility only reduces the gradient's variance
Show the answer
B. Because the deterministic gradient uses the critic only through its action gradient at , and the least-squares fit matches that slope where the actor's Jacobian can see it
Only at the policy's own action enters , and only through its projection onto the columns of . A linear model in the deviation can match that slope exactly; its values far from never matter.
Why an actor overestimates
DDPG (Lillicrap et al., 2016) is the off-policy deterministic actor–critic with deep networks and DQN's stabilizers: replay, slowly tracking target networks, batch normalization, and Ornstein–Uhlenbeck exploration noise. Its authors noted that nonlinear function approximation nullifies any convergence guarantee. Fujimoto, van Hoof and Meger (2018) isolated one specific failure, an actor-critic version of overestimation bias. Write for the critic and for the true action values of the current actor .
Each update is, to first order, the steepest ascent direction of its own objective. So for steps small enough, the approximate update is at least as good by the critic as the true one, and the true update is at least as good in truth as the approximate one:
Chain the two inequalities through the assumption.
The argument is local and per update, but its consequence compounds. A small overestimate in each update is copied into the critic's targets by bootstrapping, and a wrong critic produces poor policy updates, which make the targets worse: a feedback loop. On Hopper and Walker2d the authors measured DDPG's average value estimate climbing far above the true return. It is maximization bias again, with a gradient step on the critic playing the role of the max (Maximization Bias & Double Q-Learning). The widget shows the tabular version, and the price of the cure.
TD3, precisely
Double estimators need two independent estimates. Double DQN's recipe, choosing with the current actor and evaluating with the target critic, failed in actor–critic form: with a slowly changing policy the current and target networks were too similar. Two full actor–critic pairs, each critic evaluating the other's actor, reduced the bias but did not remove it, since the critics share a replay buffer and each other's targets. TD3 instead keeps one actor and caps the target at the smaller of two critics, clipped double Q-learning:
Delayed policy updates. With target networks the critic's error shrinks over several updates, while actor updates taken on high-error estimates can make the values diverge. TD3 therefore updates the actor and the target networks once every critic updates.
Target policy smoothing. A deterministic actor can overfit narrow peaks of the critic. The ideal target averages over a neighborhood of the target action, , enforcing that similar actions have similar values; one clipped noise sample per target approximates it. The result resembles expected SARSA for a noisy version of the target policy, and, like SARSA, favors actions that are robust to perturbation.
| Variant (TD3 paper, Table 2) | HalfCheetah | Hopper | Walker2d | Ant |
|---|---|---|---|---|
| TD3 | 9533 | 3305 | 4565 | 4185 |
| without clipped double Q | 9793 | 1837 | 2579 | 850 |
| without delayed updates | 9591 | 2407 | 4696 | 3754 |
| without target smoothing | 8988 | 2393 | 4034 | 4155 |
| none of the three (TD3's architecture and settings) | 8401 | 1062 | 2362 | 564 |
| DDPG as published | 3163 | 1732 | 1521 | 816 |
Brittleness, and what came after
Deep deterministic actor–critics remain sensitive. Henderson et al. (2018) showed that results for DDPG and other continuous-control algorithms swing with hyperparameters, network architecture, reward scaling, codebase and random seeds: ten runs of one algorithm with one configuration (TRPO on HalfCheetah), split into two groups of five seeds, gave statistically different learning curves. A deterministic actor also explores only through noise added from outside, which TD3 keeps simple (Gaussian, standard deviation 0.1, after 1,000 to 10,000 purely random steps).
Later methods tuned the pessimism more finely. D4PG (Barth-Maron et al., 2018) gave DDPG a distributional critic, -step returns, prioritized replay and distributed actors. TQC (Kuznetsov, Shvechikov, Grishin & Vetrov, 2020) mixes several distributional critics and drops the highest quantiles of their pooled prediction, a dial for overestimation rather than TD3's all-or-nothing minimum. REDQ (Chen, Wang, Zhou & Ross, 2021) takes the minimum over a random subset of a large ensemble of critics, which allows many gradient updates per environment step, and reported sample efficiency matching a state-of-the-art model-based method on MuJoCo. SAC (Maximum-Entropy RL & Soft Actor–Critic) kept TD3's twin critics but replaced the deterministic actor by a stochastic one.
Key takeaways
- follows by differentiating the Bellman equation and unrolling; it is the zero-noise limit of the stochastic policy gradient, whose likelihood-ratio estimator has variance growing like .
- Off-policy, the actor needs no importance weights; a compatible critic fitted by least squares on action gradients makes the gradient exact, and its weights are the natural deterministic gradient.
- An actor climbing an approximate critic yields a policy its critic overestimates whenever the critic does not underestimate the true step (Fujimoto et al., 2018); bootstrapping compounds the bias.
- TD3 caps targets at the minimum of two critics (convergent in the tabular case, biased low), delays actor updates and smooths target actions; the components interact and their value varies by task.
- Successors tune the pessimism more finely (distributional critics with truncation, randomized ensembles), and deep deterministic actor–critics remain sensitive to seeds and hyperparameters.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
A Gaussian policy's standard deviation is sent to zero. What happens to the stochastic policy gradient and to its likelihood-ratio estimator?
- Both converge to the deterministic policy gradient, with vanishing variance
- The gradient diverges, which is why deterministic policies need a separate theorem
- The gradient converges to the deterministic policy gradient, but the estimator's variance grows like , because the score blows up
- The gradient converges to zero, because a deterministic policy cannot be improved
Show the answer
C. The gradient converges to the deterministic policy gradient, but the estimator's variance grows like , because the score blows up
Silver et al.'s Theorem 2 gives the limit of the gradients. The estimator is a different matter: its score has variance per dimension, so sampling it becomes hopeless exactly where the deterministic estimator, which differentiates the critic instead, works best.
Which two conditions make a critic compatible with a deterministic actor ?
- is a neural network, and it is trained by TD learning with target networks
- everywhere, and the actor is linear
- Its action gradient at the actor's action is linear in the actor's Jacobian, , and minimizes the squared error of that action gradient
- Its features are the score functions
Show the answer
C. Its action gradient at the actor's action is linear in the actor's Jacobian, , and minimizes the squared error of that action gradient
These are the conditions of Silver et al.'s Theorem 3. The least-squares condition makes the critic's slope match the true slope where the actor's Jacobian looks, which is all the gradient uses; may be wrong everywhere else.
Fujimoto et al.'s argument concludes that the policy an actor–critic produces is overestimated by its own critic. Which assumption does it need?
- That the critic's errors are zero-mean noise independent of the action
- That the critic does not underestimate, in expectation, the value of the policy the true gradient step would produce, and that the step size is small
- That the environment is deterministic
- That the actor is linear in its parameters
Show the answer
B. That the critic does not underestimate, in expectation, the value of the policy the true gradient step would produce, and that the step size is small
The proof chains three inequalities: the approximate step is best by the critic, the true step is best in truth (both for small steps), and the critic is at least the truth at the true step's policy. Nothing else is assumed, which is why the effect is so general.
What did TD3's ablation study show about its three components?
- Target policy smoothing alone recovers most of TD3's performance on every task
- Each component alone improves every task substantially
- Delayed policy updates hurt performance, since the actor trains half as often
- Single components mostly helped little, combinations helped much more, and their importance varied by task; removing clipped double Q hurt Hopper, Walker2d and Ant badly but not HalfCheetah
Show the answer
D. Single components mostly helped little, combinations helped much more, and their importance varied by task; removing clipped double Q hurt Hopper, Walker2d and Ant badly but not HalfCheetah
The components interact. The ablation is a warning against attributing an algorithm's gains to one mechanism on the basis of a few tasks, and with 10 trials per entry, small differences are noise.
Further reading
- D. Silver, G. Lever, N. Heess, T. Degris, D. Wierstra & M. Riedmiller, "Deterministic policy gradient algorithms," ICML (2014).
- T. P. Lillicrap, J. J. Hunt, A. Pritzel, N. Heess, T. Erez, Y. Tassa, D. Silver & D. Wierstra, "Continuous control with deep reinforcement learning," ICLR (2016).
- S. Fujimoto, H. van Hoof & D. Meger, "Addressing function approximation error in actor-critic methods," ICML (2018).
- P. Henderson, R. Islam, P. Bachman, J. Pineau, D. Precup & D. Meger, "Deep reinforcement learning that matters," AAAI (2018).
- X. Chen, C. Wang, Z. Zhou & K. Ross, "Randomized ensembled double Q-learning: Learning fast without a model," ICLR (2021).