
Source: AI Summer
Introduction
You’ve seen value-based reinforcement learning (RL): learn a score for each action like $Q(s,a)$, then pick the highest-scoring action. Policy gradient methods take a different route:
“Instead of learning action scores, learn the policy (the thing that chooses actions) directly.”
This turns out to be especially useful when actions are continuous (like steering angles or robot motor power), or when you want a policy that stays stochastic (sometimes randomness is helpful).
1) What is a policy?
A policy is a rule for choosing actions:
- Deterministic: $(a = \pi(s))$
- Stochastic: $(\pi_\theta(a\mid s))$ gives a probability of taking action (a) in state (s)
Policy gradient methods usually use the stochastic version, with parameters $(\theta)$ (often a neural network). The agent’s job is to adjust $(\theta)$ so the actions it samples lead to higher long-term reward.
2) The core idea: “make good actions more likely”
Imagine you’re learning to ride a bicycle on a dirt road. You try a small steering adjustment. Sometimes it keeps you stable (good outcome). Sometimes it leads to a wobble (bad outcome).
A reasonable learning rule is:
- If an action led to a good outcome, increase the chance of doing it again in that situation
- If it led to a bad outcome, decrease it
This intuition is formalized in classic algorithms like REINFORCE.
A simple (friendly) form of the update looks like:
Interpretation:
- $\log \pi_\theta(a_t\mid s_t)$ asks: “How much did my parameters influence choosing this action?”
- $G_t$ is the return (how good it turned out in its reward)
- Multiply them together: reinforce actions that led to high return
You don’t need to be a calculus expert to get the takeaway: policy gradients push probability mass toward actions that work or have worked
3) Why policy gradients can feel “noisy”
Policy gradients are powerful, but they can be unstable because learning signals can be noisy:
- Rewards are random.
- The environment is random.
- The policy itself samples actions randomly.
So, two episodes with the same state can produce very different outcomes, making updates high-variance.
A simple fix: baselines
A standard variance-reduction trick is to subtract a baseline – roughly “what you expected to happen anyway.”
Instead of using $G_t$, you use something like $G_t – b(s_t)$. When $b(s_t)$ is a value function estimate $V(s_t)$, the difference is called an advantage:
This says: “Was this action better than what I normally get from this state?” This is one reason value functions still show up in policy-based RL.
4) Actor–Critic: the practical workhorse
Most real systems don’t use plain REINFORCE. They use actor–critic methods:
- Actor: the policy $\pi_\theta(a\mid s)$ (what to do)
- Critic: a value function $(V_\phi(s)) or (Q_\phi(s,a))$ (how good it is)
The critic helps by providing a lower-variance training signal (an advantage estimate). Classic theory and algorithms for actor–critic are developed in foundational work by Konda & Tsitsiklis and others.
In practice, this often looks like:
- Run the policy to gather trajectories (sequences of states and actions)
- Use the critic to estimate advantages of actions
- Update the actor in the direction that increases probability of high-advantage actions
- Update the critic to better predict rewards
- Repeat the above steps
5) Why policy gradients are popular (real-world intuition)
Continuous actions
Value-based methods like DQN pick the best action by doing a $(\max)$ over actions. That’s easy when actions are discrete (left / right / jump). It’s harder when actions are continuous (any steering angle from −30° to +30°).
Policy gradients handle continuous actions naturally by learning a distribution over actions (for example, a Gaussian). This is why policy-gradient ideas are common in robotics and control.
Stochastic policies are sometimes better
Some environments require randomness to explore well or to avoid predictable behavior. Policy gradients naturally represent stochastic behavior.
6) TRPO and PPO: keeping updates “not too big”
A key practical issue: if you update a policy too aggressively, performance can suddenly collapse (you took a step that changed behavior too much).
Two influential solutions are:
- TRPO (Trust Region Policy Optimization): constrain policy updates so the new policy isn’t too far from the old one.
- PPO (Proximal Policy Optimization): a simpler, widely used method that approximates this “don’t change too much” idea with a clipped objective. PPO is popular because it works well and is easier to implement.
A related improvement is Generalized Advantage Estimation (GAE), which gives a practical way to compute advantage estimates that trade off bias and variance.
7) Pros and cons
Policy gradient methods have some advantages and disadvantages:
| Pros | Cons |
| – Natural for continuous control – Can learn stochastic policies – Fits well with deep learning (actor and critic as neural nets) | – Can be sample-inefficient (needs lots of interaction) – Sensitive to reward design and hyperparameters – Training can be unstable without “safe update” techniques (e.g., PPO/TRPO) |
Takeaway
If value-based RL is: “Learn a scoreboard for actions,”
policy gradients are: “Learn the decision-maker itself and tune it to get more reward.”
In modern RL, actor–critic methods plus stable update rules (like PPO) are often the practical default, especially for continuous control.
Videos
- This video by Jia-Bin Huang provides a one-minute synopsys of the development of Policy Gradient algorithms over the past 30 years. (Runtime: 1 min 18 secs)
- This video is part of Google DeepMind’s course on Reinforcement Learning – Start from 26:40 for emphasis on gradient-based methods specifically. (Runtime: 1 hour)
References
- Williams, R. J. (1992). Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine Learning.
- Sutton, R. S., McAllester, D. A., Singh, S. P., & Mansour, Y. (2000). Policy gradient methods for reinforcement learning with function approximation. NeurIPS (1999).
- Konda, V. R., & Tsitsiklis, J. N. (2000). Actor-critic algorithms. NeurIPS (1999).
- Schulman, J., Levine, S., Moritz, P., Jordan, M. I., & Abbeel, P. (2015). Trust Region Policy Optimization. arXiv:1502.05477.
- Schulman, J., Wolski, F., Dhariwal, P., Radford, A., & Klimov, O. (2017). Proximal Policy Optimization Algorithms. arXiv:1707.06347.
- Schulman, J., Moritz, P., Levine, S., Jordan, M. I., & Abbeel, P. (2015).High-Dimensional Continuous Control Using Generalized Advantage Estimation.arXiv:1506.02438.
Related articles on AIML.com
- Introduction to Reinforcement Learning: A Beginner’s Guide
- What are the Advantages and Disadvantages of Reinforcement Learning?
- What does ‘policy’ in Reinforcement Learning mean?
Author: Sam M, Brown University

