Knowledge base from "Spinning Up in Deep RL" by Joshua Achiam (OpenAI, MIT-licensed). Use when applying Achiam's frameworks for RL fundamentals and MDPs, the model-free algorithm taxonomy, policy gradient derivations, the six reference algorithms (VPG, TRPO, PPO, DDPG, TD3, SAC), debugging silently-failing RL code, or running rigorous multi-seed RL experiments.
69
85%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Author: Joshua Achiam (OpenAI) | Source: spinningup.readthedocs.io, MIT | Chapters: 20 | Generated: 2026-08-25
advantage function, target networks, entropy regularization;
I resolve it through the Topic Index and read that chapter filechNN — I load that chapter's summary/cs:spinning-up-deep-rl # core frameworks + chapter index
/cs:spinning-up-deep-rl entropy regularization # topic index -> ch19, read that chapter
/cs:spinning-up-deep-rl ch09 # one chapter summaryWhen you ask about something not in Core Frameworks, I read the relevant chapter file before answering rather than guessing from the index.
pi* = argmax_pi J(pi), where J(pi) = E_{tau~pi}[R(tau)]. Every algorithm approximates
this; where it substitutes a different objective (a Bellman residual, a surrogate), that
substitution is the source of its failure modes. Four value functions — V^pi, Q^pi, V*,
Q* — all obey Bellman self-consistency, and a*(s) = argmax_a Q*(s,a) is why Q-learning
is a viable family at all. Advantage A^pi(s,a) = Q^pi(s,a) - V^pi(s) is the relative-quality
signal policy gradients run on. (ch07)
Place any algorithm by asking: does it have or learn a model, and what does it learn (policy, Q-function, value function, model). That generates the whole landscape. (ch08)
Q_theta to satisfy a
self-consistency equation. Many failure modes, so less stable. But substantially more
sample efficient when it works, because it reuses everything.grad J = E[ sum_t grad log pi_theta(a_t|s_t) * Phi_t ]. Five valid choices of Phi_t:
full return, reward-to-go, reward-to-go minus a baseline, Q^pi, and A^pi. All share an
expectation and differ in variance. Two rules get you from the first to the last:
b(s) can be added or subtracted freely.
The standard choice is V^pi(s_t), learned by MSE regression onto reward-to-go. (ch09)Its data distribution depends on the parameters, and it does not measure performance even in expectation. Only at the current parameters, with data from those parameters, does it have the negative gradient of performance. You can send it to negative infinity while performance craters, and it usually will. Only average return means anything. (ch09)
It runs fine; the agent just never learns. Usually something is computed with the wrong
equation, on the wrong distribution, or piped to the wrong place. If it doesn't work, assume
there's a bug before touching hyperparameters. Debug by measuring everything and reading the
code critically. The archetype is one missing squeeze: a [N] vs [N,1] shape mismatch is
broadcast-compatible, raises nothing, and silently turns the Bellman backup into an [N,N]
matrix. (ch10, ch12)
Write your own implementations, shortest correct version of each, simplest algorithms first. VPG, DQN, A2C, PPO, DDPG, roughly in that order; ~250-300 lines each. Single-threaded before parallel. Iterate fast in simple environments — under 5 minutes turnaround at the debug stage. Do not attempt Atari or Humanoid before the toy task works. Read papers for their ablations and supplementary material, but do not overfit to paper details (the original DDPG's architecture, init scheme and batch norm are not strictly necessary) or to existing implementations (their abstractions serve reuse, not your single use case). (ch10)
VPG takes an unconstrained gradient step, so a single bad step can collapse performance. TRPO constrains the step in KL-divergence between policies, not distance in parameter space, then backtracking-line-searches until the exact constraint holds. PPO drops the constraint and instead clips the objective so the policy gains nothing by moving far, which is first-order, far simpler, and empirically at least as good. (ch14, ch15, ch16)
DDPG amortizes the intractable continuous max_a Q(s,a) into a learned policy:
max_a Q(s,a) ~= Q(s, mu(s)). It needs a replay buffer (licensed because the Bellman
equation is indifferent to how data was collected) and target networks (because the target
otherwise depends on the parameters being trained). Its failure mode is Q-value
overestimation, which the policy actively exploits. TD3 answers with clipped double-Q,
delayed policy updates and target policy smoothing. SAC adds entropy regularization,
making the explore-exploit trade-off an explicit coefficient alpha. (ch17, ch18, ch19)
| # | Title | Key Frameworks |
|---|---|---|
| ch01 | Introduction | The missing middle step, Code Design Philosophy |
| ch02 | Installation | Install-then-verify, MuJoCo optionality |
| ch03 | Algorithms: What's Included and Why | The two lineages, on/off-policy trade-off, code template |
| ch04 | Running Experiments | One flag per kwarg, ExperimentGrid, save-dir suffixes |
| ch05 | Experiment Outputs | Tools not files, watch-then-measure |
| ch06 | Plotting Results | Performance alias, prefix autocompletion, seed averaging |
| ch07 | Part 1: Key Concepts in RL | MDPs, four value functions, Bellman equations, advantage |
| ch08 | Part 2: Kinds of RL Algorithms | Taxonomy, model bias, policy-opt vs Q-learning |
| ch09 | Part 3: Intro to Policy Optimization | Log-derivative trick, EGLP lemma, reward-to-go, baselines |
| ch10 | Spinning Up as a Deep RL Researcher | Learn by doing, three idea frames, four rigor standards |
| ch11 | Key Papers in Deep RL | 13-section topic map |
| ch12 | Exercises | Problem Set 1 and 2, the silent DDPG bug |
| ch13 | Benchmarks | The parity disclosure, family-specific metrics |
| ch14 | Vanilla Policy Gradient | The six-step loop |
| ch15 | Trust Region Policy Optimization | KL trust region, line search, conjugate gradient |
| ch16 | Proximal Policy Optimization | PPO-Clip, KL early stopping |
| ch17 | Deep Deterministic Policy Gradient | MSBE, replay buffers, target networks, polyak |
| ch18 | Twin Delayed DDPG | Clipped double-Q, delayed updates, target smoothing |
| ch19 | Soft Actor-Critic | Entropy regularization, reparameterization, squashed Gaussian |
| ch20 | Logger, MPI Tools and Run Utils | EpochLogger pattern, MPI PyTorch order |
Covers the Spinning Up documentation only, as of the January 2020 PyTorch update. It does not cover: DQN and the discrete-action value-learning family (referenced, never implemented here), recurrent or convolutional architectures, partially-observed settings, model-based implementations, exploration/meta-RL/hierarchy beyond ch11's reading list, or any deep RL work after early 2020. The six implementations are educational; ch13 says which are research-grade. For topics beyond this source, I say so rather than improvising.
Compiled from OpenAI's Spinning Up in Deep RL documentation (MIT, Copyright (c) 2018 OpenAI), primarily developed by Joshua Achiam. Structured study notes, not a reproduction of the source.
19392f7
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.