Evaluation lab · San Francisco · London · Zürich
Reinforced Labs Request a briefing
Glossary

Baseline (policy gradient)

Also called: reinforcement baseline, reward baseline, control variate

A baseline is a value subtracted from the return in a policy gradient update. It leaves the gradient unbiased but can cut its variance dramatically.

In policy gradient methods, a baseline is any quantity that does not depend on the action and is subtracted from the return before it scales the gradient. It does not change the expected gradient, but a good baseline greatly reduces the variance of the estimate, so learning needs fewer samples.

Definition and why it is unbiased

The baseline-corrected estimator is . It stays unbiased because the score function has zero mean under the policy:

Here is the sampled return and the policy. The baseline acts as a control variate: it removes a component of the estimate that is pure noise.

Worked example

A two-armed bandit has a softmax policy with both arms at probability 0.5. Arm 1 always pays 10 and arm 2 always pays 11. The score for logit is after pulling arm 1 and after arm 2. The true gradient is .

  • No baseline: the estimate is or . Its mean is , but its variance is about 27.6. Every sample points strongly in a random direction.
  • Baseline : the estimate is or . Same mean, variance zero.

A seeded simulation of 100,000 pulls gives sample variances of 27.56 and 0.0. Rewards that are large relative to the differences between actions are exactly the case where a baseline helps most.

Common choices

  • A running average of recent returns, the simplest option.
  • A learned state-value estimate , which makes an estimate of the advantage and turns the method into actor-critic.
  • The mean reward of other samples for the same input, as in leave-one-out REINFORCE and GRPO for language models.

A baseline must not depend on the current action; one that does generally biases the gradient.

Why it matters

Without a baseline, policy gradients are often too noisy to train anything larger than a toy. The choice of baseline is a large part of what separates REINFORCE, actor-critic, PPO and group-based methods used in RL for language models, and it is usually where the real sample-efficiency gains come from.

Sources

  1. Ronald J. Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning, 1992. doi.org
  2. Richard S. Sutton, Andrew G. Barto. Reinforcement Learning: An Introduction (2nd edition), 2018. incompleteideas.net

Know the number before you ship.

A 45-minute working session with an evaluation engineer. Bring one use case; leave with a threat model, a draft eval plan with sample sizes, and an honest read on where you stand.