Exercises — Actor-critic methods
Recurring symbols, in one place:
Level 1 — Recognition
L1.1
In the update , which network is being trained, and which single quantity plays the role of the advantage estimate?
Recall Solution
The actor (policy ) is being trained — its parameters change, stepped by the actor learning rate . The quantity acting as the advantage estimate is the ==TD error ==. It is a one-sample stand-in for : positive pushes the action's probability up, negative pushes it down.
L1.2
Match each name to its formula: (a) TD error, (b) advantage, (c) critic update target. Formulas: (i) , (ii) , (iii) .
Recall Solution
- (a) TD error (iii) .
- (b) advantage (i) .
- (c) critic target (ii) — the fixed number the critic tries to match with .
L1.3
True or false: REINFORCE (see REINFORCE) must wait until the episode ends before it can update, but actor-critic can update after every single step. Explain in one sentence why.
Recall Solution
True. REINFORCE needs the full Monte-Carlo return (defined in the Symbol reminder: the discounted sum of all future rewards), which requires the whole trajectory; actor-critic replaces with the bootstrapped , which is available immediately after one step (the Temporal Difference Learning trick).
Level 2 — Application
Refer to Figure s01 while solving L2.1 and L2.2 — it plots both values as bars and shows which way the action probability moves.

L2.1
Critic says . You act, receive , land in with , and . Compute and state whether the action becomes more or less likely.
Recall Solution
⇒ the transition beat expectation ⇒ actor increases , making more likely (green bar in Figure s01). The critic also nudges upward (it under-predicted).
L2.2
A "trap" reward. , , , . Compute . Despite positive reward, is the action encouraged?
Recall Solution
⇒ discouraged (red bar in Figure s01). Positive reward is not enough: we expected value but the realized estimate is only . Advantage compares against expectation, not against zero.
L2.3
Terminal transition. At the last step, is terminal so by convention. Given , , , compute .
Recall Solution
At a terminal state there is no future, so the bootstrap term vanishes. Here the episode ended worse than the critic's optimistic , so .
L2.4
Two-step advantage. From : , ; from : , ; , . Compute the two one-step TD errors .
Recall Solution
A means the critic predicted perfectly (no surprise there); the surprise all lives at step 1.
Level 3 — Analysis
L3.1
Explain, using Step 1 of the parent derivation, why subtracting the baseline does not bias the gradient. What term does it cancel, and why does that lower variance?
Recall Solution
Recap of Step 1 (self-contained). For any function that depends only on the state (not the action), its expected contribution to the policy gradient is exactly zero: The key move is that probabilities sum to , so their gradient sums to . Because this contribution is zero in expectation, subtracting leaves the expected gradient unchanged ⇒ unbiased. Setting (the true value) removes the "how valuable is this state at all" offset shared by every action, leaving only the action-specific part . Since the removed offset was a big, action-independent number multiplying a noisy score, cutting it shrinks the variance of the estimator. See Advantage function.
L3.2
Two critics estimate the same true value . Critic A returns ; Critic B returns . The true one-step target is . Compute each critic's and explain which actor gets a misleading sign and why an inaccurate critic is dangerous.
Recall Solution
- Critic A: ⇒ correctly says "better than average," encourages the action.
- Critic B: ⇒ wrongly discourages a genuinely good action, because B massively over-predicted relative to the true . A biased critic flips the sign of the advantage, so the actor learns in the wrong direction. This is exactly why the critic should be trained reliably (and often faster) before the actor trusts it.
L3.3
Why should the critic learning rate usually satisfy (the two-timescale idea)? What breaks if the actor moves faster than the critic?
Recall Solution
Recall is the critic's step size and the actor's. The actor's gradient is scaled by , which is only meaningful if is a decent estimate. If the actor changes the policy faster than the critic can track its value, the critic is always chasing an outdated policy, so the advantages it feeds the actor are stale/garbage — the actor optimizes noise. Making the critic faster () keeps the value estimate roughly correct for the current policy, giving the actor trustworthy gradients.
Level 4 — Synthesis
Refer to Figure s02 for L4.1 and L4.2 — it shows how the dial trades bias against variance.

L4.1 — Generalized Advantage Estimation
GAE blends TD errors: Given , , and all later , with , , compute .
Recall Solution
With , the weight on is : trades bias against variance (Figure s02): recovers the pure one-step (low variance, more bias); recovers the full Monte-Carlo advantage (unbiased, high variance).
L4.2 — Two limits of GAE
Using the same formula, show that gives (one-step) and (with ) gives , which telescopes to .
Recall Solution
- : every term with carries factor , leaving only : .
- : weights all , so . The terms telescope: . That is exactly the Monte-Carlo advantage — the return (total discounted future reward) minus the baseline, i.e. the REINFORCE signal with a baseline.
L4.3 — Softmax actor gradient
Two actions with logits , . The policy is , i.e. . Compute . We take with . Derive the gradient of with respect to each logit, then give the sign and magnitude of the update (scaled by ).
Recall Solution
Derivation (the WHY). Write . Differentiate with respect to a logit : where is if and otherwise. The second term comes from the chain rule on the log-sum-exp normaliser, and it is exactly . Intuition: the chosen action's logit gets a "raise," and every logit (including the chosen one) gets pulled down by its own current probability — a competition where more-probable actions are pulled harder. So for the chosen action : ; for the other : .
Numbers. Softmax: , . Update on logit : (raise the chosen action's logit). Update on logit : (lower the other). The magnitude of the whole move is set by : a bigger surprise moves the logits more.
Level 5 — Mastery
L5.1 — Degenerate case:
Set . Write in this case and interpret: what has actor-critic collapsed into? What is the actor now optimizing?
Recall Solution
With : . The bootstrap disappears; the critic just learns the mean immediate reward , and the advantage is "did this action beat the average immediate reward in this state?" The actor becomes a myopic, one-step (contextual-bandit) optimizer — it ignores all long-term consequences.
L5.2 — Why stop-gradient on the target (prove the trap is real)
The critic minimizes with . (a) Give the semi-gradient update (target fixed). (b) Give the full-gradient term you'd wrongly add if you differentiated the target too. Explain why (a) is what the derivation licenses.
Recall Solution
- (a) Semi-gradient: treat as a constant target, so , giving — exactly the parent's rule.
- (b) Full gradient would also differentiate the target: it adds . This term makes the critic chase a moving target it is itself creating, which empirically destabilizes learning and is not the TD fixed-point being solved. The advantage estimate we derived (Step 3) treats as the sampled value of , i.e. a fixed number — so semi-gradient is the mathematically consistent choice.
L5.3 — Design a variance sanity-check
You suspect your advantages are too noisy. Given a batch of TD errors , compute the batch mean and the (population) variance. Then argue what a healthy actor-critic batch mean of advantages should be near, and why.
Recall Solution
Mean . Deviations from mean: ; squares , sum ; variance . A healthy batch of advantages should have mean , because is defined relative to the average — over the actions actually taken, the mean advantage is near zero (better-than-average and worse-than-average cancel). This is exactly why practitioners often normalize advantages: subtract the batch mean and divide by the batch standard deviation before the actor update. Here that means dividing the centred values by , which keeps the step sizes well-scaled and stable without changing the direction of improvement.
L5.4 — A3C vs A2C (see A3C and A2C)
State one precise difference in plumbing (not math) between A3C and A2C, and confirm the underlying advantage/policy-gradient math is identical.
Recall Solution
A3C (Asynchronous Advantage Actor-Critic) runs many workers asynchronously: each worker holds its own copy of the parameters, plays its own rollout, computes gradients locally, and pushes them to a shared parameter server whenever it finishes, then pulls the latest parameters back. Because workers update at different, uncoordinated times, no two workers are guaranteed to be on the same parameter version — updates are "lock-free" and slightly stale.
A2C (Advantage Actor-Critic) is the synchronous version: a central controller waits for all workers to finish their rollouts, concatenates their transitions into one big batch, computes the averaged advantages/gradients, and applies a single update. Every worker then starts the next rollout from the same fresh parameters.
So the plumbing difference is asynchronous, per-worker, staggered updates (A3C) versus synchronous, batched, single-update steps (A2C). The underlying math is identical in both: each worker uses the actor step , the critic step minimizing , and the advantage . Only when and how gradients are combined and applied differs — not the estimator itself.
Recall
Recall One line: why does the same
train both networks? is simultaneously the critic's prediction error (minimize ) and a one-sample advantage estimate scaling the actor's .
Which formula recovers the Monte-Carlo advantage from GAE?
What is when ?
Connections
- Actor-critic methods — parent note these exercises drill.
- Advantage function · Temporal Difference Learning · Policy Gradient Theorem — the pieces every problem uses.
- Generalized Advantage Estimation (GAE) · Proximal Policy Optimization (PPO) · A3C and A2C — where L4/L5 point next.