Policy Gradients and Actor-Critic — Learning the Policy Directly

Value-based methods like Q-learning learn how good each action is, then act greedily. There's a different and often better approach: skip the value estimates and learn the policy itself, directly adjusting the probability of actions to get more reward. Policy gradient methods are how RL handles continuous control and stochastic strategies — and the actor-critic architecture that combines them with value learning is the foundation of the algorithms used to fine-tune today's language models.

Posts 4–5 were value-based: learn Q, act greedily. This post covers the other great family — policy-based methods — and their fusion with value methods in actor-critic. This matters beyond theory: the algorithms that do RLHF (post 7), like PPO, are actor-critic policy-gradient methods, so this is the direct conceptual bridge from classic RL to LLM alignment.

Why learn the policy directly

Value-based methods have a structural awkwardness: they learn values, then derive a policy by picking the highest-value action. That works when actions are a small discrete set (pick the max), but it breaks down in important cases:

Policy gradient methods address all three by learning the policy directly: a neural network takes a state and outputs probabilities over actions (or parameters of a continuous action distribution), and training adjusts those probabilities to earn more reward. No value table, no greedy max — the policy is the thing you learn and the thing you use.

How policy gradients work

The mechanism is intuitive, and it’s essentially trial-and-error with a gradient. The agent acts according to its current (stochastic) policy, collects the rewards, and then adjusts the policy by the principle:

Increase the probability of actions that led to good outcomes; decrease the probability of actions that led to bad ones.

Concretely, you compute a gradient that points in the direction of higher expected reward — raising the likelihood of action sequences that earned high return, lowering those that earned low return — and take a gradient-ascent step (the mirror of the gradient descent from the ML series). The classic version, REINFORCE, does exactly this using the total return of each episode.

This directness is the strength, but it has a well-known weakness: high variance. Because it learns from the noisy total reward of whole episodes, the signal is noisy — a good action in an episode that happened to end badly gets unfairly penalized, and vice versa. Pure policy gradients therefore learn slowly and unstably, needing many episodes to average out the noise. Fixing that variance problem is what leads to actor-critic.

Actor-critic: the best of both families

The key innovation is to combine policy-based and value-based learning into the actor-critic architecture, which is the workhorse of modern RL:

This fusion gets the best of both: the actor handles continuous and stochastic policies (policy gradients’ strength), while the critic provides the stable, low-variance learning signal (value methods’ strength). Actor-critic methods converge faster and more reliably than pure policy gradients, and they underpin the most widely used modern RL algorithms. The most important of these is Proximal Policy Optimization (PPO) — an actor-critic policy-gradient method that adds a crucial stabilizer: it limits how much the policy can change in a single update (“proximal” = stay close to the previous policy), preventing the catastrophic, unrecoverable policy collapses that plagued earlier methods. PPO’s reliability made it the default RL algorithm for many applications — and, decisively, the algorithm behind RLHF (post 7). The direct line from this post to LLM alignment runs through PPO: the actor is the language model, the critic estimates value, and the “reward” comes from human preferences.

The throughline: policy gradient methods learn the policy directly — a network outputs action probabilities, and training raises the probability of actions that earned reward and lowers those that didn’t (gradient ascent) — solving what value methods can’t: continuous action spaces, stochastic optimal policies, and cases where the policy is simpler than the value function. Their weakness is high variance (noisy whole-episode signal), fixed by the actor-critic architecture: the actor (policy) chooses actions while the critic (value function, learned by TD) provides a low-variance “better than expected” signal to judge them — the best of both families. The dominant such method, PPO, adds update-size limits for stability and is the algorithm behind RLHF, making this post the direct bridge from classic RL to LLM alignment.

Key takeaways

Further reading

Sources & References