Actor-Critic Methods
A2C, A3C, advantage function, GAE, async vs sync, bias-variance in advantage estimation
Return to the robotic arm. With REINFORCE, you collect a full episode before updating — the arm attempts the reach, you compute G_t at every step, and you update the policy. Two problems. First, you need complete episodes. Second, G_t at step t includes rewards from steps t+1 through the end of the episode — all caused by different actions, not the one at step t. The credit assignment is noisy. Variance is high.
Actor-critic solves both. Maintain two networks simultaneously. The actor π_θ(a|s) selects actions — the policy. The critic V_φ(s) estimates the state value — how much total reward to expect from here under the current policy. After each step, update the critic using TD: the critic learns V(s_t) ≈ R + γV(s_{t+1}). Then compute the advantage A(s_t, a_t) = R + γV(s_{t+1}) - V(s_t) — how much better than expected was this particular step? Update the actor proportionally. You get updates every step, not every episode.
The advantage has a key property: E_{a~π}[A(s, a)] = 0. It is zero-mean across actions. This means it carries only relative information — this action was above average, that one was below. Unlike raw Q(s, a), which can be large and positive for all actions in a highly valuable state, the advantage removes the state's baseline value and isolates the signal about action quality. This is what makes actor-critic gradient estimates so much lower variance than REINFORCE.
Generalized Advantage Estimation (GAE) extends this. Instead of the one-step advantage R + γV(s') - V(s), GAE accumulates a weighted average of n-step advantages: Â^GAE = δ_t + γλδ_{t+1} + (γλ)²δ_{t+2} + ... where δ_t = R_{t+1} + γV(s_{t+1}) - V(s_t). λ = 0 gives the one-step TD error — low variance, high bias. λ = 1 gives the full Monte Carlo advantage — no bias, high variance. λ = 0.95 is the standard for most tasks. PPO, TRPO, and most modern on-policy actor-critics use GAE.
NOT this: the actor and critic have separate learning problems that can interfere with each other. The two networks are cooperative, not adversarial — the critic provides variance-reducing signal to the actor, and the actor's improving policy makes the critic's targets more stable. The instability risk is that a slow or inaccurate critic injects biased gradient into the actor. Mitigate by setting critic learning rate 3–10× higher than actor learning rate, so the critic leads.
Key points
- Use actor-critic over pure policy gradients for any task with episodes longer than about 50 steps. Per-step TD updates in actor-critic dramatically reduce gradient variance compared to full-trajectory REINFORCE. The actor-critic wall-clock speedup is typically 10–100× on continuous control tasks because you do not wait for episode completion.
- Set critic learning rate 3–10× higher than actor learning rate. The critic must converge to a stable estimate before the actor can use it meaningfully. If critic and actor learn at the same speed, the actor is chasing a moving value target — equivalent to applying noisy baselines that can increase gradient variance rather than reduce it.
- If actor loss improves but critic loss plateaus at a high value, the reward magnitude is too large for the critic to track. Normalize rewards to approximately [-1, 1] or clip them, then recheck critic convergence. A critic that cannot model the value function correctly injects biased advantage estimates into the actor gradient, which explains why actor performance degrades even as actor loss decreases.
Actor-critic gives you per-step policy updates by replacing the noisy full-episode return with a TD advantage estimate — the actor learns from how much better each action was than the critic expected, not from the absolute return.
Recap
- Two networks: actor $\pi_\theta(a|s)$ picks actions, critic $V_\phi(s)$ estimates state value.
- Per-step TD updates replace REINFORCE's noisy full-episode return.
- Advantage $A(s_t,a_t) = R + \gamma V(s_{t+1}) - V(s_t)$ — how much better than expected this step was.
- $E_{a\sim\pi}[A]=0$: zero-mean signal removes the state baseline, isolating action quality — lower variance than raw $Q$.
- GAE blends n-step advantages: λ=0 one-step (low var/high bias), λ=1 MC, 0.95 is the default.
- Set critic LR 3–10× the actor LR so the critic leads and the actor isn't chasing a moving target.
- Actor down, critic plateaus high = reward magnitude too large; normalize rewards to ~$[-1,1]$.
Check your understanding
Q1. Which two statements about the advantage function A^π(s,a) = Q^π(s,a) - V^π(s) are correct, and explain why it beats raw Q(s,a) as a policy-gradient weight?
- A) E_{a~π}[A^π(s,a)] = E_{a~π}[Q^π(s,a)] - V^π(s) = 0, since V^π(s) = E_{a~π}[Q^π(s,a)] by definition — the advantage is exactly zero-mean over actions
- B) The zero-mean property removes the large state-dependent constant that raw Q(s,a) carries, leaving only a lower-variance directional signal about whether each action was above or below average
- C) E_{a~π}[A^π(s,a)] = 0 only holds once the policy has reached a Nash equilibrium; during ordinary training the advantage has non-zero mean, which is exactly why it still provides useful gradient signal
- D) The advantage has zero mean specifically because it subtracts the average environment reward per episode; Q(s,a) is the better gradient weight in sparse-reward states because it retains the return's raw magnitude
Q2. In GAE, what does setting λ=0 vs λ=0.95 vs λ=1 do to the advantage estimate? When would you choose each?
- A) λ=0 uses only the immediate reward with no bootstrapping at all, giving unbiased but extremely high-variance estimates; λ=1 instead uses the full critic value with pure bootstrapping, giving low-variance but high-bias estimates; λ=0.95 sits at a middle ground; choose λ=0 when episodes are very short and λ=1 only once the critic is well-trained
- B) λ in GAE actually controls the learning-rate schedule for the critic network rather than the advantage estimate itself; λ=0 means the critic updates once per full episode and λ=1 means it updates every step; λ=0.95 is the standard value balancing update frequency against stability
- C) λ=0 produces advantage estimates numerically identical to Monte Carlo returns; λ=1 instead uses only the one-step TD error; λ=0.95 behaves as an exponential moving average applied directly to the raw reward signal; practitioners generally choose λ=0 for sparse-reward environments
- D) λ=0 is the one-step TD error δ_t (high bias, low variance); λ=0.95 blends ~20 future steps (the empirical default, e.g. PPO); λ=1 is the full MC advantage (zero bias, high variance) — pick λ=0 when the critic is accurate, λ=1 for short episodes
Q3. You are training an actor-critic agent and notice that the actor loss keeps decreasing but the critic loss oscillates and never converges. The agent's reward also oscillates. What is happening?
- A) Decreasing actor loss alongside an oscillating critic loss is entirely normal during the early phase of training; the actor is designed to converge faster than the critic by construction, so simply continue training unmodified until the critic naturally stabilises after roughly ten times as many gradient steps
- B) The actor and critic destabilise each other: the actor updates faster than the critic can track, so noisy advantage estimates inject bad gradient into the actor, shifting the policy further in a feedback loop; fix by lowering the actor LR or adding PPO-style clipping
- C) The oscillating critic is caused specifically by the replay buffer containing far too many transitions collected under an old, stale policy; empty the entire buffer and restart training using only fresh on-policy data generated by the current policy
- D) The oscillating critic loss indicates that the reward model itself is non-stationary; this is purely an environment-side data distribution shift problem rather than an algorithmic one, and the only available fix is collecting a larger and more diverse set of training trajectories
Try it interactively
ML Systems Lab is a free interview-prep platform for ML engineers — work through the full interactive module, quizzes, and drills.
Open ML Systems Lab →