PRM-guided GRPO (v0.71.30)

soup train --task grpo can now use a trained Process Reward Model as the per-step reward signal, the o1-era process-supervision idea: grade every reasoning step, not just the final answer. Point it at a PRM you trained with soup train --task prm and it scores each step of a generated answer, folding the per-step scores into one reward that GRPO optimizes.

No OSS fine-tuning CLI ships a PRM as the per-step GRPO reward.

Config

yaml
task: grpo
backend: transformers        # required (the PRM reward runs a transformers forward)
modality: text               # required
data:
  format: chatml
  train: ./grpo_prompts.jsonl
training:
  prm_reward: ./my-prm       # a `soup train --task prm` checkpoint dir, or an HF id
  prm_aggregate: min         # min (weakest-link, default) | prod | last
  num_generations: 4
  grpo_beta: 0.04
  • prm_reward replaces reward_fn; TRL logs it as rewards/prm_reward, and the v0.71.26 reward-hack controller observes it like any other reward.
  • prm_aggregate folds the per-step scores into one number. min is the weakest-link default and the safe choice; prod assumes calibrated [0,1] step scores (it can blow up or flip sign on uncalibrated labels); last uses the final step.
  • Step boundaries are a newline heuristic; each step is scored with one PRM forward pass.

Bundled rollout environments

v0.71.30 also ships three deterministic, pure-Python toy environments so the GRPO openenv rollout path works with no external setup:

yaml
training:
  rollout_backend: openenv
  rollout_func: soup_cli.envs.calculator:rollout   # or retrieval_qa | guess_number
  reward_fn: verifiable
  verifiable_domain: math

Ready-made recipes: grpo-env-calculator, grpo-env-retrieval-qa, grpo-env-guess-number (part of catalog 134 to 137). They are single-shot prompt/answer seeders (the live openenv contract passes seed prompts, not the model), not interactive multi-turn episodes.

Honesty

Proof-of-mechanism only, validated on SmolLM2-135M with a tiny synthetic PRM and synthetic reward on a single RTX 3050, not a production reward-model claim. Scale validation is tracked in issue #286.

See also

  • GRPO Plus — the 7 GRPO variants, rollout backends, and stability controls this builds on.
  • Online DPO — the judge-in-the-loop RL alternative when you have a judge instead of a PRM.
  • RLVR — verifiable rewards for math / code / JSON with no reward model at all.