Group-Based Policy Optimization › Why a Critic-Free Baseline?

Michael BrenndoerferNovember 29, 20266 min read
Language AI HandbookAll chapters
Part 40 of 67Reasoning Post-Training and Verifiable Rewards
Chapter 301Group-Based Policy Optimization › Why a Critic-Free Baseline?
Reading section 2 of 10 · Why a Critic-Free Baseline? · 6 minSection 2 of 10 · 6 min

Section 2 of 10 · 6 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

One ingredient of a PPO advantage estimator is the one-step temporal-difference residual:

δt=rt+γVϕ(st+1)−Vϕ(st),\delta_t = r_t + \gamma V_\phi(s_{t+1}) - V_\phi(s_t),

Here rtr_t is the reward after the current decision, γ\gamma discounts the next state’s value, and VϕV_\phi estimates discounted return. Set the next-state value to zero at a true terminal transition. In the language-model setting, sts_t is the prompt and generated prefix. A PPO implementation can fit a separate critic or add a value head to a shared backbone.

A critic adds resource costs and changes how PPO estimates the advantage.

  1. Memory and compute. A separately trained critic adds parameter storage and forward and backward computation. Optimizers that keep per-parameter state add memory for that state. The overhead depends on the critic’s size and what it shares with the policy.
  2. Hyperparameter sensitivity. If PPO uses generalized advantage estimation (GAE), the choice of its coefficient λ\lambda changes how strongly the estimate relies on bootstrapped values. The way the critic is fit also affects the advantage estimates.
  3. Bootstrapping error. A wrong estimate at the next state can bias a bootstrapped advantage estimate. Subtracting an action-independent baseline from a complete sampled return does not introduce that bias.

With outcome supervision, GRPO scores each complete response and uses its group to estimate relative quality. The response still consists of successive token decisions, and DeepSeekMath also describes a process-supervised variant with intermediate rewards. The critic-free baseline is the design choice in both variants.

Baselines in policy gradient methods

In an on-policy score-function estimator, draw aa from πθ(⋅∣s)\pi_\theta(\cdot\mid s). Here ss is what the policy conditions on before sampling, such as the prompt and generated prefix. A baseline b(s)b(s) can depend on that history and must be independent of the action drawn at that decision, conditional on ss. When subtracting it from a sampled return, hold the baseline fixed in backpropagation, even if it was computed from a model that shares policy parameters. For a differentiable policy with locally fixed action support, this baseline contributes zero in expectation because

Ea∼πθ[∇θlog⁡πθ(a∣s) b(s)]=b(s)∑a∇θπθ(a∣s)=b(s) ∇θ1=0.\mathbb{E}_{a \sim \pi_\theta}\left[\nabla_\theta \log \pi_\theta(a \mid s) \, b(s)\right] = b(s) \sum_a \nabla_\theta \pi_\theta(a \mid s) = b(s) \, \nabla_\theta 1 = 0.

An action-independent baseline can reduce variance. The within-group mean includes the current sample. Suppose the group contains independent completions from the same policy for a fixed prompt. In an unclipped on-policy update without standard-deviation scaling, use the full completion score, the sum of its token log-probability gradients. A completion’s own reward enters the mean at weight 1/G1/G. The full score has mean zero, so the other completions’ rewards have zero expected product with it. The expected centered update is (G−1)/G(G-1)/G times the uncentered gradient. A common multiplier fixed before sampling preserves this result. When G>1G>1, a leave-one-out mean is independent of the held-out completion and cancels in expectation under the same score condition. Standard-deviation scaling, clipping, and division by realized response length when lengths vary can change the calculation.

The group mean provides a prompt-specific comparison without a value network. Its uncertainty depends on the sample count and reward distribution, and it uses rollouts that still have to be generated and scored.

The variance argument is not only theoretical. The next cells compare three gradient estimators on a one-state bandit with a known reward vector: no baseline at all, the exact value as an oracle baseline, and the group mean of eight sampled actions. All three estimators reuse the same groups drawn from the same stochastic softmax policy. The seed makes the experiment repeatable. It does not make the policy deterministic or off-policy. The fixed value baseline is action-independent. The inclusive group mean uses the sampled action’s reward; that dependence, rather than a different sampling policy, accounts for the shift in expectation.

PythonIn [3]
CollapseExpand
import numpy as np

# One-state bandit with four actions, known rewards, and a fixed policy.
rng = np.random.default_rng(
    0
)  # seed fixed so the reported spreads are reproducible
theta = np.array([0.0, 0.4, -0.3, 0.2])
policy_probs = np.exp(theta - theta.max())
policy_probs = policy_probs / policy_probs.sum()
action_rewards = np.array([0.0, 0.25, 0.75, 1.0])

group_size = 8  # same group size as the toy training loop below
n_replicates = 4000  # Monte Carlo replicates per estimator

actions = rng.choice(4, size=(n_replicates, group_size), p=policy_probs)
# Verify that this is a shared, non-degenerate behavior sample.
assert np.all((policy_probs > 0) & (policy_probs < 1))
counts = np.bincount(actions.ravel(), minlength=4)
assert np.all(counts > 0)
print("Behavior probabilities:", np.round(policy_probs, 4))
print("Sampled action counts:", counts)
sampled_rewards = action_rewards[actions]  # shape (replicates, group)
score = np.eye(4)[actions] - policy_probs  # grad log pi(a) per sample

value_baseline = float(policy_probs @ action_rewards)


def gradient_estimate(baseline):
    """Average of (reward - baseline) * grad log pi over the sampled group."""
    centered = sampled_rewards - baseline
    return (centered[..., None] * score).mean(axis=1)


est_none = gradient_estimate(0.0)
est_value = gradient_estimate(value_baseline)
est_group = gradient_estimate(sampled_rewards.mean(axis=1, keepdims=True))

score_actions = np.eye(4) - policy_probs
true_grad = ((policy_probs * action_rewards)[:, None] * score_actions).sum(
    axis=0
)


def total_std(est):
    """Square root of the summed per-component variance of the estimator."""
    return float(np.sqrt(np.sum(est.var(axis=0))))


estimator_names = ["No baseline", "Oracle value", "Group mean (G=8)"]
estimators = [est_none, est_value, est_group]
summary_std = np.array([total_std(est) for est in estimators])
summary_error = np.array(
    [float(np.abs(est.mean(axis=0) - true_grad).max()) for est in estimators]
)
bar_positions = np.arange(len(estimators))

for name, spread, error in zip(estimator_names, summary_std, summary_error):
    print(f"{name:18s} std={spread:.4f}  max|error|={error:.5f}")
ConsoleOut [3]
CollapseExpand
Behavior probabilities: [0.2245 0.3349 0.1663 0.2742]
Sampled action counts: [ 7101 10810  5323  8766]
No baseline        std=0.1773  max|error|=0.00057
Oracle value       std=0.0972  max|error|=0.00116
Group mean (G=8)   std=0.0971  max|error|=0.01745
VisualizationOut [4]
CollapseExpand
Bar chart of gradient estimator spread for no baseline, oracle value, and group mean.
Spread of three policy-gradient estimators on a one-state bandit, measured as the square root of the summed per-component variance over 4000 replicates of eight sampled actions, with seed 0. The two baseline estimators have similar spread in this experiment. Spread measures precision around each estimator’s own mean. The inclusive group-mean estimator’s expected gradient is 7/8 of the true gradient.

Because this bandit’s probabilities and rewards are known, the code computes the exact gradient. The largest absolute coordinate error of the Monte Carlo mean is about 0.0170.017 for the inclusive mean and about 0.0010.001 for the other two estimators. These finite-run errors include sampling noise. Spread measures how much repeated estimates vary around their own expectation. The oracle estimator is centered on the true gradient, while the inclusive mean shrinks the expected gradient by (G−1)/G(G-1)/G. Similar spread can therefore accompany different bias.

Comments

Add to the conversation

A question, a correction, or an example from your own work.

No comments yet. Be the first to share your thoughts!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy