For continuous actions, replace the sum by an integral.
The baseline changes variance, not the expected gradient.
A baseline is not always a critic
With
AtMC=Gt−Vϕ(st),
the value function is only a baseline. Even if Vϕ is inaccurate, the actor gradient remains unbiased because the return estimate is still Monte Carlo.
With
At(1)=rt+γVϕ(st+1)−Vϕ(st),
the learned value appears inside the return estimate. It is now a bootstrapped critic, and its approximation error can bias the actor update.
The −e(s) term is state-only and behaves like a baseline. The next-state error can depend on the chosen action through the transition distribution, so it is the main source of critic-induced bias.
Learning the Critic
A critic can learn from Monte Carlo returns or from bootstrapped temporal-difference targets.
Monte Carlo regression
The target is the complete sampled return:
ytMC=Gt.
We minimize
LMC(ϕ)=21E[(Vϕ(st)−Gt)2].
Function approximation averages different returns observed from similar states. This target does not bootstrap, but it has high variance and may not be available until the trajectory ends.
One-step TD regression
The Bellman equation suggests
yt(1)=rt+γ(1−dt)Vϕ(st+1),
where dt=1 for a true terminal transition. Define the TD residual
δt=rt+γ(1−dt)Vϕ(st+1)−Vϕ(st).
The critic loss is
LV(ϕ)=21E[(Vϕ(st)−stopgrad[yt(1)])2].
The semi-gradient update is
ϕ←ϕ+αVδt∇ϕVϕ(st).
We detach the target so that the critic moves its current-state prediction toward the target without simultaneously changing the next-state prediction to make that target easier to fit.
Target critics
A slowly moving target network further stabilizes bootstrapping:
yt=rt+γ(1−dt)Vϕˉ(st+1).
We can periodically copy the critic
ϕˉ←ϕ
or use Polyak averaging:
ϕˉ←τϕ+(1−τ)ϕˉ,τ≪1.
For a finite-horizon task, the exact value can also depend on time:
Vtπ(s)=Eπ[k=0∑T−t−1γkrt+k∣st=s].
A stationary critic Vϕ(s) is appropriate when the task is time-homogeneous or time is included in the state.
Basic Actor-Critic
For one-step actor-critic, the critic target and advantage are
yt=rt+γ(1−dt)Vϕ(st+1),At=yt−Vϕ(st)=δt.
The actor minimizes
Lπ(θ)=−E[logπθ(at∣st)stopgrad[At]].
The critic and actor have separate parameters, losses, and optimizers. The advantage is detached during the actor update.
Batch Actor-CriticInitialize actor parameters θ and critic parameters ϕ.Repeat:collect trajectories using πθ,yt←rt+γ(1−dt)Vϕ(st+1),ϕ←argϕmin21t∑(Vϕ(st)−stopgrad[yt])2,At←stopgrad[yt−Vϕ(st)],θ←argθmin−t∑logπθ(at∣st)At.
Online updates use fresh data but are noisy and temporally correlated. Batch rollouts average gradients efficiently. Parallel environment workers can decorrelate experience without replay: asynchronous A3C applies worker gradients to shared parameters, while synchronous A2C aggregates all workers before updating.
Multi-Step Returns
One-step TD delegates the entire future after rt to the critic:
Gt(1)=rt+γ(1−dt)V(st+1).
An n-step return uses n real rewards before bootstrapping:
Gt(n)=k=0∑n−1γkrt+k+γnV(st+n).
The bootstrap term is removed if a terminal state occurs inside the window. Its advantage estimate is
At(n)=Gt(n)−V(st).
At the end of a finite episode, V(sT)=0. Choosing n=T−t recovers the Monte Carlo return:
Gt(T−t)=Gt.
Thus one-step TD and Monte Carlo are endpoints of the same family:
Gt(1)⟷Gt(2)⟷⋯⟷Gt.
Larger n reduces dependence on critic accuracy but includes more sampled randomness. Smaller n produces earlier, lower-variance updates but more bootstrap bias.
An n-step advantage is a discounted sum of one-step TD residuals:
so we recover the one-step estimate. At λ=1 in a completed episode,
AtGAE(γ,1)=Gt−V(st),
so we recover Monte Carlo reward-to-go with a value baseline.
The residual at lag l is weighted by (γλ)l. A rough effective trace horizon is
Heff≈1−γλ1.
Larger λ uses longer sampled horizons and usually increases variance. Smaller λ relies more strongly on critic accuracy.
A matching value target is
Rtλ=At+V(st).
We fit the critic with
LV(ϕ)=21E[(Vϕ(st)−stopgrad[Rtλ])2].
Advantage normalization,
At=σA+εAt−μA,
reduces sensitivity to reward scale, but it cannot repair a systematically incorrect critic.
Off-Policy Actor-Critic
Replay buffers make training more sample-efficient, but they break the on-policy assumptions of a state-value critic. A replay action was sampled from a behavior policy β:
a∼β(⋅∣s),β=πθ.
The Bellman equation for the current policy is
Vπ(s)=Ea∼π(⋅∣s),,s′∼P[r(s,a)+γVπ(s′)].
Regressing V(s) toward a target built from arbitrary replay actions instead averages under β. Without importance weighting or another correction, it does not cleanly learn Vπ.
Even when a came from an old policy, the replay tuple contains a valid environment outcome for that particular (s,a). We sample the next action from the current actor:
a′∼πθ(⋅∣s′),y=r+γ(1−d)Qϕˉ(s′,a′).
The critic minimizes
LQ(ϕ)=21ED[(Qϕ(s,a)−stopgrad[y])2].
The actor can reuse replay states while sampling fresh current-policy actions:
s∼D,a∼πθ(⋅∣s).
An approximate score-function update is
∇θJD≈E[∇θlogπθ(a∣s)Qϕ(s,a)].
The fresh action removes the immediate action-distribution mismatch. Replay states still follow a mixture of historical policies, and practical off-policy algorithms accept or control this remaining mismatch.
If the actor always chooses the critic's exact maximizer,
π(a∣s)=1[a=argamaxQ(s,a)],
then the target becomes
y=r+γa′maxQϕˉ(s′,a′),
which is Q-learning. Actor-critic replaces an explicit maximization operator with a learned policy.
Deterministic and Reparameterized Actors
For continuous actions, we can learn a deterministic actor
μθ(s)≈argamaxQϕ(s,a).
It maximizes
JD(θ)=Es∼D[Qϕ(s,μθ(s))].
By the chain rule,
∇θJD(θ)=Es∼D[∇aQϕ(s,a)∣a=μθ(s)∇θμθ(s)].
The actor loss is simply
Lμ(θ)=−Es∼D[Qϕ(s,μθ(s))].
During this update, gradients must flow through the critic with respect to its action input, but the actor optimizer must not update the critic's parameters.
This usually has lower variance than a score-function estimator because it differentiates through the sampled action. As σθ(s)→0, it reduces to the deterministic policy gradient.
For bounded actions, we often use
u=μθ(s)+σθ(s)⊙ϵ,a=tanh(u).
The transformation keeps a in [−1,1] while preserving a differentiable path to the actor.
DDPG
Deep Deterministic Policy Gradient combines:
a deterministic actor μθ;
a Q-critic Qϕ;
target actor μθˉ and target critic Qϕˉ;
an experience-replay buffer.
The target action and critic target are
a′=μθˉ(s′),y=r+γ(1−d)Qϕˉ(s′,a′).
The critic minimizes
LQ(ϕ)=ED[(Qϕ(s,a)−stopgrad[y])2],
while the actor minimizes
Lμ(θ)=−Es∼D[Qϕ(s,μθ(s))].
Both target networks move slowly:
θˉ←τθ+(1−τ)θˉ,ϕˉ←τϕ+(1−τ)ϕˉ.
Because the actor is deterministic, behavior needs external exploration noise:
at=μθ(st)+ηt.
We remove ηt during evaluation.
DDPGInitialize μθ,Qϕ,μθˉ←μθ,Qϕˉ←Qϕ, and replay D.For each environment step:at←μθ(st)+ηt,execute at and store (st,at,rt,st+1,dt),sample a minibatch from D,yi←ri+γ(1−di)Qϕˉ(si′,μθˉ(si′)),ϕ←argϕminB1i∑(Qϕ(si,ai)−yi)2,θ←argθmin−B1i∑Qϕ(si,μθ(si)),Polyak-update θˉ and ϕˉ.
DDPG is approximate continuous-action Q-learning: the actor amortizes the critic's argmax.
TD3
A learned actor can exploit positive critic errors just as a discrete max does. If the critic overestimates one narrow action region, the actor is trained to move toward it.
TD3 uses two critics
Qϕ1(s,a),Qϕ2(s,a),
and the clipped target
y=r+γ(1−d)j∈{1,2}minQϕˉj(s′,a′).
Each critic minimizes its own Bellman loss:
LQj(ϕj)=ED[(Qϕj(s,a)−stopgrad[y])2].
The minimum introduces a conservative bias that prevents optimistic errors from reinforcing themselves. TD3 also delays actor and target updates, allowing the critics to improve before the actor follows their gradients.
many critic updates⟶one actor and target update.
If the actor changes faster than the critic can track, it is likely to chase transient value errors.
Soft Actor-Critic
Soft Actor-Critic optimizes reward and policy entropy:
J(π)=E[t∑γt(r(st,at)+αH(π(⋅∣st)))].
Since
H(π(⋅∣s))=−Ea∼π[logπ(a∣s)],
the soft state value is
Vsoft(s)=Ea∼π[Q(s,a)−αlogπ(a∣s)].
The temperature α>0 controls the reward-entropy trade-off. Large α favors stochastic policies; small α approaches reward-greedy behavior.
Reparameterization lets gradients flow through the sampled action into the critic and through the log-probability term.
Automatic temperature tuning
We can learn α to track a target entropy Htgt:
Lα=E[−α(logπθ(a∣s)+Htgt)].
Parameterize
α=exp(logα)
to ensure positivity. The policy terms are detached during the temperature-only update.
Soft Actor-CriticInitialize actor πθ, critics Qϕ1,Qϕ2, targets, and replay D.For each environment step:at∼πθ(⋅∣st),execute at and store the transition,sample a minibatch from D,ai′∼πθ(⋅∣si′),yi←ri+γ(1−di)[jminQϕˉj(si′,ai′)−αlogπθ(ai′∣si′)],fit both critics to yi,update the actor with αlogπθ(a∣s)−jminQϕj(s,a),optionally update α,Polyak-update both target critics.
Comparing the Main Estimators
Method
Data
Actor
Critic signal
Main trade-off
One-step actor-critic
Fresh on-policy rollouts
Stochastic score function
r+γV(s′)−V(s)
Low variance, critic bias
GAE actor-critic
Fresh on-policy rollouts
Stochastic score function
Weighted TD residuals
Tunable bias and variance
DDPG
Replay
Deterministic pathwise
Target Q at target-actor action
Efficient continuous control, fragile critic
TD3
Replay
Deterministic pathwise
Minimum of twin target critics
Less overestimation, conservative bias
SAC
Replay
Stochastic reparameterized
Entropy-regularized twin-Q target
Stable exploration, more interacting components
The on-policy methods use value critics because their rollout actions follow the current policy. Replay-based methods use Q-critics because the stored action may come from an older policy.
Practical Diagnosis
Symptom
Likely cause
Useful response
Advantages are extremely large
Bad reward scale, terminal mask, or critic fit
Inspect TD residuals and reset GAE at episode boundaries
Critic loss falls but return does not improve
Distribution mismatch or actor exploiting errors
Track realized returns and use twin critics
Q-values grow far beyond possible returns
Bootstrapping or terminal-handling bug
Verify detachment, masks, discount, and target updates
Actor saturates at action bounds
Critic overestimation or excessive actor updates
Lower actor rate and delay actor updates
Gaussian entropy collapses early
Temperature too small or actor step too large
Monitor log standard deviation and entropy
DDPG evaluates worse than training
Exploration noise was left enabled
Remove action noise during evaluation
GAE behaves like noisy Monte Carlo
γλ is too large
Lower λ or improve the critic
GAE is biased and short-sighted
λ is too small or critic is weak
Increase λ and critic capacity carefully
Use separate actor and critic optimizers. Detach Bellman targets, GAE advantages, value targets, and policy terms used only for temperature tuning. During a pathwise actor update, preserve gradients through the critic's action input while preventing the actor optimizer from changing critic parameters.
For true terminal transitions,
y=r.
Administrative time-limit truncations may still have future value and should not automatically be masked as terminal when the environment distinguishes them.
Finally, actor-critic results can vary substantially across seeds. Report multiple runs, separate training returns from evaluation returns, and log both critic predictions and realized discounted returns.
The central progression is
Monte CarloGt⟶baselineGt−V(st)⟶one-step criticrt+γV(st+1)−V(st)⟶GAEl∑(γλ)lδt+l.
For replay-based continuous control, the corresponding progression is
Actor-critic methods work by making two approximators improve one another: the critic turns experience into a useful local learning signal, and the actor changes the data distribution toward actions the critic values. Their strength and instability both come from this feedback loop.