← All notesReinforcement LearningMechanism
Policy Gradient from an Optimization Viewpoint
One continuous line from the objective to gradient estimation, variance and stepsize choice.
1. From RL to Optimization
Policy gradient writes policy search as a parametric optimization problem:
The main difficulty is not merely defining the objective. The gradient must be estimated through the trajectory distribution induced by the current policy, and the resulting estimator often has high variance. Thus policy gradient methods are controlled by both the structure of reinforcement learning and the stability properties of stochastic nonconvex optimization.
Consider a discounted MDP
where is the transition kernel, is the reward, is the discount factor, and is the initial state distribution. For a policy , the objective is
For a parameterized policy class , we optimize
Stochastic policies provide differentiability. In discrete action spaces, a deterministic policy such as
typically changes discontinuously with . A stochastic policy replaces hard action selection by a differentiable probability distribution.
2. Policy Gradient Theorem
Define the discounted state visitation distribution
The policy gradient theorem gives
This converts differentiation through the trajectory distribution into a score-function estimator,
It is the common foundation of REINFORCE, Actor-Critic, TRPO, and PPO.
For any state-dependent baseline ,
Thus may be replaced by the advantage
without changing the expected gradient, while often reducing variance.
3. REINFORCE and Stochastic Gradient
REINFORCE uses the sampled return
as a Monte Carlo estimator of , leading to the update
The estimator is unbiased but high variance. Actor-Critic methods replace the pure Monte Carlo return by a critic estimate of or , trading some bias for lower variance.
At the optimization level, policy gradient updates can be abstracted as
In the nonconvex case, the natural guarantee is not global optimality but a stationarity measure:
If is -smooth and the gradient estimator satisfies
then telescoping the smoothness inequality gives
where .
4. Stepsize and PPO
Let
The upper bound has the form
On , is constant-factor equivalent to
Balancing the two terms yields
The minimum reflects two constraints: the stepsize must remain within the smoothness scale, and it must balance the initial gap against stochastic variance.
PPO remains a policy gradient method, but it constrains how far a single update may move away from the old policy. Define the importance ratio
PPO uses the clipped surrogate
From a theoretical viewpoint, PPO is not a new policy gradient theorem. Its value is better understood as a conservative update geometry: data collected under the old policy should not support a new policy that moves too far away from it.
Summary
The basic chain is
Stochastic policies provide differentiability, trajectories provide gradient estimators, and optimization theory explains noise, variance, and stepsize selection. PPO does not introduce a new gradient theorem; it adds a conservative update geometry on top of noisy policy gradient.
References
- Sutton and Barto, Reinforcement Learning: An Introduction, 2nd ed., Ch. 13.
- Williams, "Simple statistical gradient-following algorithms for connectionist reinforcement learning", Machine Learning, 1992.
- Sutton, McAllester, Singh, Mansour, "Policy Gradient Methods for Reinforcement Learning with Function Approximation", NeurIPS, 1999.
- Schulman et al., "Trust Region Policy Optimization", ICML, 2015.
- Schulman et al., "Proximal Policy Optimization Algorithms", arXiv:1707.06347, 2017.