Group-Based Policy Optimization › Why a Critic-Free Baseline?
Language AI HandbookAll chapters One ingredient of a PPO advantage estimator is the one-step temporal-difference residual:
Here is the reward after the current decision, discounts the next state’s value, and estimates discounted return. Set the next-state value to zero at a true terminal transition. In the language-model setting, 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.
- 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.
- Hyperparameter sensitivity. If PPO uses generalized advantage estimation (GAE), the choice of its coefficient changes how strongly the estimate relies on bootstrapped values. The way the critic is fit also affects the advantage estimates.
- 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.
In an on-policy score-function estimator, draw from . Here is what the policy conditions on before sampling, such as the prompt and generated prefix. A baseline can depend on that history and must be independent of the action drawn at that decision, conditional on . 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
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 . The full score has mean zero, so the other completions’ rewards have zero expected product with it. The expected centered update is times the uncentered gradient. A common multiplier fixed before sampling preserves this result. When , 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]Expand
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]Expand
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]Expand

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 for the inclusive mean and about 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 . 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!