Actor-Critic — A2C and A3C
REINFORCE is noisy. Add a critic that learns V̂(s), subtract it from the return, and you get an advantage that has the same expectation but far lower variance. That is actor-critic. A2C runs it synchronously; A3C runs it across threads. Both are the mental model for every modern deep-RL method. Vanilla REINFORCE works, but its variance is terrible. Monte Carlo returns Gt can swing over a factor of 10 between episodes. Multiplying that noise by ∇ log π and averaging produces a gradient estimator that takes thousands of episodes to move the policy the same distance you could move it with far fewer DQN updates. The variance comes from using raw returns. If you subtract a baseline b(st) — any function of state, including a learned value — the expectation is unchanged and the variance drops. The best tractable baseline is V̂(st). Now the quantity multiplying ∇ log π is the advantage: A(s, a) = G - V̂(s) An action is good if it produced above-average return; bad if below. REINFORCE with a learned critic is actor-critic. The critic gives the actor a low-variance teacher. This is every deep-policy method after 2015 (A2C, A3C, PPO, SAC, IMPALA). Actor-critic: policy net plus value net, TD residual as advantage Two networks, one shared loss: Actor πθ(a | s): the policy. Sampled to…
Actor-Critic — A2C and A3C: REINFORCE is noisy. Add a critic that learns V̂(s), subtract it from the return, and you get an advantage that has the same…
This free lesson is part of the AI Engineering from Scratch curriculum. Read the full explanation, run the lesson code, and verify the result in the interactive reader or from the repository source.
Browse the complete course catalog or open this lesson on GitHub.