TD3: Three Fixes for an Overconfident Actor-Critic

3 minute read

Published:

TL;DR: Twin Delayed Deep Deterministic Policy Gradient (TD3) stabilises continuous control with three changes: use the smaller of two target critics, update the actor less often, and perturb the target action before evaluating it. These mechanisms reduce the actor's ability to exploit critic errors. They do not make value estimates exact or turn an online algorithm into an offline-safe one.
First page of Addressing Function Approximation Error in Actor-Critic Methods
Paper preview: Addressing Function Approximation Error in Actor-Critic Methods.
Scott Fujimoto, Herke van Hoof, David Meger
Read the paper (PDF)

When the actor finds the critic’s mistake

Intuition first. Suppose a robot chooses a motor command by asking a learned critic which command has the highest return. If the critic invents a narrow peak around an unfamiliar command, the actor will move towards it. The replay buffer may eventually correct that error, but meanwhile both policy and bootstrap targets can drift.

TD3 addresses this feedback loop in deterministic actor-critic learning. The actor \(\mu_\theta(s)\) outputs a continuous action; two critics estimate \(Q_{\phi_1}(s,a)\) and \(Q_{\phi_2}(s,a)\). Transitions are sampled from replay, so the method is off-policy. The original method is due to Fujimoto, van Hoof, and Meger.

One target, three changes

Bars denote slowly updated target networks. For action bounds \([a_{\min},a_{\max}]\), form

\[ \begin{aligned} \epsilon &\sim \operatorname{clip}(\mathcal N(0,\sigma^2 I),-c,c),\\ \tilde a' &= \operatorname{clip}(\mu_{\bar\theta}(s')+\epsilon,a_{\min},a_{\max}),\\ y &= r+\gamma(1-d)\min_{i=1,2}Q_{\bar\phi_i}(s',\tilde a'). \end{aligned} \]

Here \(d\) marks a genuine terminal transition. Both critics regress towards this detached target. The actor is updated less frequently than the critics, maximising \(Q_{\phi_1}(s,\mu_\theta(s))\). Target-network updates accompany the delayed actor updates. The Spinning Up algorithm description gives the complete update order.

MechanismWhat it changesLimitation
Twin criticsBootstrap with the smaller estimateBoth critics can share the same error
Delayed actorGive critics more updates between policy changesExtra updates cannot repair missing information
Target smoothingEvaluate a neighbourhood around the target action over repeated samplesToo much noise can blur useful distinctions

Worked example: optimism in one number

Take a nonterminal transition with reward \(r=1\), discount \(\gamma=0.9\), and target-critic predictions \(8\) and \(5\) at the same perturbed next action. Using the first critic alone would give

\[ y_{\text{single}}=1+0.9(8)=8.2. \]

TD3 instead uses

\[ y_{\text{twin}}=1+0.9\min(8,5)=5.5. \]

If the true next-action value were \(6\), the exact target would be \(6.4\). The twin target is pessimistic by \(0.9\), whereas the single target is optimistic by \(1.8\). This constructed example explains the tradeoff; it does not prove that the minimum is always closer to the truth.

Two critics produce one conservative bootstrap targetCritic predictions of eight and five feed a minimum operator. With reward one and discount 0.9, the target is 5.5. Q₁ = 8Q₂ = 5min = 51 + 0.9 × 5 = 5.5
The critics see the same target action. Their minimum changes the bootstrap value, not the observed reward.

Three kinds of smoothing that should stay distinct

Exploration noise perturbs actions executed in the environment. Target-policy noise perturbs actions used inside the learning target. Polyak averaging slowly moves target-network parameters towards current parameters. They operate on different objects and need separate settings.

For example, in an action space normalised to \([-1,1]\), a target actor output of \(0.95\) plus noise \(0.10\) becomes \(1.0\) after action clipping. That clipping is separate from limiting the sampled noise itself. Forgetting the outer clip can ask a critic to evaluate actions the actuator could never execute.

What a useful comparison measures

In a small control experiment, keep the environment, interaction budget, replay warm-up, and evaluation episodes fixed. Compare final returns across several seeds, but also record critic disagreement and the scale of executed actions. A high predicted value with flat real returns is a reason to inspect extrapolation, not evidence of progress.

Key Insight: Two critics provide a useful training mechanism, not a calibrated confidence interval. Agreement can mean that both networks learned the same mistaken extrapolation.

That limitation becomes central when new interaction is unavailable. Implicit Q-learning addresses the fixed-dataset setting; residual RL changes what a robot’s learned actor is asked to control.

References

  1. Fujimoto, S., van Hoof, H., & Meger, D. Addressing Function Approximation Error in Actor-Critic Methods. ICML 2018.
  2. OpenAI Spinning Up. Twin Delayed DDPG. Algorithm equations and pseudocode.