intuitiveai

Frontier Reasoning & GRPO

Compare answers to the same prompt

GRPO samples a group of responses for one prompt and uses relative rewards to construct advantages, avoiding a learned value critic in this formulation. “No critic” does not mean no baseline, no reference model, or free training. Generation and scoring still cost compute.

Use this lesson after the RLHF policy-ratio explanation. The lab implements advantage normalization and a masked surrogate; it does not train a reasoning language model or demonstrate emergent reasoning.

Initializing Interactive Playground...

Trace reward → advantage → contribution

For rewards [0,0,1,1], mean=0.5 and population standard deviation=0.5. Advantages are [−1,−1,1,1]. Normalize within each prompt, not across unrelated prompts. If all rewards are equal, this implementation returns zero advantages.

For epsilon=0.2, ratio=1.4 and advantage=1, the clipped contribution is min(1.4,1.2)=1.2. For advantage=−1 it is min(−1.4,−1.2)=−1.4. Applying a clipped ratio unconditionally would discard the wrong-direction penalty.

The downloaded lab averages valid completion tokens within each response, then responses within a group. Prompt and padding tokens are excluded, and an empty completion is rejected. It uses a fixed old-policy probability ratio, no value network, and beta=0 to isolate the reward surrogate. Reference covers the separate KL term and its sampling assumptions.

Test the reward before trusting the update

A formatted wrong answer can earn positive relative advantage when the verifier rewards formatting too heavily. In our fixture, increasing the format bonus from 0 to 3 promotes a wrong-but-formatted completion above the group mean. Correctness remains unchanged.

Run adversarial checks: identical rewards, padded tokens, a negative advantage, and a wrong answer with the expected format. Keep a separate held-out correctness metric. Use strict parsers or sandboxed verifiers; never execute arbitrary generated code in your application process.

Experiment notes

Record your experiment

Set the new/old probability ratio to 1.4 and switch the advantage sign. Predict both clipped contributions, then test what changes when all group rewards are equal.

Feedback & sharing

Helpful?