Debug a broken GRPO implementation with wrong grouping, wrong masks, and wrong old-logprob

Correctness, Debugging, and Performance Experiments6 / 8

Chapter 266 / 8

Correctness, Debugging, and Performance Experiments

Debug a broken GRPO implementation with wrong grouping, wrong masks, and wrong old-logprob

Hard

Debug a broken GRPO implementation with wrong grouping, wrong masks, and wrong old-logprobs.

Target interface
grpo_loss(logits, old_logprobs, actions, group_ids, rewards, completion_mask, eps=0.2)

Complete the starter code in the editor. Any correct approach is accepted.

Hints0 / 2
Reference solution
Your own code stays in the editor.