Compute group-relative advantages, inspect a clipped policy objective, distinguish old and reference policies, and audit reward and normalization choices.
Preparation: averages, probability ratios and the RLHF lesson; college adds standard deviation.
Plan 25–40 minutes with the activities; this is a study estimate, not a timed requirement. Both paths have complete narration. Your notes and progress are kept separately for each level.
FULL LOCAL NARRATION
Follow the complete explanation.
Narration includes worked solutions. Pause at each practice prompt before continuing. Formula notation has a spoken explanation; all teaching text remains readable.
College path. Compute group-relative advantages, inspect a clipped policy objective, distinguish old and reference policies, and audit reward and normalization choices. Preparation: averages, probability ratios and the RLHF lesson; college adds standard deviation. Move between Signal Room, Workbench and Field Notes without losing your section. Pause before each worked solution.
Group relative policy optimization, or G R P O, uses several sampled responses to the same prompt to build a relative learning signal. A response rewarded more highly than its group can receive positive advantage; one below the group can receive negative advantage. The original method avoids a separately learned value critic by using group statistics. It still needs rewards and policy optimization. Rewards may come from a learned model or a task-specific function, depending on the system. Our experiment freezes a group of four one-token responses so every calculation can be inspected.
GRPO is a training method, unlike test-time sampling that leaves weights fixed. The original DeepSeekMath formulation uses token-level probability ratios, group-relative advantages, a clipped surrogate and a reference-policy penalty. Avoid conflating “no value critic” with “no reward model”: those are different components. Our one-token categorical fixture removes sequence-length effects and uses illustrative rewards; it is an objective calculation, not a training run.
Worked example. For one prompt, imagine four sampled responses rewarded zero, zero, one and one. Their mean reward is one half. The first two are below that mean and the last two above it. The comparison is within this prompt’s group, not a global ranking of unrelated questions.
Prompt → group of sampled responses → rewards → relative advantages → policy objective
The displayed notation records the process described in the example. Keep its assumptions and units attached to the result.
Try it yourself. Does removing the value critic mean GRPO no longer requires a reward signal?
Pause the narration and explain your reasoning before continuing to the worked solution.
Reveal worked solution
No. Rewards are needed to form the group-relative advantages. The source of those rewards is a separate design decision from using or omitting a learned value critic.
Section 02 / 07
Center the rewards and state the scale
Subtracting the group mean makes advantages relative to the other attempts. Dividing by a standard deviation can put differently scaled reward groups on a comparable numerical scale. Our Workbench explicitly uses population standard deviation: average the squared deviations using the group size, then take a square root. Other implementations can use different conventions or omit this scaling. You must name the convention before expecting identical numbers. The fixture’s reward scale slider changes all rewards together, while its last-reward multiplier changes the shape of the group.
With population standard deviation and nonzero variance, centered standardized rewards have mean zero and mean square one. A positive rescaling and common offset leave these standardized advantages unchanged. A sample standard deviation divides by group size minus one and yields different magnitudes. Floating-point safeguards and small denominators also affect implementation. We use an exact zero-variance branch rather than pretending division by zero is meaningful.
Worked example. For rewards zero, zero, one and one, the mean is 0.5. Every squared deviation is 0.25, so population variance is 0.25 and standard deviation 0.5. The advantages are minus one, minus one, one and one.
A_i = (r_i−mean(r))/sqrt(mean((r−mean(r))²))
The displayed notation records the process described in the example. Keep its assumptions and units attached to the result.
Try it yourself. If all four rewards are multiplied by two, what happens to these standardized advantages?
Pause the narration and explain your reasoning before continuing to the worked solution.
Reveal worked solution
They stay the same under our positive-scale, nonzero-variance convention. Both centered differences and standard deviation double. Raw rewards change, but the standardized relative signal does not.
Section 03 / 07
Handle a group with no relative signal
If all responses receive the same reward, subtracting the mean gives zero for every response and the standard deviation is also zero. The ratio is undefined without a convention. Our experiment sets all advantages to zero in this case. That means the group supplies no relative preference for one sampled response over another. A reference penalty may still contribute to the objective away from the reference. Uniformly low rewards and uniformly high rewards are different outcomes for the task, even though both can have no within-group relative signal.
Zero-variance groups can arise when all answers pass, all fail or the reward is too coarse. Normalization does not manufacture information that is absent. Implementations often use a small denominator stabilizer and report the fraction of zero-variance groups; exact behavior should be checked in the chosen code. Altering prompt difficulty, sampling diversity or reward design changes the data-generating process and must be evaluated rather than treated as an automatic fix.
Worked example. Set the reward scale to zero. All four rewards become zero, and the fixture reports zero advantages. At current policy equal to reference, the entire displayed objective is zero. Move the current policy away: the relative-reward term stays zero, but a positive reference penalty can make the objective negative.
If std(r)=0: A_i=0 in this fixture; no within-group ranking signal
The displayed notation records the process described in the example. Keep its assumptions and units attached to the result.
Try it yourself. Does a group of four equally rewarded failures tell GRPO which one is best?
Pause the narration and explain your reasoning before continuing to the worked solution.
Reveal worked solution
No. The group contains no reward distinction. The training system needs a meaningful signal or different data to learn a relative preference from that prompt.
Section 04 / 07
Keep the old policy separate from the reference
The old policy is the policy that generated the sampled group. The current policy is the one being optimized. Their probability ratio tells the objective how the likelihood of a sampled action changed. A reference policy serves a different role: it anchors a penalty against drift. In our fixture both old and reference distributions start uniform over four one-token responses, but their roles remain distinct. One slider shifts current probability toward the last two responses. All four probabilities stay positive and sum to one, so the ratios come from a valid distribution.
Let the current logits be zero, zero, u and u. Then the last pair receives total probability sigmoid of u, split equally between its two outcomes. With old probabilities one quarter, each sampled action ratio is four times its current probability. In a real token-level objective, the ratio conditions on the prompt and sampled prefix; replacing it with a whole-sequence ratio changes the estimator and optimization behavior.
Worked example. At u zero, the current distribution is uniform and every ratio equals one. At u equal to log three, each last-pair outcome has probability 0.375 and ratio 1.5; each first-pair outcome has probability 0.125 and ratio 0.5. The current distribution is still normalized.
ρ_i = π_current(i)/π_old(i); π_old(i)=1/4 in the fixture
The displayed notation records the process described in the example. Keep its assumptions and units attached to the result.
Try it yourself. Why should “old policy” and “reference policy” not be treated as interchangeable names?
Pause the narration and explain your reasoning before continuing to the worked solution.
Reveal worked solution
The old policy determines the sampling ratio for an update. The reference defines a separate drift penalty. They can coincide initially but may follow different update schedules and serve different mathematical roles.
Section 05 / 07
Clip the surrogate without inventing a hard constraint
The clipped surrogate takes the smaller of two terms: probability ratio times advantage, and clipped ratio times advantage. The sign of advantage matters. For a positive advantage, excessively increasing the ratio stops improving this surrogate term beyond the upper clip point. For a negative advantage, excessively decreasing the ratio is limited by the lower clip point. This is not the same as forcibly clipping the actual policy probabilities or guaranteeing a maximum full-distribution distance. The Workbench shows unclipped and clipped terms for every sampled outcome.
We maximize the mean clipped surrogate, then subtract a reference penalty. Each response is one token, so token and sequence averaging coincide here; the fixture cannot demonstrate real length-normalization bias. At u zero with advantages minus one, minus one, one and one, the mean surrogate value is zero but its derivative with respect to u is one half. A zero objective value is therefore not evidence that the learning signal vanishes.
Worked example. With advantage one, ratio 1.5 and clip width 0.2, the minimum of 1.5 and 1.2 is 1.2. With advantage minus one and ratio 0.5, the minimum of minus 0.5 and minus 0.8 is minus 0.8. Averaging two of each yields 0.2.
S_i = min(ρ_i A_i, clip(ρ_i,1−ε,1+ε) A_i)
The displayed notation records the process described in the example. Keep its assumptions and units attached to the result.
Try it yourself. Why can a zero mean surrogate at the old policy still produce a policy update?
Pause the narration and explain your reasoning before continuing to the worked solution.
Reveal worked solution
The current value and its derivative are different quantities. Positive-advantage actions and negative-advantage actions respond differently to a probability shift, producing a nonzero gradient even when their current values cancel.
Section 06 / 07
Read the reference penalty with its sampling assumptions
The original GRPO formulation includes a reference-policy penalty. Our fixture displays a nonnegative per-sample expression built from the reference-to-current probability ratio, and also displays the exact categorical KL divergence separately. These numbers need not match when averaged over our frozen group. A sampled estimate depends on which distribution supplied the samples. Keeping both visible prevents a common error: treating every finite sampled penalty as the exact full-distribution divergence. Beta controls the strength of the displayed penalty; setting it to zero removes this term in the fixture.
For x equal to reference probability divided by current probability, the sample expression is x minus log x minus one. Its expectation under the current policy equals KL of current relative to reference when both distributions are normalized on the same support. Our frozen group contains each action once and was specified under a uniform old policy, so its equal-weight average generally differs from that current-policy expectation. We label it a frozen-group penalty rather than asserting unbiasedness here.
Worked example. At current probability equal to reference probability, x is one and the sample expression is zero. When current probabilities move away, individual terms become positive. Weighting all four terms by current probabilities recovers the exact categorical KL; averaging them equally generally does not.
k_i = x_i−log(x_i)−1; x_i=π_ref(i)/π_current(i)
The displayed notation records the process described in the example. Keep its assumptions and units attached to the result.
Try it yourself. What missing detail makes “this sample penalty equals KL” an incomplete claim?
Pause the narration and explain your reasoning before continuing to the worked solution.
Reveal worked solution
The sampling or weighting distribution matters. The expectation identity uses the current policy. A finite or differently weighted group is not automatically the exact divergence.
Section 07 / 07
Audit the recipe and the behavior it teaches
GRPO is a family of practical training choices as well as a published objective. Reward normalization, response-length averaging, clipping, reference penalties and sample reuse can differ across implementations. A trainer bearing the name does not guarantee every default matches the original paper. Inspect the actual recipe. Then evaluate held-out task success, reward exploitation, response length and resource use. Passing a reward check is useful only to the extent that the check represents the intended task. Training progress should improve independently measured behavior, not merely produce longer or more confident explanations.
The original response-length-normalized formulation and newer token- or constant-normalized losses have different weighting behavior. Group standardization can also change question-level weighting. Current TRL documentation explicitly distinguishes these options. Our fixed four-response, one-token fixture teaches the original clipped structure with a stated population-standard-deviation convention; it does not claim numerical parity with a particular trainer version, simulate sampled rollouts or establish memory savings on hardware.
Worked example. Suppose a math reward accepts any response ending in the expected numeral. A policy may learn formatting shortcuts while its supporting claims remain poor. Add independent solution checks and held-out problems, and document whether the objective rewards outcome alone or intermediate steps.
The displayed notation records the process described in the example. Keep its assumptions and units attached to the result.
Try it yourself. What should accompany a claim that a GRPO training run improved reasoning?
Pause the narration and explain your reasoning before continuing to the worked solution.
Reveal worked solution
Provide the exact training recipe, data and reward definition, held-out results with uncertainty, comparisons under matched conditions and failure examples. Include compute and length statistics. Our objective calculation alone cannot establish that claim.
Final checkpoint. Does an equal-weight frozen-group penalty always equal exact KL(current || reference)? Option 1: Yes. Option 2: No; the weighting distribution matters. Option 3: Only beta determines this.
Pause and choose an answer before continuing.
Reveal worked solution
Option 2 is correct. The expectation identity uses current-policy weights. The frozen group can have different weights.
WORKBENCH / PREDICT → TEST → EXPLAIN
Inspect exact numerical data
These are computed teaching fixtures. No remote AI model or GPU is called by the experiment.
CHECK YOUR UNDERSTANDING
Commit to an explanation.
Keep your learning record.
LONGER SEARCH AND VERIFICATION LESSONS
Compare answers, explore paths and check steps
Worked examples, local narration and connected experiments at your level.
Original worked examples and teaching text, grounded in these primary references. Numerical fixtures explain mechanisms; model quality and hardware performance require separate measurements. Both levels share key examples, with different explanations and checkpoints.