PPO, Value Functions, and Actor-Critic
A story: a chess player and their coach
Picture a beginner chess player. Move after move, they act as best they can. But how do they improve? Beside them sits a coach who never plays a move, they only comment: "This position is excellent", "you're in trouble here", "that move was better than I expected from you."
The player is the policy: the thing that acts. The coach is the value function: the thing that evaluates. This division of labor (one acts, the other judges) has a name: the actor-critic architecture. It is the heart of PPO, the algorithm behind the first LLM alignment runs done with RLHF (Reinforcement Learning from Human Feedback).
This page fills in the reinforcement learning (RL) foundations you need to truly understand the pages on RLHF, GRPO, and DPO. We define the basic building blocks in plain words, then climb up to PPO's clipped objective, "clipping" here just means cutting off whatever goes past a bound.
The basic vocabulary, in plain words
All of RL rests on a loop: an agent observes a state, picks an action, receives a reward, moves to the next state, and repeats. For an LLM, the state is the text written so far, the action is the next token, and the reward comes mostly at the end (is the full answer good?).
-
Policy , the agent's strategy: for a state , the probability of choosing action . For an LLM this is simply the model: "for this partial text, what is the probability of the next token?".
-
Reward , the immediate signal received after an action. Often sparse: in chess, you only learn who won at the very end.
-
Return , the sum of future rewards from now on. This is what the agent really tries to maximize: not the reward of one isolated move, but the total over the whole game. It is often written with a discount factor that down-weights the distant future:
-
Value function , the answer to the question: "how promising is this state?" Formally, it is the average return you can expect if you start from state and keep playing as usual. A winning chess position has high value, even before the final move.
-
Q function , almost the same, but also fixing the action: "if I am in state and I play exactly action , what can I expect next?"
-
Advantage , the decisive question: "is this action better than average in this state?" If the advantage is positive, the action did better than expected → reinforce it. If negative → discourage it.
Knowing that an action scored 8/10 tells you nothing until you know what was expected. If the expected average in that situation was 9, then 8 is actually disappointing. The advantage subtracts that expectation () from the actual outcome: it turns an absolute score into "better or worse than expected". That is exactly the signal that drives learning.
The problem: raw policy gradient is too noisy
The most direct way to train a policy is called policy gradient: you generate full trajectories, look at the return obtained, and push the policy to do more of what worked and less of what didn't.
A quick vocabulary note: for an LLM, a trajectory is simply the full text the model generates while solving the problem, its step-by-step reasoning draft plus the final answer. Depending on the paper, it is also called a trace, rollout, completion or chain of thought: same thing. A partial trajectory is that draft cut off midway.
The catch: the return is extremely noisy. A good action can be followed by bad luck and end on a poor return; a bad action can be rescued later. If you train on the raw return, the signal drowns in noise. Training becomes slow and unstable, like grading a student on a single, randomly drawn mark.
We would like to subtract a baseline: not "what absolute return?" but "is this return better than expected in this situation?". That baseline is precisely the value function . And the de-noised signal is the advantage.
The solution: the actor-critic architecture
Hence the idea of training two networks side by side:
- The actor, this is the policy . It acts: it generates the actions (the tokens).
- The critic, a network that estimates the value function . It never acts; it predicts "how promising this state is".
At each step the actor plays, the critic announces the expected value, and we compare the real outcome to that prediction. The difference gives the advantage, which is used to update the actor. In parallel, the critic also improves by learning to better predict returns.

Why does this reduce variance? Because we no longer train the actor on the raw return (very noisy), but on the advantage (the outcome minus the expectation). By removing the predictable part of the signal, we keep only the useful surprise, "better or worse than expected". The signal is much cleaner, the training more stable.
The RLHF in practice page sets out the four models PPO keeps in memory and which of them learn: the policy and the critic are trained, the reference model and the reward model are frozen. The critic on that list is exactly the actor-critic critic: a value network that estimates, for a partial answer, the total reward you can hope for. Without it there would be no advantage, and training would be far noisier. The detailed memory count is done there, so we do not repeat it here.
GAE: tuning the bias / variance dial
One practical question remains: how do we actually estimate the advantage? There are two extremes, and each has a flaw.
- Trust the observed reality (the full return over the whole trajectory): unbiased on average (low bias), but very noisy (high variance), the raw policy-gradient problem.
- Trust the critic (use only the prediction over one step): very stable (low variance), but if the critic is wrong, the error propagates everywhere (high bias).
GAE (Generalized Advantage Estimation) proposes not to choose: it blends the two through a dial . The symbol is the Greek letter lambda; here it is just a setting between 0 and 1, with no other meaning.
High-Dimensional Continuous Control Using Generalized Advantage Estimation (GAE)The intuition: GAE combines the 1-step, 2-step, 3-step… estimates, weighting them down geometrically with . With near 0, you mostly trust the critic (low variance, but you depend on its accuracy). With near 1, you mostly trust the rewards actually observed (low bias, but more noise). In practice you pick an intermediate value: there is no canonical setting, and the usual ones sit in the upper part of the range, close enough to 1 to keep bias low while cutting some of the noise. It is simply a bias/variance knob you turn.
The Flaw in Plain Policy Gradient That PPO Fixes
In one sentence: plain policy gradient lets one oversized update throw the policy into a catastrophic region it never recovers from; PPO bounds how much the policy is allowed to change per step.
PPO stands for Proximal Policy Optimization. "Proximal" means: stay close to the previous policy at each step.
Proximal Policy Optimization AlgorithmsPPO's trick is the clipped objective. We start by measuring the importance ratio, how much the action's probability changed since the previous version of the policy:
The symbols: (the Greek letter rho) is the ratio at step ; is the policy being trained, whose learned parameters are collectively called (theta); is the same policy as it stood when the responses were generated; is the action taken and the state it was taken in. In plain words: the ratio compares the probability the model gives this action now against the probability it gave when it produced it.
If , nothing changed; if , the model makes this action 50% more likely. The clipped objective is then:
Let's decode it:
- , the quantity to be maximized (papers call it an objective; it is a loss with the sign flipped). is the average taken over all steps in the batch.
- , the "natural" term: push the probability in the direction of the advantage (more likely if , less if ).
- , bound the ratio inside a narrow band. (epsilon) is the half-width of that band, a setting you choose; the experiments in the PPO paper use , and that has stayed the ecosystem default. With , the ratio never counts as more than or less than . Beyond that the gain is "capped": the policy gains nothing from pushing the action even further in a single step.
- , always take the more pessimistic of the two terms. This is the cautious reflex: never allow the most optimistic update, only the most conservative one.
In one sentence: reinforce the action in the direction of its advantage, but never count more than a 20% change per step, and when in doubt keep the less ambitious of the two readings.

Clipping acts like a steering limiter. Even if the estimated advantage is huge (because the critic got carried away), PPO refuses to make too sharp a turn in a single update. The policy evolves in small, safe steps instead of large, risky leaps. It is this simplicity (a single robust objective, with no hard mathematical constraint to solve) that made PPO the default RL algorithm for years.
Why PPO was the historical RLHF algorithm
When OpenAI produced InstructGPT (the instruction-following alignment of GPT-3, whose recipe then served as the template for ChatGPT) it was PPO that ran the final RLHF step. The full assembly brings together everything we just saw:
- A reward model plays the role of reward: it scores the complete answer. It is frozen during this step; how it is trained is covered in RLHF in practice.
- A value network (the critic) estimates, token by token, the total expected reward. It is trained alongside the policy.
- GAE turns those two signals into a clean, low-variance advantage.
- PPO updates the LLM (the actor) with the clipped objective, plus a Kullback-Leibler penalty (the Kullback-Leibler divergence, abbreviated KL, measures how far apart two probability distributions are) that keeps the model from drifting too far from its SFT (Supervised Fine-Tuning) version. That is the "leash" described in RLHF in practice.
It is powerful but heavy: four models in memory, dozens of hyperparameters, an entire critic to train whose errors pollute the actor. Hence the search for lighter alternatives.
The contrast with recent approaches
Recent algorithms all start from the same observation: the value network (the critic) is expensive and adds noise. What happens if we get rid of it?
| PPO | GRPO | DPO | |
|---|---|---|---|
| Value network (critic) | Yes (trained separately) | No (advantage estimated by group | No) no RL at all |
| Where does advantage come from? | Critic + GAE | Mean/std of a group of answers | None (direct comparison of pairs) |
| Reward model | Yes | Yes or a verifier | No (direct preferences) |
| Clipped objective | Yes | Yes (inherited from PPO) | No |
| Complexity | Very high | Moderate | Low |
- GRPO keeps PPO's spirit (the ratio, the clipping) but removes the value network: instead of a critic, it generates a group of answers to the same prompt and uses their mean as the baseline. The advantage becomes simply "is this answer better than the group average?". Details in the GRPO and oDPO page.

- DPO goes further and removes RL entirely: no reward, no critic, no on-the-fly generation. You optimize the model directly on (preferred answer, rejected answer) pairs with a simple contrastive loss, a loss that never judges one answer on its own, only the gap between two answers. See the RLHF in practice and DPO in practice pages.
Even though GRPO and DPO often replace it, PPO remains the conceptual bedrock: GRPO literally reuses its clipped objective, and the notion of advantage you optimize comes from here. You don't really grasp "GRPO removes the critic" until you understand what that critic was doing in PPO.
Value functions for long-horizon / agentic tasks
The value network regains its full usefulness when rewards are distant. An agent solving a task in 50 steps (browsing the web, writing and debugging code, planning) often gets a signal only at the very end: success or failure.
In that case, how do you know whether an intermediate step (a partial trajectory) was promising, when the verdict only arrives much later? That is exactly the job of a value function: estimate "how likely is this partial state to lead to success?". It is the same intuition as the chess position judged winning before the final move. For long-horizon agentic RL, learning to assign credit to intermediate steps (via a value function or process rewards) remains a central problem and an active area of innovation.
Key takeaways
-
The vocabulary: the policy acts, the reward scores, the return is the sum of future rewards, the value function says how promising a state is, and the advantage says whether an action did better than average.
-
Actor-critic: train two networks, the actor (the policy) acts, the critic (the value) evaluates. Training the actor on the advantage rather than the raw return strongly reduces variance and stabilizes learning.
-
GAE blends the estimate from real rewards (low bias, high variance) and from the critic (high stability, possible bias) through a dial : simply a bias/variance knob.
-
PPO adds the clipped objective: by bounding the ratio inside a narrow band and taking the pessimistic minimum, it stops the policy from changing too much at once, hence its stability.
-
PPO was the historical RLHF algorithm: reward model + value network + GAE + clipped objective + Kullback-Leibler penalty, powerful but heavy (four models, many hyperparameters).
-
Recent approaches lighten the structure: GRPO removes the value network (per-group advantage), DPO removes RL entirely (direct preferences); but value functions remain essential for long-horizon / agentic tasks, where reward only arrives at the end.
1. During training, one of the model's answers gets an 8 out of 10 from the reward model. What is still missing before deciding whether to reinforce this behavior?
2. Why does the actor-critic architecture make training more stable than raw policy gradient?
3. The critic gets carried away and assigns a huge advantage to one action. How does PPO's clipped objective react?
4. GRPO removes the value network by comparing a group of answers to the same prompt. Why do value functions remain essential for long-horizon agents anyway?