
TL;DR: GRPO (Group-Relative Policy Optimisation) on verifier output drives DeepSeek-R1 and many open reasoning models. When a reliable checker answers in seconds, that paradigm is the right starting point. Long agentic episodes break the assumptions behind a rollout group, because outcomes arrive late, carry only one bit, and land in a state the agent itself altered. This guide maps what each method needs from the environment and offers a decision table. It also explains our alternative under investigation: environment-filtered modified SFT (supervised fine-tuning) on bounded windows with fresh LoRA (Low-Rank Adaptation) adapters.
How GRPO Turns a Verifier Into a Gradient
Choosing between GRPO and modified SFT comes up for any agent that updates itself after deployment. That loop sits at the centre of continual recursive self-improvement.
Shao et al. (2024) introduced GRPO in the DeepSeekMath methodology paper as a critic-free policy gradient update. For each prompt, the policy samples a group of G completions. A reward function scores every completion. Each completion then receives an advantage equal to its score minus the group mean, divided by the group standard deviation.
The update builds directly on PPO (Proximal Policy Optimisation; Schulman et al., 2017). It keeps PPO’s clipped importance ratio and KL (Kullback-Leibler) divergence penalty against a reference model. However, it drops the learned value network entirely. In PPO, that critic predicts expected reward per token and matches the policy in parameter count. Here, the sampled group itself supplies the baseline.
RLVR: Verifiable Rewards for GRPO
A verifiable checker supplies the reward function. Lambert et al. (2024) named this setup RLVR (reinforcement learning with verifiable rewards) in the Tulu 3 post-training report. Instead of training a learned reward model on human preferences, the training loop queries a deterministic checker. An exact match on a mathematics problem or a passing unit test suite returns the score directly.
Later reasoning models scaled that pairing to frontier workloads. The DeepSeek-R1 technical report applied rule-based accuracy and format checks at scale without neural reward models.
Open post-training frameworks now ship group-relative RLVR as a standard stage. For example, TRL on GitHub (Transformer Reinforcement Learning), verl, and prime-rl all maintain ready-to-run trainers.
What GRPO Needs From the Environment
Three environmental assumptions sit inside the group-relative update:
- Fast per-completion checking: The verifier must score every completion in every group at every training step. Its latency sits directly inside the optimisation loop.
- Within-group reward variance: When all G completions earn the same score, every standardised advantage equals zero and the prompt contributes no gradient. Yu et al. (2025) address this with DAPO (Decoupled Clip and Dynamic Sampling Policy Optimisation) in their DAPO dynamic sampling paper. Their method oversamples prompts and discards groups whose rollouts are all correct or all wrong.
- Cheap parallel rollouts: Generating G completions per prompt at every step must fit the compute budget, because the group replaces the critic as the baseline estimator.
Statistical priors inside the update also deserve attention. Shao et al. (2025) ran the Spurious Rewards RLVR study on Qwen2.5-Math-7B and found that random rewards recovered most of the MATH-500 gain achieved by ground-truth labels. Clipping amplified existing high-prior behaviours such as code reasoning, though that effect failed to transfer to Llama 3 or OLMo 2 models. The clip and group normalisation carry priors of their own, and a verifier gain guarantees only that the policy met the checker’s rule.
Where RL With Verifiable Rewards Is the Stronger Default
Group-relative RL (reinforcement learning) excels in domains that match those three assumptions. Competition mathematics offers one unambiguous answer per prompt. Code generation tasks against unit tests return a clean binary result in seconds.
In both domains, the checker runs cheaply and deterministically on every candidate. Teams can resample the exact same prompt with zero side effects. Early in training, a batch of 8 to 16 completions per prompt naturally mixes passing and failing answers, which gives the group baseline rich signal.
Filter-Then-Fine-Tune Methods Next to GRPO
Rejection-sampling fine-tuning operates in the same verifiable profile and offers a clean point of comparison. Zelikman et al. (2022) introduced STaR (Self-Taught Reasoner) in their rationale bootstrapping paper, filtering chains of thought that reach a correct answer before fine-tuning again.
Singh et al. (2023) formalised that loop as ReST-EM (Reinforced Self-Training, modified to use expectation-maximisation) in the ReST-EM self-training paper. Their pipeline alternates sampling, binary verification, and supervised updates, scaling reliably with model size on MATH and APPS.
Both methods are simple to implement, yet they throw away every failed completion. By contrast, a policy gradient extracts signal from failures too through negative advantages inside each group. Whenever a fast, reliable checker gives mixed outcomes per batch, RLVR captures that extra information for free and remains the stronger default.
When the Environment Breaks the Group
Now move the same optimiser into a stateful agentic environment. An agent works for several minutes inside networked Linux containers, freeing disk space, patching files, or draining balances on a forked blockchain. At the end of the episode, the environment checks a conserved physical or financial quantity once.
Nothing in group-relative RL mathematically forbids a sparse, outcome-only reward. In fact, reasoning models train on terminal correctness scores every day. What breaks in long agent loops is the group’s usefulness as a baseline, for four environmental reasons rather than reward density.
Rollout Cost and Verifier Latency
The first barrier is rollout cost. Sampling 8 to 16 completions per prompt takes seconds of decoding when each rollout is a 2,000-token proof. When each rollout runs a ten-minute multi-container episode with full environment resets, the same group costs over an hour of wall-clock time per prompt. Policy updates per day drop by two to three orders of magnitude.
The second barrier is verifier latency. In an interactive sandbox, the environment itself acts as the verifier. It emits a verdict only after the agent finishes or times out, so training stalls until the slowest container in the group completes.
Comparability and Signal Shape
The third barrier is comparability across rollouts. Group advantage normalisation assumes every completion in the group starts from the identical state. When an agent’s shell commands or transactions persist, rollout one alters the world before rollout two begins.
Forking one container snapshot G times restores comparability when compute allows. Even then, snapshot forking changes the learning problem: the optimiser tunes the policy for one frozen state while the deployed agent lives inside states its own history built. That self-induced distribution shift appears in every continual agent loop regardless of the optimiser.
The fourth barrier is signal shape. Disk space freed or token balances drained follow heavy-tailed distributions. Most episodes change nothing, while occasional episodes move huge totals. Dividing raw returns inside an eight-rollout group scales everything by a standard deviation set by a single outlier. Converting the outcome to one binary bit, persisted or not, removes the outlier spike, yet leaves very little variance to standardise across slow ten-minute runs.
Environment-Filtered Modified SFT: What Changes and What Does Not
The alternative we are investigating keeps the agent inside the live environment and moves selection out of the gradient. The agent executes episodes freely. The loop keeps a trajectory only if its change to the conserved quantity persists after execution, which serves as the environment’s binary verdict.
Every few generations, the pipeline trains a fresh LoRA adapter directly on the frozen base model. That adapter learns from a bounded sliding window of the most recent surviving trajectories, mimicking training adapters nightly at the cadence of the environment.
Each structural boundary serves a clear purpose. The bounded window caps how far back stale state can pull the policy. Training fresh from the base model stops quantization or rank drift from compounding across adapters. Meanwhile, old adapters stay on disk strictly as a rollback safety net if held-out metrics drop.
The Modified SFT Loss Without a Reward Model
The loss modification is a separate component from the adapter schedule. Training runs supervised cross-entropy on surviving rows with loss-level adjustments rather than reward modelling.
In the dynamic variant, each token’s cross-entropy multiplies by the model’s detached probability for that token. That weighting damps rare, high-surprisal exploratory tokens that otherwise cause gradient spikes, known as DFT (Dynamic Fine-Tuning) in our confidence-weighted token loss guide.
In the anchored variant, the objective keeps that detached probability weighting while adding a forward KL divergence term against the frozen reference policy. Holding that distribution tether limits vocabulary drift across cycles, the ASFT (Anchored Supervised Fine-Tuning) method detailed under anchored SFT KL regularization.
No reward model scores tokens or directs updates inside the loss. Because the environment performs all triage upstream and training simply consolidates surviving behaviour, we refer to this loop as approximate policy-free online learning. It remains approximate because a hard survival filter acts as a degenerate binary reward and each fresh adapter still revises an active policy.
Why Modified SFT Instead of GRPO on Survivors
Teams often ask why not run GRPO directly on the surviving dataset instead. In our Negative Space Learning paper (Dodgson et al., 2026), we studied a disk-space container sandbox where each generation collected 4,500 agent rows alongside 500 rehearsal rows from Stack Exchange Paired, a corpus older than the base model.
On that regime, the paper evaluated PPO, DPO (Direct Preference Optimisation), and GRPO against standard supervised updates on surviving trajectories. Supervised consolidation proved the most stable across 13 generations. The authors hypothesised that low-variance supervised updates consolidate externally validated behaviours without amplifying noise, whereas reinforcement updates reintroduce proxy optimisation inside an already filtered dataset.
Pairwise methods such as Rafailov et al. (2023) rely on matched chosen and rejected pairs, which are hard to assemble when environmental trajectories diverge across states. We later extended those supervised updates with token-level weighting and KL anchoring in our modified SFT stack. Still, that stability comparison reflects one sandbox environment and one 7B model size. It says nothing against RL in domains with fast checkers, and it leaves open key questions around window length, skill retention, and separating genuine adaptation from window noise.
How Modified SFT Differs From ReST-EM
The high-level loop (generate, filter, fine-tune, repeat) looks close to ReST-EM, so four structural differences matter:
- Physical persistence over checkers: Selection checks whether a world effect persisted, removing the requirement for an external answer checker.
- Bounded recency window: Data ages out after a fixed generation window instead of accumulating forever across non-stationary states.
- Fresh LoRA per cycle: Every cycle initialises a new adapter from frozen base weights instead of continuing gradient steps on the same checkpoint.
- Reweighted token loss: Loss weighting damps unlikely exploratory tokens instead of weighting every token in a passing episode equally.
None of this constitutes classic static SFT on human demonstrations, nor is it policy-gradient RL. Any single surviving trajectory supplies usable training rows immediately, which is why this paradigm helps sparse-feedback SFT vs RL deployments when early success rates sit near zero.
A Decision Table and a Switching Protocol
The choice depends on properties of the environment rather than model scale. Compare both paradigms across the seven dimensions below before writing training code.
| Environment property | Favours RL with verifiable rewards | Favours environment-filtered modified SFT |
|---|---|---|
| Verifier latency | Seconds, per completion, inside the training step | Minutes, once per episode, after the fact |
| Verifier reliability | A deterministic checker whose verdict is the goal | No checker; the only verdict is whether an effect persisted |
| Rollout cost | Cheap enough for 8 to 16 samples per prompt per step | One episode per state; a group costs hours |
| Within-group variance | Groups mix correct and incorrect early in training | Most groups are all-failed or identical |
| State across episodes | The prompt resets cleanly without side effects | The agent’s actions set the next starting state |
| What the update optimises | The verifier score, through standardised advantages | Nothing; it consolidates what survived |
| Estimator issues to watch | Clipping bias that amplifies base-model priors | A window that tracks noise; forgetting of general skills |
Switching Protocol for New Environments
Run through these six checks in one afternoon to pick the right training loop for a new agent environment:
- Time the verifier. If a per-completion score arrives in seconds for every rollout, the RL path stays open. If only an end-of-episode verdict exists, that path closes regardless of model size.
- Measure group variance. Sample 16 rollouts across 50 prompts from your current policy and count groups with identical scores. When most groups carry zero variance, you need either dynamic sampling or modified SFT.
- Check whether state forks cleanly. If containers fork to one snapshot G times cheaply and deployed agents face that same snapshot, snapshot RL works well. If every episode inherits the state left by the previous run, group baselines describe a vanished world.
- When RL fits, anchor with KL. Run group-relative RL with a KL penalty against the base checkpoint using a standard trainer, and evaluate a fixed held-out suite at every step.
- When RL stalls, log outcomes and filter. Record every episode with its persistence verdict, keep survivors in a bounded window, and fit a fresh LoRA per cycle with modified loss. Score every adapter and the base model on the same held-out suite, keeping the prior adapter ready for rollback.
- Combine both on hybrid tasks. Unit tests inside a container work as a deterministic filter rather than a full gradient. You can run RLVR on verifiable sub-tasks first, then place the resulting policy into an environment-filtered continual loop. Self-play and open-ended tasks, where task distributions shift alongside the policy, rely most heavily on the environment itself as ground truth.
FAQs
Does group-relative RL need a dense reward?
No. Modern reasoning models train on a single terminal score per completion, and group-relative advantages handle binary pass/fail rewards well. What the optimiser actually needs is cheap rollouts, fast per-step checking, and non-zero score variance within each group. Multi-minute agentic episodes break those three environmental assumptions first.
Is environment-filtered modified SFT just rejection-sampling fine-tuning?
Both share the generate, filter, fine-tune, repeat skeleton used in ReST-EM, yet four mechanisms differ. Selection checks real environmental persistence rather than a test oracle, the training buffer uses a bounded window, every cycle resets a fresh LoRA on the base model, and the loss reweights tokens. Each change addresses non-stationary drift.
How do I know the bounded window is tracking the environment rather than noise?
Evaluate every fresh adapter and the frozen base model on a fixed held-out probe suite, and replay older adapters against newer environment snapshots. A healthy window keeps probe scores stable while improving performance on recent snapshots. A noisy window degrades the suite without gaining on current tasks, triggering rollback.
When should I use GRPO instead of modified SFT?
Use GRPO whenever a fast, reliable verifier scores completions inside the training step, rollouts stay cheap enough to sample per-prompt groups, and early attempts mix successes and failures. Competition mathematics and unit-tested code generation fit this profile cleanly. Slow multi-turn sandboxes with persistent state favour environment-filtered modified SFT.
Why does GRPO need variance inside each group?
The update normalises each completion’s reward relative to the mean and standard deviation of its prompt group. Whenever every completion in a group receives the same score, every standardised advantage equals zero and contributes no policy gradient. Dynamic sampling algorithms such as DAPO therefore oversample and drop uniform groups.


