AI State of the Art
SOTA/Alignement : instruction, RLHF, DPO et apprentissage par renforcement/30 min
Section 113

PPO, Value Functions, and Actor-Critic

Listen as a podcast →

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 π(a∣s)\pi(a \mid s), the agent's strategy: for a state ss, the probability of choosing action aa. For an LLM this is simply the model: "for this partial text, what is the probability of the next token?".

  • Reward rr, the immediate signal received after an action. Often sparse: in chess, you only learn who won at the very end.

  • Return GG, 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 γ\gamma that down-weights the distant future: Gt=rt+γrt+1+γ2rt+2+…G_t = r_t + \gamma r_{t+1} + \gamma^2 r_{t+2} + \dots

  • Value function V(s)V(s), the answer to the question: "how promising is this state?" Formally, it is the average return you can expect if you start from state ss and keep playing as usual. A winning chess position has high value, even before the final move.

  • Q function Q(s,a)Q(s, a), almost the same, but also fixing the action: "if I am in state ss and I play exactly action aa, what can I expect next?"

  • Advantage A(s,a)=Q(s,a)−V(s)A(s, a) = Q(s, a) - V(s), 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.

Advantage is the score relative to the average

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 (V(s)V(s)) 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 V(s)V(s). 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 πθ\pi_\theta. It acts: it generates the actions (the tokens).
  • The critic, a network that estimates the value function V(s)V(s). 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.

Diagram of the actor-critic architecture: inside the agent, an Actor network takes the state and outputs the policy, hence the action; a Critic network takes the state and the action and outputs V(s); the advantage Adv = Q(s,a) - V(s) is computed from these two outputs. The action goes to the environment, which returns a reward and a new state.
The agent's two networks side by side: the actor (top) turns the state into an action, the critic (bottom) turns the state into a value estimate V(s). It is the subtraction Adv = Q(s,a) - V(s), in the middle of the diagram, that produces the signal actually used to correct the actor.Source : GeeksforGeeks

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 critic is exactly this critic

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 VV 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 λ∈[0,1]\lambda \in [0, 1]. The symbol λ\lambda 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 λ\lambda. With λ\lambda near 0, you mostly trust the critic (low variance, but you depend on its accuracy). With λ\lambda 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 Algorithms

PPO'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:

ρt(θ)=πθ(at∣st)πold(at∣st)\rho_t(\theta) = \frac{\pi_\theta(a_t \mid s_t)}{\pi_{\text{old}}(a_t \mid s_t)}

The symbols: ρt\rho_t (the Greek letter rho) is the ratio at step tt; πθ\pi_\theta is the policy being trained, whose learned parameters are collectively called θ\theta (theta); πold\pi_{\text{old}} is the same policy as it stood when the responses were generated; ata_t is the action taken and sts_t 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 ρt=1\rho_t = 1, nothing changed; if ρt=1.5\rho_t = 1.5, the model makes this action 50% more likely. The clipped objective is then:

LCLIP(θ)=Et[min⁡(ρt(θ) At,  clip⁡(ρt(θ), 1−ε, 1+ε) At)]\mathcal{L}^{\text{CLIP}}(\theta) = \mathbb{E}_t \Big[ \min\big( \rho_t(\theta)\, A_t,\; \operatorname{clip}(\rho_t(\theta),\, 1-\varepsilon,\, 1+\varepsilon)\, A_t \big) \Big]

Let's decode it:

  • LCLIP\mathcal{L}^{\text{CLIP}}, the quantity to be maximized (papers call it an objective; it is a loss with the sign flipped). Et\mathbb{E}_t is the average taken over all steps tt in the batch.
  • ρt(θ) At\rho_t(\theta)\, A_t, the "natural" term: push the probability in the direction of the advantage AtA_t (more likely if At>0A_t > 0, less if At<0A_t < 0).
  • clip⁡(ρt,1−ε,1+ε)\operatorname{clip}(\rho_t, 1-\varepsilon, 1+\varepsilon), bound the ratio inside a narrow band. ε\varepsilon (epsilon) is the half-width of that band, a setting you choose; the experiments in the PPO paper use 0.20.2, and that has stayed the ecosystem default. With ε=0.2\varepsilon = 0.2, the ratio never counts as more than 1.21.2 or less than 0.80.8. Beyond that the gain is "capped": the policy gains nothing from pushing the action even further in a single step.
  • min⁡(⋅,⋅)\min(\cdot, \cdot), 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.

Table of the six possible cases of PPO's clipped objective, depending on where the ratio p_t sits relative to 1 minus epsilon and 1 plus epsilon and on the sign of the advantage A_t, showing in each case whether the objective is clipped and whether the gradient is zero. Below, two plots of L_CLIP against the ratio r: on the left for a positive advantage, the curve rises then flattens beyond 1 plus epsilon; on the right for a negative advantage, the curve is flat up to 1 minus epsilon then falls.
The two plots at the bottom show what clipping does. When the advantage is positive (left), the objective stops growing beyond 1 plus epsilon: pushing the action even harder buys nothing, so the gradient becomes zero (rows 4 and 5 of the table). Symmetrically on the right for a negative advantage. That ceiling is what stops the policy from taking too large a step at once.Source : Hugging Face Deep RL Course (PPO unit)
Why it is stable

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:

  1. 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.
  2. A value network (the critic) estimates, token by token, the total expected reward. It is trained alongside the policy.
  3. GAE turns those two signals into a clean, low-variance advantage.
  4. 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?

PPOGRPODPO
Value network (critic)Yes (trained separately)No (advantage estimated by groupNo) no RL at all
Where does advantage come from?Critic + GAEMean/std of a group of answersNone (direct comparison of pairs)
Reward modelYesYes or a verifierNo (direct preferences)
Clipped objectiveYesYes (inherited from PPO)No
ComplexityVery highModerateLow
  • 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.
Comparison of PPO and GRPO. Top, PPO: a query goes through the Policy Model which produces a single output, feeding a Reference Model, a Reward Model and a trainable Value Model; reward and value combine to give the advantage. Bottom, GRPO: the same query produces a group of outputs 1 to G, scored by the Reward Model, and a Group Computation step turns those rewards into advantages adv 1 to adv G, with no Value Model at all.
The whole difference fits in one box. On top, PPO needs a trainable Value Model (in yellow, the ones being trained) to compute the advantage: that is the critic. Below, GRPO samples several outputs for the same query and replaces that network with a plain group computation. The diagram makes visible what you save, and why PPO keeps four models in memory.Source : DeepSeekMath paper (figure 4), via AWS Labs Generative AI Atlas
  • 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.
Why understand PPO anyway

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

  1. The vocabulary: the policy acts, the reward scores, the return is the sum of future rewards, the value function V(s)V(s) says how promising a state is, and the advantage A=Q−VA = Q - V says whether an action did better than average.

  2. 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.

  3. GAE blends the estimate from real rewards (low bias, high variance) and from the critic (high stability, possible bias) through a dial λ\lambda: simply a bias/variance knob.

  4. PPO adds the clipped objective: by bounding the ratio πθ/πold\pi_\theta / \pi_{\text{old}} inside a narrow band and taking the pessimistic minimum, it stops the policy from changing too much at once, hence its stability.

  5. PPO was the historical RLHF algorithm: reward model + value network + GAE + clipped objective + Kullback-Leibler penalty, powerful but heavy (four models, many hyperparameters).

  6. 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.

Check your understanding0 / 4

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?