LearnQuestion bank

GRPO normalises rewards within a group by subtracting the mean and dividing by the standard deviation. For binary rewards with pass rate p on a prompt, derive the advantages of correct and incorrect samples, the total advantage magnitude per prompt with and without the std division, and explain the difficulty bias that Dr. GRPO identified.

ResearchTechnicalHard

Answer it yourself first, out loud or on paper, then compare.

Answer

Model answer, written in a candidate's voice

In short

  • Mean p, std sqrt(p(1-p)); correct A = sqrt((1-p)/p), incorrect A = -sqrt(p/(1-p)).
  • Expected total |A| per prompt: with std division 2G sqrt(p(1-p)); without it 2G p(1-p).
  • Ratio = 1/sqrt(p(1-p)), growing as p -> 0 or 1, up-weighting near-all-correct/all-wrong prompts.
  • Dr. GRPO fix: drop std division and per-response length normalisation (long wrong answers penalised less per token).
  • p = 0 or 1 gives zero advantage either way; motivates dynamic sampling of mixed-outcome prompts.

In full

For a prompt with pass rate p, the group mean is p and the binary std is sqrt(p(1-p)), so a correct sample gets (1-p)/sqrt(p(1-p)) = sqrt((1-p)/p) and an incorrect sample gets -p/sqrt(p(1-p)) = -sqrt(p/(1-p)). Averaging over G samples, the expected total absolute advantage is Gp*sqrt((1-p)/p) + G(1-p)*sqrt(p/(1-p)) = 2G sqrt(p(1-p)) with std division, versus Gp(1-p) + G(1-p)p = 2G p(1-p) without it. The ratio is 1/sqrt(p(1-p)), which grows as p approaches 0 or 1, so std normalisation up-weights prompts that are nearly all-correct or all-wrong relative to unnormalised advantages. Dr. GRPO’s fix is to drop the std division and the per-response length normalisation, which otherwise lets long wrong answers be penalised less per token. At p = 0 or p = 1 both forms give zero advantage, which motivates dynamically sampling mixed-outcome prompts rather than spending rollouts on prompts with no within-group signal.

Checked against sources by an independent AI reviewer.

What a strong answer covers

  • Group mean p and std √(p(1−p)); correct samples get (1 − p)/√(p(1−p)) = √((1−p)/p), incorrect ones −√(p/(1−p)).
  • Expected total |A| per prompt over G samples: with std division 2G√(p(1−p)); without it 2G·p(1−p).
  • The ratio of the two is 1/√(p(1−p)), which grows as p approaches 0 or 1, so std normalisation up-weights prompts that are nearly all-correct or all-wrong relative to unnormalised advantages.
  • States Dr. GRPO’s fix: drop the std division (and the per-response length normalisation, which lets long wrong answers be penalised less per token).
  • Notes p = 0 or 1 gives zero advantage either way, motivating dynamic sampling of mixed-outcome prompts.

Common mistakes

  • Claiming std normalisation changes the sign of advantages or only rescales all prompts equally.

Follow-ups

  • Is up-weighting hard prompts ever desirable, and how would you test it?