Approximate Solution Methods/Actor-Critic Methods and Continuous Actions

Lesson 3.101,966 words

Actor-Critic Methods and Continuous Actions

REINFORCE with a baseline learns a value function but never bootstraps; this lesson adds the bootstrapping critic that completes the actor-critic architecture. The critic scores each transition into a single TD error that steers both the actor's policy step and its own value step, trading a little bias for much lower variance and fully online, continuing-task learning.

╌╌╌╌

This builds on policy gradient methods, which parameterized the policy directly, proved the policy gradient theorem, and derived REINFORCE and its variance-cutting baseline. REINFORCE with a baseline already learns both a policy and a value function — but the value function only recenters the Monte Carlo return; it never bootstraps. This lesson adds the bootstrapping step that turns the baseline into a true critic, then extends the architecture to continuing tasks and continuous actions.

Actor-critic methods

REINFORCE with baseline learns both a policy and a value function, yet it is not an actor-critic method, because its value function never bootstraps. It supplies a baseline for one state, but the target for the policy update is still the full Monte Carlo return . An actor-critic method uses the learned value estimate to bootstrap — to replace the full return with a one-step estimate — and that is what earns the name critic.1

The move repeats the one that took us from Monte Carlo to temporal-difference learning. Replace the full return in the baselined update with the one-step return , and the difference between that target and the current estimate is precisely the TD error:

Bootstrapping introduces bias and an asymptotic dependence on the quality of the value approximation, a cost that REINFORCE-with-baseline avoids. The tradeoff is usually favorable: bootstrapping substantially reduces variance and lets the method run online and incrementally, updating every step with no wait for the episode to end. It works for continuing tasks, where Monte Carlo returns do not even exist.

The architecture splits cleanly into two learners driven by the same TD error.

The actor-critic loop. The critic scores the transition into a TD error ; the same steers the actor's policy step and the critic's own value step.

The actor is the policy — it selects actions. The critic is the value function — it evaluates them, producing . A positive TD error means the action led somewhere better than the critic expected, so the actor pushes to make that action more likely and the critic revises its estimate upward; a negative error does the reverse. Both learners consume the single scalar .

Algorithm:One-Step-Actor-Critic\textsc{One-Step-Actor-Critic} — episodic, estimate πθπ\pi_{\boldsymbol{\theta}} \approx \pi_\ast
  1. 1
    input: a differentiable policy π(as,θ)\pi(a \mid s, \boldsymbol{\theta}), a differentiable v^(s,w)\hat v(s, \mathbf{w})
  2. 2
    parameters: step sizes αθ>0\alpha^{\boldsymbol{\theta}} > 0, αw>0\alpha^{\mathbf{w}} > 0
  3. 3
    θ,w\boldsymbol{\theta}, \mathbf{w} \gets arbitrary (e.g. 0\mathbf{0})
  4. 4
    for each episode do
  5. 5
    initialize SS (first state of episode)
  6. 6
    I1I \gets 1
  7. 7
    while SS is non-terminal do
  8. 8
    sample Aπ(S,θ)A \sim \pi(\cdot \mid S, \boldsymbol{\theta}), take it, observe RR, SS'
  9. 9
    δR+γv^(S,w)v^(S,w)\delta \gets R + \gamma\,\hat v(S', \mathbf{w}) - \hat v(S, \mathbf{w})
    v^(S,w)0\hat v(S',\mathbf{w}) \doteq 0 if SS' terminal
  10. 10
    ww+αwδv^(S,w)\mathbf{w} \gets \mathbf{w} + \alpha^{\mathbf{w}}\,\delta\, \nabla \hat v(S, \mathbf{w})
  11. 11
    θθ+αθIδlnπ(AS,θ)\boldsymbol{\theta} \gets \boldsymbol{\theta} + \alpha^{\boldsymbol{\theta}}\,I\,\delta\, \nabla \ln \pi(A \mid S, \boldsymbol{\theta})
  12. 12
    IγII \gets \gamma I
  13. 13
    SSS \gets S'

This one-step method is the analog of TD(0). Generalizing it to -step returns or to a -return with separate eligibility traces for actor and critic is mechanical — swap the one-step target for the longer one — and gives a family that trades bias against variance by the degree of bootstrapping, exactly as in the value-based case. The critic's own weights are learned by semi-gradient TD, paired to the actor's update through their shared .

Policy gradient for continuing problems

Episodic performance is the value of a start state, but continuing problems have no episode boundary and no start state to anchor . For them, performance is the average rate of reward per step under the policy:2

where is the steady-state distribution under , defined by and assumed to exist independently of the start state (an ergodicity assumption). It is the special distribution in which staying with keeps you: for every .

Values are then defined against the differential return, rewards measured relative to the average rate,

and with these definitions the policy gradient theorem holds unchanged — the same , now with the continuing and . The proof runs parallel to the episodic one. In the actor-critic algorithm the only practical change is that the TD error subtracts a running estimate of the average reward: , with itself updated toward by the same error. No discounting appears; the average-reward setting replaces with the differential value.

Continuous actions: the Gaussian policy

The softmax parameterization enumerates a probability per action, which is hopeless when there are infinitely many. For continuous actions the policy instead learns the statistics of a distribution and samples from it. The standard choice on a real-valued scalar action is a Gaussian policy: output a state-dependent mean and standard deviation, then draw the action from the normal density.3

where and are two parameterized function approximators. The mean sets where the policy aims; the standard deviation sets how much it explores — a large spreads mass widely and tries varied actions, a small concentrates near the mean and commits. Exploration is now a learned quantity, not a fixed .

A Gaussian policy on a scalar action: the mean sets where the policy aims and the standard deviation sets how widely it explores; the sampled action is a draw from this density.

To finish the construction, split the parameter vector into two blocks, , one for each statistic. The mean is a linear function of state features; the standard deviation, which must stay positive, is the exponential of a linear function:

Both are differentiable in , so the eligibility vector is available in closed form and every algorithm in this lesson — REINFORCE, baselined REINFORCE, actor-critic — applies verbatim to real-valued control.

Differentiating under the normal density (13.19) splits the eligibility vector into a mean part and a spread part:

Each has a plain meaning. The mean part pushes toward the sampled action when the return was good — the size of the push is the standardized surprise , scaled again by so that a confident (small-) policy reacts more sharply to the same deviation. The spread part widens when the action landed far from the mean (the squared standardized deviation exceeds ) and narrows it when actions cluster near the mean (below ). Exploration tunes itself: consistently rewarded actions near the mean shrink and sharpen the policy; surprising high-return outliers grow and keep it searching.

A worked step. Suppose , , and the agent samples with a positive advantage . The standardized deviation is . The mean eligibility is , so the update moves toward . The spread eligibility is ; because the sampled action sat inside one standard deviation, the positive advantage times a negative eligibility shrinks , tightening the policy around a region with high return.

The Gaussian policy tuning itself. A rewarded action near the mean (top) grows the mean toward it and shrinks , sharpening the policy; a rewarded action in the far tail (bottom) grows , keeping exploration wide.

Natural policy gradients and the modern lineage

The plain gradient ascends performance in the geometry of the raw parameter space, treating every coordinate of as equally scaled. That geometry is arbitrary: rescaling one weight, or reparameterizing the policy, changes the gradient direction even though the policy — the actual distribution over actions — is unchanged. As a result, vanilla policy gradient can be slow. A small step in can produce a large, destabilizing change in the action distribution in one region and a negligible change in another.

The natural policy gradient fixes this by measuring distance between policies in the space of distributions rather than of parameters, using the Fisher information matrix as the local metric. The natural gradient premultiplies the ordinary gradient by its inverse,

which points in the direction of steepest ascent per unit of change in the policy's output distribution, invariant to how the policy is parameterized. Amari (1998, Neural Computation) established that this natural gradient is the correct steepest descent direction on a statistical manifold;4 Kakade (2002, NeurIPS, A Natural Policy Gradient) brought it to reinforcement learning and showed it moves toward the greedy policy and often converges far faster than the vanilla gradient.5 Sutton and Barto flag natural-gradient methods (Amari 1998; Kakade 2002; Peters and Schaal 2008) as the main further development past their own treatment.

Vanilla versus natural gradient on an anisotropic performance surface. The vanilla gradient (red) is perpendicular to raw-parameter contours and zig-zags up a stretched valley; the natural gradient (blue) uses the Fisher metric to head straight for the optimum, invariant to the parameterization.

This line of work leads to the algorithms that train today's agents. Trust region policy optimization (Schulman et al. 2015, ICML) constrains each update to a small KL-divergence step — a practical approximation of the natural-gradient idea, capping how far the action distribution may move per update.6Proximal policy optimization (Schulman et al. 2017, Proximal Policy Optimization Algorithms) replaces the hard constraint with a clipped surrogate objective that is cheaper and more stable, and is the actor-critic loop of this lesson with the raw swapped for a generalized advantage estimate (Schulman et al. 2016, ICLR) and the policy step clipped.7Deterministic policy gradients (Silver et al. 2014, ICML) take the opposite turn from the Gaussian policy: they learn a deterministic and differentiate through a critic, the basis for DDPG in continuous control. And off-policy policy-gradient methods (Degris, White, and Sutton 2012, ICML) reweight the gradient by importance ratios so the policy can be improved from data a different behavior policy generated8 — the same off-policy correction that runs through the eligibility-trace lessons. All rest on the policy gradient theorem; they differ in the metric of the step and the estimator of the advantage.

The bridge to deep RL

Every method here left the function approximator abstract: the preferences , the value , the Gaussian's mean and spread are some differentiable function of . Make that function a deep neural network and the same three equations underlie modern reinforcement learning. The eligibility vector is computed by backpropagation; the actor and critic become two networks (or two heads of one); the TD error is the training signal for both. Advantage actor-critic and PPO — the algorithms that train game-playing agents and align language models — are the actor-critic loop of this lesson with a neural policy, a clipped or trust-region step to keep the update stable, and an advantage estimate in place of the raw . We follow that thread into actor-critic and PPO.

The larger shift is conceptual. Before this chapter, learning meant estimating values and reading a policy off them. Policy gradient methods invert that: the policy is the object of learning, performance is a differentiable function of its parameters, and everything reduces to gradient ascent on . The policy gradient theorem makes this possible without a model of the environment, and the actor-critic architecture makes it fast.

Footnotes

  1. Sutton & Barto, §13.5 — Actor–Critic Methods: why REINFORCE-with-baseline is not actor-critic (no bootstrapping), the one-step actor-critic updates (13.12)–(13.14) with the TD error , the bias/variance trade of bootstrapping, and the boxed one-step and eligibility-trace algorithms pairing a semi-gradient TD critic with the policy actor.
  2. Sutton & Barto, §13.6 — Policy Gradient for Continuing Problems: the average-reward performance (13.15), the steady-state distribution (13.16), the differential return (13.17), the invariance of the policy gradient theorem in the continuing case, and the continuing backward-view actor-critic box with the running average-reward estimate .
  3. Sutton & Barto, §13.7 — Policy Parameterization for Continuous Actions: the normal density parameterization (13.18)–(13.19), splitting into mean and standard-deviation blocks with and (13.20), and the closed-form eligibility vectors of Exercise 13.4.
  4. Amari (1998), Natural gradient works efficiently in learning, Neural Computation 10(2): the natural gradient as the steepest-ascent direction on a statistical manifold, obtained by premultiplying the ordinary gradient by the inverse Fisher information matrix; invariant to reparameterization.
  5. Kakade (2002), A Natural Policy Gradient, Advances in Neural Information Processing Systems (NeurIPS): applies the natural gradient to policy search, using the Fisher information of the policy as metric; shows the natural policy gradient moves toward the greedy policy and typically converges faster than the vanilla gradient. Sutton & Barto (§13.8, Bibliographical Remarks) cite Amari (1998) and Kakade (2002) as the primary further development past their chapter.
  6. Schulman, Levine, Abbeel, Jordan, Moritz (2015), Trust Region Policy Optimization, ICML: constrains each policy update to a bounded KL-divergence trust region, a practical approximation to the natural-gradient step; Schulman et al. (2016), High-Dimensional Continuous Control Using Generalized Advantage Estimation, ICLR.
  7. Schulman, Wolski, Dhariwal, Radford, Klimov (2017), Proximal Policy Optimization Algorithms, arXiv:1707.06347: replaces the TRPO constraint with a clipped surrogate objective; a first-order actor-critic method that is the basis for much modern policy-gradient training.
  8. Silver, Lever, Heess, Degris, Wierstra, Riedmiller (2014), Deterministic Policy Gradient Algorithms, ICML: derives a policy-gradient theorem for deterministic policies that differentiates through the critic, the basis for DDPG in continuous control. Degris, White, Sutton (2012), Off-Policy Actor-Critic, ICML: reweights the policy gradient by importance ratios so a target policy can be improved from behavior-policy data.

╌╌ END ╌╌