For the policy-gradient estimate , derive the constant baseline that minimises variance. Then take a one-state problem with , , rewards and . Compute and the variance for , and . Is the average reward the best baseline?
Reinforcement learning, Policy gradients
Level L4 Advanced. Length Long. Nature Mat Mathematical.
What's being asked
Whether you can minimise the variance of the policy-gradient estimator over a baseline and see that the optimum is weighted by the squared score, not the plain mean reward.
Key idea
The mean of does not depend on , so minimising variance means minimising . This gives with the score , a reward average weighted by the squared score norm.
Steps
- Because (the score has zero mean), the mean of is for every . Variance is .
- Minimise . Differentiate: , and this is convex in , so .
- The example. For the scores are and . The true gradient is .
- Compute and . So .
- Variances . For : . For : . For : .
- Interpret. At every sample gives for and for , the exact gradient. The average reward gives the largest variance of the three.
- Conclude. The average reward (or a state-value baseline ) is a good, convenient choice, but it is not the variance minimiser. The optimum weights reward by , so rare actions with big score norms count more. Zero variance here is special: one parameter and two actions.
Common mistakes
- Saying is optimal. It is optimal only if is independent of .
- Allowing to depend on the sampled action. That changes the mean and introduces bias, unless the correction term is added back.
- Expecting one scalar baseline to be optimal for every component of a vector . The formula with minimises the total variance summed over components.
How long your answer should be
A page; 8–10 minutes.
Last checked on 4 December 2026.
Read this
Previous in Reinforcement learning: A duelling DQN has a value stream and an advantage stream. For one state, and for three actions. Compute using (a) , (b) and (c) . Why is (a) not identifiable, and what do (b) and (c) fix?
Next in Reinforcement learning: A shaped reward is for some potential function . Prove that the optimal policy does not change. If , and , what bonus does the agent get on the move , and what does the bonus sum to along a whole episode?