Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Turning a dial instead of pressing a button
Many control problems are about how much, not which: how hard to brake, how much to turn a joint. An agent for these problems has a critic that estimates how good any amount would be, and an actor that keeps nudging its choice in the direction the critic says is uphill. The risk is that the actor is very good at finding the spots where the critic is too optimistic, so careful methods keep the critic’s optimism in check.
SAC and TD3 are standard baselines for robot learning in simulation, and SAC has trained walking and manipulation skills directly on real robots.
- 1. Continuous actions mean choosing…
- 2. The actor moves its choice…
- 3. The danger is that the actor finds…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.By hand
- Deterministic policy gradient (Silver et al. 2014): for a deterministic actor a = μ_θ(s), ∇J(θ) = E_s[∇_θ μ_θ(s) ∇_a Q(s, a) evaluated at a = μ_θ(s)].
- DDPG (Lillicrap et al. 2016): DPG with neural actor and critic, a replay buffer, target networks updated by Polyak averaging θ′ ← (1 − τ)θ′ + τθ, and Gaussian or Ornstein–Uhlenbeck exploration noise.
- TD3 (Fujimoto et al. 2018): clipped double-Q targets y = r + γ min(Q₁′, Q₂′)(s′, ã′); target policy smoothing ã′ = μ′(s′) + clipped noise; the actor and targets updated every second critic step.
- SAC (Haarnoja et al. 2018): a stochastic policy, trained to maximise reward plus α times its entropy; soft targets y = r + γ(min Q′(s′, a′) − α log π(a′|s′)) with a′ ~ π; actor trained by reparameterisation a = μ(s) + σ(s)ε.
- Overestimation: an actor that maximises an approximate critic tends to sit where the critic’s errors are positive, and bootstrapping passes that optimism back through the targets.
- 1. DDPG's actor follows…
- 2. TD3's target uses…
- 3. SAC adds to the reward…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.DDPG against the LQR optimum
Exercise 1.
- A double integrator: position x, velocity v, force u clipped to ±3; reward −(x² + 0.1v² + 0.1u²); γ = 0.98; noise 0.05 on the velocity; 50-step episodes (time limits, not terminal states).
- Discounted LQR by Riccati iteration gives the optimal controller u = −2.532x − 2.463v.
- DDPG: linear actor u = k·(x, v) + k₀; critic linear in the 10 quadratic features of (x, v, u), which represent the exact Q of any linear controller; replay buffer; minibatches of 64; Adam (critic 0.03, actor 0.001); Polyak τ = 0.01; exploration noise 0.3.
Practice.
- Start from SAC or TD3, not plain DDPG: both are far less sensitive to hyperparameters.
- Let the critic lead: update it at least as often as the actor, with a larger step size (two time scales).
- Scale actions to [−1, 1] and squash with tanh (SAC) or clip (TD3).
- Tune SAC’s temperature automatically toward a target entropy, typically minus the number of action dimensions.
- Watch the critic: compare its estimates with Monte Carlo returns of the current policy; growing optimism is an early warning.
- Tools: Stable-Baselines3 (DDPG, TD3, SAC), CleanRL, and MuJoCo or Isaac environments (topic L8-3).
# one critic step and one actor step for DDPG (per learner)
an = clip(mu_target(N)) # next action from the target actor
y = r + gamma * Q_target(N, an) # bootstrapped target
W += adam(mean((y - Q(S, A)) * psi(S, A))) # move the critic toward y
g = dQ_da(W, S, mu(S)) # critic slope at the actor's action
K += adam(mean(g * [x, v, 1])) # chain rule: ∇θ μ · ∂Q/∂a- 1. A common target entropy for SAC is…
- 2. The critic should usually…
- 3. A warning sign of overestimation is…
Level 3: Advanced
★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.Theory
Deterministic policy gradient. J(θ) = E_s[Q(s, μ_θ(s))] under the state distribution. Holding the distribution fixed, the chain rule gives ∇_θ Q(s, μ_θ(s)) = ∇_θ μ_θ(s)·∇_a Q(s, a) at a = μ_θ(s). Silver et al. showed the state-distribution terms vanish as in the stochastic theorem, and that DPG is the limit of the stochastic policy gradient as the policy’s variance goes to zero.
Why maximising creates optimism. For any noisy estimates Q̂(a) = Q(a) + ε(a) with E[ε] = 0, E[max_a Q̂(a)] ≥ max_a E[Q̂(a)] = max_a Q(a) (Jensen). An actor that climbs Q̂ is a continuous version of the max; its own Q̂(s, μ(s)) is biased upward, and the bootstrapped target r + γQ̂(s′, μ(s′)) passes the bias on.
Clipped double Q. For two estimates, min(X₁, X₂) ≤ X₁, so E[min] ≤ E[X₁]: the target is pessimistic. With independent errors the upward bias of one critic’s maximum is largely cancelled (Practice problem 4).
Maximum-entropy policies. If Q(s, a) = c − H(a − a*)², the Gaussian policy that maximises E[Q] + α·entropy has mean a* and variance α/(2H): the entropy bonus widens the policy where Q is flat and narrows it where Q is sharply peaked. In a linear–quadratic problem the mean of the max-entropy policy is exactly the LQR controller.
- 1. DPG is the limit of the stochastic policy gradient as…
- 2. E[max of noisy estimates] is…
- 3. The max-entropy Gaussian's variance is…
Level 4: Expert
★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.On a problem with a known optimum, how close do DDPG, TD3 and SAC get, and how accurate are their critics about the policies they produce?
History.
- D. Silver, G. Lever, N. Heess, T. Degris, D. Wierstra and M. Riedmiller (2014) introduced the deterministic policy gradient.
- T. Lillicrap and colleagues (2016) introduced DDPG.
- S. Fujimoto, H. van Hoof and D. Meger (2018) introduced TD3, after showing that DDPG overestimates.
- T. Haarnoja, A. Zhou, P. Abbeel and S. Levine (2018) introduced soft actor-critic, building on maximum-entropy reinforcement learning (B. Ziebart, 2008).
Exercise 2.
- The double integrator of Exercise 1; three learners each of DDPG, TD3 and SAC (α = 0.05), 10,000 steps, all trained at once with the same critic and actor step sizes.
- A control: three DDPG critics trained the same way but evaluating the fixed LQR controller (no actor learning).
- Measured: the cost of each learned controller relative to LQR, from 200 random starts; the learned gains; the critic’s value at (x, v) = (0.5, 0) and the policy’s action, minus the policy’s true value there (Monte Carlo, 200 rollouts of 300 steps); SAC’s learned standard deviation.
Seed 0 (LQR gains 2.532, 2.463):
| algorithm | cost / LQR cost | learned gains (position, velocity) | critic estimate − true value |
|---|---|---|---|
| DDPG | 1.077, 1.022, 1.094 | (2.73, 2.39), (2.98, 2.28), (2.96, 2.63) | +4.05, +0.72, +1.47 |
| TD3 | 1.014, 0.997, 1.016 | (2.65, 2.23), (3.04, 2.88), (3.18, 2.98) | +0.64, +5.13, +4.40 |
| SAC | 1.261, 1.066, 1.043 | (3.12, 1.90), (3.20, 2.32), (2.56, 2.67) | +7.34, +1.55, +1.03 |
| critic of the fixed LQR controller | — | — | −0.27, −0.21, −0.16 |
- All three learned near-optimal controllers: across three seeds, the 27 learners cost between 0.997 and 1.281 times the LQR cost (a ratio just below 1 is sampling noise). The worst learner was DDPG (1.281), then SAC (1.261), then TD3 (1.110).
- Every critic of a learned actor was optimistic about its own policy: all 27 estimates were too high, by 0.64 to 18.78. The same critics evaluating the fixed LQR controller were accurate to within 0.32 (and slightly pessimistic) on all three seeds. The optimism comes from the actor, not from the critic’s features.
- Twin critics reduced the worst cases, not the typical one: the largest errors were 18.78 for DDPG, 9.03 for SAC and 5.85 for TD3, but the medians were similar: 4.57 (DDPG), 3.19 (TD3) and 3.67 (SAC). On this small problem the minimum of two critics did not remove the optimism.
- SAC’s learned standard deviation was 0.31 to 0.51 (8 of 9 below the maximum-entropy optimum 0.441), and its mean gains were close to LQR, as theory predicts for a linear–quadratic problem.
- Exercise 1: three DDPG learners cost 1.172, 1.064 and 1.791 times the LQR cost; one settled on a position gain of 4.98 instead of 2.53.
- Seeds 1 and 2: cost ratios DDPG 1.163, 1.006, 1.171 and 1.039, 1.281, 1.033; TD3 1.011, 1.079, 1.110 and 1.099, 1.074, 1.081; SAC 1.154, 1.037, 1.015 and 1.093, 1.090, 1.023. Fixed-controller critic errors −0.32, −0.24, −0.20 and −0.28, −0.23, −0.11.
Continuous control in practice
- Neural networks: the same algorithms with multilayer actors and critics learn locomotion and manipulation in MuJoCo and Isaac (topics L7 and L8).
- Model-based alternatives: with a known or learned model, LQR, iLQR and MPC (topic L6) often beat model-free learning on sample efficiency.
- Offline RL: TD3+BC and CQL adapt these actor-critics to fixed datasets (topic L5-2).
- Real robots: SAC’s sample efficiency and automatic temperature tuning made learning directly on hardware practical.
References
- D. Silver, G. Lever, N. Heess, T. Degris, D. Wierstra and M. Riedmiller (2014). “Deterministic policy gradient algorithms.” ICML.
- T. P. Lillicrap, J. J. Hunt, A. Pritzel, N. Heess, T. Erez, Y. Tassa, D. Silver and D. Wierstra (2016). “Continuous control with deep reinforcement learning.” ICLR.
- S. Fujimoto, H. van Hoof and D. Meger (2018). “Addressing function approximation error in actor-critic methods.” ICML.
- T. Haarnoja, A. Zhou, P. Abbeel and S. Levine (2018). “Soft actor-critic: off-policy maximum entropy deep reinforcement learning with a stochastic actor.” ICML.
- T. Haarnoja and colleagues (2018). “Soft actor-critic algorithms and applications.” arXiv:1812.05905.