Actor-critic methods (A2C)
Combine a policy (actor) with a learned value function (critic) for lower-variance policy gradients.
Animated explanation
The idea
REINFORCE waits until the end of an episode and judges each action by the noisy total return. Actor-critic methods add a second learner, the critic, that predicts how good states are. After every single step the critic computes the TD error: "that went better (or worse) than I expected". The actor uses that surprise to adjust its policy immediately.
So the actor does what policy gradients do (learns a stochastic policy directly) while the critic does what TD learning does (learns values by bootstrapping). The result learns online, with far lower variance than REINFORCE, and is the template for almost every modern deep RL algorithm: A2C, A3C, PPO, SAC, DDPG and TD3.
Advantage estimates
The actor's weight for an action should be its advantage: how much better it is than the policy's average in that state. The one-step TD error is a cheap, biased estimate of it; n-step returns or generalised advantage estimation (GAE) trade bias for variance with a parameter λ, just like TD(λ).
Making it work
Use separate or carefully balanced learning rates (the critic usually learns faster), an entropy bonus to keep exploring, normalised advantages, gradient clipping, and several parallel environments to decorrelate data (A2C). For continuous actions the actor outputs a Gaussian's mean and log-standard-deviation.
The algorithm, step by step
- 1Initialise actor θ and critic w.
- 2At state s: sample a ~ π_θ(·|s); observe r, s′, done.
- 3δ = r + γ(1 − done)V_w(s′) − V_w(s).
- 4Critic: w += α_w δ ∇V_w(s). Actor: θ += α_θ δ ∇log π_θ(a|s) (+ entropy bonus). Continue from s′.
The maths
TD error as advantage
Actor update
Critic update
Entropy-regularised objective
Strengths and weaknesses
Strengths
- Online, step-by-step learning
- Much lower variance than REINFORCE
- Handles continuous actions; basis of modern deep RL
Weaknesses
- Two learners to tune and balance
- Critic bias can mislead the actor
- On-policy versions remain sample-hungry
Reach for it when…
Check your understanding
Lambdian Lab
One-step actor-critic on the corridor
Tabular actor (softmax scores theta, N × 2) and critic (V, length N).
- td_error(V, s, r, s2, done, gamma).
- actor_critic(episodes, alpha_actor, alpha_critic, seed): one-step updates after every step (episodes capped at 200 steps); return (theta, V).
- The checks compare V with the true values of always going right.