Unit 4 of 12 · about 5 hours · derive, implement
Continuous actions, deterministic policy gradients, DDPG and TD3
Robot joints and steering take continuous values where DQN-style argmax is impossible. DDPG learns an approximate maximizer, and TD3 fixes the overestimation that otherwise feeds on itself.
You'll be able to
- Derive the deterministic policy gradient as a chain of policy Jacobian and critic action-gradient.
- Explain the TD3 target with twin-critic min, delayed actor updates and smoothed target actions.
- Implement a DDPG-style update with replay and soft targets, then ablate the twin-critic min on a small continuous task.
Covers
Read
In this order, only the parts listed
0 of 3 done
- Hands-on Modern RL 9.1: deterministic policy gradients and DDPGHands-on Modern RL - DDPG, TD3, SAC and Intrinsic Motivation
Sections The Fundamental Difficulty of Continuous Actions through DDPG: argmax by enumeration fails for continuous actions, the DPG chain-rule form, DDPG actor, critic, replay and soft target updates with and Gaussian exploration noise, and Three Weaknesses of DDPG (page read 2026-10-14)
Vocabulary and code sketch only. The displayed DDPG target equation drops the terminal mask (the page's code sketch keeps
(1 - dones)); take the mask from the TD3 paper target and always multiply the bootstrap by not-terminated. - Hands-on Modern RL 9.2 TD3 part: twin critics, delay and smoothingHands-on Modern RL - DDPG, TD3, SAC and Intrinsic Motivation
Section Stability Improvements for DDPG: twin Q-networks with the min target, delayed actor and target updates every d = 2 steps, and target smoothing noise 0.2 clipped to 0.5 (page read 2026-10-14)
Use the paper for exact equations. The HalfCheetah curves and score claims on this page are author-reported; do not use them as targets.
- TD3: clipped double Q, delayed updates and target smoothingAddressing Function Approximation Error in Actor-Critic Methods (TD3)
arXiv:1802.09477v3 Sections 4 to 5: overestimation measurement with Figure 2, clipped double Q target Equation 10 as the min of two critics, delayed policy updates in Section 5.2 and target smoothing in Section 5.3; Section 6.2 ablation of the three parts
Focus on
- Continuous argmax is the whole problem: DQN enumerates actions, so a seven-joint torque vector needs a learned maximizer instead.
- The DPG form needs states only, no action average, which is why DDPG can learn off-policy from a noisy behavior policy.
- TD3 takes with the smoothed target action: the min trades overestimation for underestimation, which the policy does not propagate.
- Delay and smoothing serve the critic: the actor waits critic steps before following its gradients, and noise around the target action smooths sharp critic bumps.
Common mistakes · 3
- Dropping the terminal mask because a paper equation shows none. Paper targets abbreviate; your code multiplies the bootstrap by with the terminated flag, and truncation still bootstraps.
- Reading the min as unbiased. Clipped double Q underestimates by design; underestimated actions are simply not followed, while overestimated ones would be chased.
- Keeping Ornstein-Uhlenbeck noise because the DDPG paper used it. Later work finds plain Gaussian noise works at least as well on common benchmarks; tune the scale instead of the process.
Try it yourself
Closed-book, before checking anything
Quiz yourself
Answer first, then mark it. Missed ones go to Review.
0 got · 0 missed
1.Why can DQN not act in a continuous torque space without modification?Answer
Its decision rule needs argmax over actions. Enumeration works for two buttons and fails for infinitely many torque vectors, so it needs an approximate maximizer such as an actor or stochastic optimization.
2.Next-critic values are 10 and 12 with reward 1 and and no termination. What is the TD3 target?Answer
10.9. The min picks 10, giving 1 + 0.99 times 10.
3.What breaks if the actor updates every critic step instead of with delay?Answer
The actor follows an inaccurate critic early, collects worse data, and the coupled error grows. Delay gives the critic more updates before its gradients steer the actor.
4.A run reports high Q values but poor returns. Which TD3 mechanism addresses this and how do you confirm it?Answer
Clipped double Q. Compare single versus clipped-double runs on matched seeds and check whether the min lowers the value estimates while returns hold or improve.
Practice
- Berkeley CS 285 HW3: clipped double-Q ablation on Hopper-v4
HW3 Section 3.6, Stabilizing Target Values, with
experiments/sac/hopper_singleq.yamlversushopper_clipq.yaml; handout https://rail.eecs.berkeley.edu/deeprlcourse/static/homeworks/hw3.pdfPort the repo to Gymnasium with terminated and truncated handling or pin
numpy<2in its own environment, and turn off its forced WandB logging. Each Hopper config runs 500000 environment steps, which the handout counts as cheap enough to run locally on your GPU; report both configs with matched seeds.
You're done when
You derive the DPG chain rule, compute the TD3 target by hand, and defend the min, delay and smoothing choices from matched single-versus-clipped runs.
Only when you can do this without notes.
Leads to
Notes
Resources · 2 for this unit, 12 more in the section
- Addressing Function Approximation Error in Actor-Critic Methods (TD3)Fujimoto, van Hoof and Meger (ICML 2018) · required
Read the overestimation analysis for actor-critic methods, clipped double Q-learning, delayed policy updates and target policy smoothing. Ablate one of the three changes on a small continuous task with matched seeds.
- Hands-on Modern RL - DDPG, TD3, SAC and Intrinsic MotivationWalking Labs · support
Use the DDPG and TD3 and SAC pages for vocabulary and the intrinsic-motivation page for concepts only. Its displayed TD3 target omits the terminal mask (the code has it), its SAC chart is author-reported, and its multi-agent demo does not learn; do not use those as practice. Pin commit 9231bab of walkinglabs/hands-on-modern-rl; its
code/chapterNNfolders do not follow the site chapter numbers.
Also in this section
- Berkeley CS 185/285 Deep Reinforcement Learning (Spring 2026) - Exploration and Off-Policy Actor-CriticUC Berkeley · primary
Slides are public at https://rail.eecs.berkeley.edu/deeprlcourse/static/slides/lec-N.pdf; current videos are not, and the public Fall 2023 playlist numbers lectures differently. Study Lecture 19 (exploration) and Lecture 23 (advanced exploration), and the SAC part of Homework 3 (
src/agents/sac_agent.pyon InvertedPendulum and Hopper; HalfCheetah needs hours on a GPU). The homework pinsgym==0.25.2, which fails on NumPy 2, so port it to Gymnasium (terminatedandtruncated) or pinnumpy<2in its own environment, and turn off its forced WandB logging. - Stanford CS234 Winter 2026 - Bandits and ExplorationStanford University · required
Study Lectures 9 to 12 (bandits, optimism and upper confidence bounds, exploration in MDPs). Rebuild one exploration comparison with matched information, interaction, update and tuning budgets.
- Stanford CS224R Spring 2026 - Off-Policy and Goal-Conditioned RLStanford University · required
Study Lecture 05 (off-policy actor-critic) and Lecture 12 (multi-task and goal-conditioned RL) and their DDPG and HER readings. Implement one goal relabeling test on a small task.
- Soft Actor-Critic Algorithms and ApplicationsBerkeley AI Research · required
Read the maximum-entropy objective, the soft policy iteration and the actor and critic targets, then the automatic temperature adjustment (this version adds it; the first SAC paper used a fixed temperature). Implement or audit a compact SAC path and compare sample efficiency and wall time with PPO under a matched protocol.
- Hindsight Experience ReplayAndrychowicz et al. (NeurIPS 2017) · required
Read the goal-conditioned setup and the relabeling strategies (final, future, episode). Implement relabeling on a sparse-reward bit-flipping or goal task and test that relabeled transitions carry the substituted goal and its recomputed reward.
- Exploration by Random Network DistillationBurda et al. (ICLR 2019) · support
Read the prediction-error bonus, the separate intrinsic and extrinsic value heads and the non-episodic intrinsic return. Use it to explain why a novelty bonus depends on the representation and how it can reward noise.
- Unifying Count-Based Exploration and Intrinsic MotivationBellemare et al. (NeurIPS 2016) · support
Read the pseudocount derivation from a density model and the exploration bonus built on it. Compare a tabular count bonus with its pseudocount form on a small grid.
- Deep Reinforcement Learning at the Edge of the Statistical PrecipiceDeepMind and Google Research · required
Study the failure of common point estimates and small-seed comparisons. Report interval estimates, aggregate-score sensitivity and performance profiles with the underlying per-run data retained.
- What Matters in On-Policy Reinforcement Learning? A Large-Scale Empirical StudyAndrychowicz et al. (2020) · support
Read the experimental protocol and the recommendations on normalization, initialization and hyperparameter sensitivity. Use it to set a tuning budget that is the same for every method you compare.
- rliableGoogle Research · support
Use the official repository to compute interquartile means, stratified bootstrap intervals and performance profiles for the track experiments. Verify the input run and task axes and keep plots reproducible from raw run records; check the pandas version it needs in your environment.
- Gymnasium documentation: API, time limits, vector envs and wrappersFarama Foundation · reference
Use the Env API page for the reset and step contract, the handling-time-limits tutorial for termination versus truncation bootstrapping, the vector env pages for SyncVectorEnv and AsyncVectorEnv autoreset modes, and the wrappers table for RecordEpisodeStatistics, ClipAction, NormalizeObservation and TimeLimit.
- Stable-Baselines3 RL Tips and TricksStable-Baselines3 · reference
Use How to evaluate an RL algorithm for separate test envs, EvalCallback and deterministic eval; Which algorithm should I use for the discrete/continuous/goal picker and HER pointer; the custom-environment section for Markov, normalization and TimeLimit handling; and the seed-variance and RL-zoo tuning advice. Treat SOTA and speedup claims as pointers, not targets.