Deterministic Policy Gradients
Deterministic policy gradients steer one exact action per state by chaining the critic value slope into the actor weights, with no sampling over actions.
Why Does This Exist?
Stochastic policy gradient integrates over states and actions. For a policy the gradient averages over every action the distribution might sample. In a high dimensional continuous space that average needs many samples and carries high variance.
Off policy reuse is also painful there. Weighting old data by density ratios over continuous vectors swings wildly and destabilizes updates.
Deterministic Policy Gradient, proved by Silver and colleagues in 2014, removes the action integral. The policy is a map to one action vector. The gradient averages only over states and chains the critic slope into actor weights. No action sampling, no density ratio. DDPG and TD3 build directly on it.
This page covers the theorem, the chain rule and the exploration fix. For the stochastic baseline see policy gradient. For the flagship application see deep deterministic policy gradient. For the spaces it unlocks see continuous action spaces.
The one idea you need first
A Jacobian lists how each actor weight changes the action output. The critic slope lists how each action entry changes value. Multiplying them converts a wish in action space into a weight change.
Think of It Like This
A hand on a power steering wheel
You hold a wheel linked straight to the tires. Mid turn you feel resistance in your palms telling you which way grip improves. You do not try fifty random angles. You follow the pressure and your arms learn the better line.
Wheel resistance is . Arm adjustment is . The chain of the two is the update. The road you practiced on is the replay buffer, and you still swerve a little on purpose during practice so you learn more than one line.
Where it stops: real resistance comes from tire physics. Here the slope comes from a learned critic that starts wrong, so early steering advice can point the wrong way.
How It Actually Works
Let states follow under the deterministic policy. Performance is expected value at the actor choice:
The Deterministic Policy Gradient theorem states:
In plain words: slope of weights into actions times slope of actions into value, averaged over visited states. Off policy training swaps the state distribution to the behavior data and keeps the same chain, with no importance ratio over continuous actions.
Why the action integral disappears
A stochastic policy spreads probability across actions, so its gradient must average over that spread. A deterministic policy puts all mass on one point , so composition differentiates by the ordinary chain rule. Fewer integrals means fewer samples for the same signal, which is the sample efficiency win.
Exploration still needs noise
One output per state never tries anything new on its own. Collection adds noise to the actor output with behavior , often Gaussian or temporally correlated noise. Replay stores those noisy transitions. The critic trains on them while the actor updates through at sampled states.
Worked example
One dimensional control with . Actor with and . Critic with best action . Step size .
Forward action and value:
Critic slope with respect to action:
Actor Jacobian entries:
Chain into gradients:
Ascent step:
New action and value:
One step reaches the optimum because the critic is a clean quadratic and the actor is linear in this toy setup.
Code
This snippet repeats the chain rule and update with plain Python.
def actor(s: float, t1: float, t2: float) -> float: """Deterministic linear actor: mu(s) = t1 * s + t2.""" return t1 * s + t2
def critic(a: float, star: float = 5.0) -> float: """Quadratic critic with best action at star.""" return -((a - star) ** 2) + 0.0
def critic_slope(a: float, star: float = 5.0) -> float: """Slope of critic over action: -2 * (a - star).""" return -2.0 * (a - star)
s = 2.0t1, t2 = 1.0, 0.5a = actor(s, t1, t2)print(f"{a:.2f}") # -> 2.50print(f"{critic(a):.4f}") # -> -6.2500ga = critic_slope(a)print(f"{ga:.2f}") # -> 5.00print(f"{s * ga:.4f}") # -> 10.0000print(f"{1.0 * ga:.4f}") # -> 5.0000t1 += 0.1 * s * gat2 += 0.1 * 1.0 * gaprint(f"{t1:.2f} {t2:.2f}") # -> 2.00 1.00a_new = actor(s, t1, t2)print(f"{a_new:.2f} {critic(a_new):.4f}") # -> 5.00 0.0000Slopes, updated weights and the final optimal action match the hand derivation line for line.
Watch Out For
Training the deterministic actor on its own narrow track
Without noise the actor visits a thin slice of state action space. The critic looks accurate there and wrong elsewhere, yet the chain rule trusts it everywhere. Learning stalls at the first decent line and never discovers sharper ones.
Symptom: fast early gains then a flat plateau with near zero action diversity. Fix it by collecting with added Gaussian noise, keeping that noisy data in replay and training the critic on it. Check action histograms during collection. If they collapse to a spike, raise the noise scale before touching learning rates.
The Quick Version
- DPG integrates over states only: .
- The critic slope says which action direction helps, and the actor Jacobian turns it into a weight change.
- Off policy replay needs no action density ratio because the target policy is a single point.
- Worked numbers: , , slopes and , new weights and , optimum .
- Deterministic output cannot explore alone, so add noise during collection and store it.
- DDPG applies this theorem with replay plus soft targets, and TD3 hardens it further.