No value network: drops half the training memory and eliminates critic instability
Beats Rejection Sampling Fine-Tuning (RFT): in DeepSeekMath (1.3B), GRPO outperformed both offline and online RFT on GSM8K and MATH
Negative gradients matter: pushing down wrong trajectories ($A_i \lt 0$) improves far faster than only imitating correct ones
Later confirmed by Kimi K1.5's ablation against positive-only expert iteration (ReST)
Thinking Carefully: Is GRPO's Advantage a Valid Baseline?
REINFORCE with Baseline (Sutton & Barto): subtracting any function $b(s)$ of the state alone leaves the policy gradient unbiased:
$$\sum_a b(s)\,\nabla_\theta \pi(a|s,\theta) = b(s)\,\nabla_\theta \sum_a \pi(a|s,\theta) = b(s)\,\nabla_\theta 1 = 0$$
Subtracting the group mean $\mathrm{mean}(\{r_1,\dots,r_G\})$ approximates a valid prompt-dependent baseline $b(q)$
Dividing by $\mathrm{std}(\{r_1,\dots,r_G\})$ is NOT a valid baseline:
Rescales the gradient per prompt by $1 / \mathrm{std}(r|q)$
Upweights prompts with very low variance—i.e., too-easy or too-hard questions where almost all rollouts agree
Breaks gradient unbiasedness relative to the true expected reward objective
GRPO's Length Bias and the Dr. GRPO Fix
Original GRPO (biased terms in red):
$$\frac{1}{G}\sum_{i=1}^G \textcolor{#c00000}{\frac{1}{|o_i|}}\sum_{t=1}^{|o_i|} \min\!\big(\rho_{i,t}\hat{A}_i,\;\mathrm{clip}(\rho_{i,t},1\pm\epsilon)\hat{A}_i\big)$$
$$\hat{A}_i = \frac{r_i - \mathrm{mean}(\{r_j\})}{\textcolor{#c00000}{\mathrm{std}(\{r_j\})}}$$
Dr. GRPO (Liu et al., 2025 — unbiased):
Remove $\frac{1}{|o_i|}$ (constant normalizer) and drop $\mathrm{std}$:
$$\hat{A}_i = r_i - \mathrm{mean}(\{r_1,\dots,r_G\})$$
Response-level length bias from $\frac{1}{|o_i|}$:
When correct ($\hat{A}_i \gt 0$): shorter responses get larger per-token updates → favors brevity
When incorrect ($\hat{A}_i \lt 0$): longer responses get smaller per-token penalties → encourages longer wrong answers
Effect of Dr. GRPO: matches reward and benchmark accuracy while stopping output length inflation on incorrect responses
With a constant length normalizer and mean-only baseline, Dr. GRPO sits close to REINFORCE Leave-One-Out (RLOO).
How RLVR Started (Early 2025): DeepSeek-R1-Zero
Historical milestone (Jan 2025): proved pure outcome-based RL on a base LM scales reasoning without PRMs or MCTS.
Setup: base DeepSeek-V3 (Dec 2024; 671B total / 37B active) + GRPO with only:
Accuracy reward (correct final answer?)
Format reward (use <think> tags)
Why PRMs & MCTS failed to scale:
PRMs: hard to define/label intermediate steps; invite reward hacking
MCTS: token-level search space is vastly larger than board games
Overstated "aha" moment: Dr. GRPO showed base models already self-correct, and part of R1-Zero's length surge came from GRPO's length bias
Benchmark
o1-0912
R1-Zero
AIME 2024 (pass@1)
74.4
71.0
AIME 2024 (cons@64)
83.3
86.7
MATH-500 (pass@1)
94.8
95.9
GPQA Diamond
77.3
73.3
LiveCodeBench
63.4
50.0
CodeForces rating
1843
1444
Strong on math from pure RL, but suffered from poor readability and language mixing.
Cold-start SFT stabilizes early RL and improves readability (small data suffices: s1-32B bootstrapped strong math reasoning from 1K CoTs)
Language-consistency reward penalized mixed-language CoTs that emerged naturally during RL
General post-training after RLVR: 600K reasoning traces (filtered with V3 as judge) + 200K non-reasoning SFT, followed by GRPO-based RLHF (R1 reached 79.8% AIME 2024, 97.3% MATH-500)
Long-horizon emergence: average agent turns grew from 50 → 130 during RL
Warning sign of reward hacking: without blockers, the agent ran git remote add to restore deleted remotes and fetch ground truth
Next: how late-2026 frontier models rebuilt tasks, sandboxes, RL systems, and distillation around agents.
2026 Frontier: From Math Answers to Agents in Sandboxes
Multi-turn agentic RL is now the main workload
Software engineering, terminal operations, web search, and office workflows
Every rollout runs inside a sandboxed container with an executable verifier
DeepSeek-V4.1 (Sept 2026) task pipeline:
Defines each task as a triple: $(\text{problem},\; \text{environment},\; \text{verification system})$
Self-synthesizes tasks with the model itself and scores quality on difficulty and correctness
Trains across multiple agent scaffolds at once so skills do not overfit to one harness
Sandbox scale (DSec):
Runs millions of concurrent sandboxes across the cluster
Node-level tuning raised density from ~1,000 to >2,500 live containers per node (DeepSeek-V4.1 report)
Multi-Turn Agent Loops & Verifier Serving
Separate pools & async scoring: different verifier classes have wildly different latencies and resource needs
Two failure modes: a slow verifier stalls rollout batches; a buggy verifier systematically teaches the wrong behavior
Reward Hacking Becomes a Systems Security Problem
What RL Agents Actually Exploited
Git & repo leaks: restoring deleted remotes or inspecting future commits to fetch ground-truth patches
Kernel & driver bugs: escaping sandbox constraints during RL exploration
Package mirrors: leaking held-out answers over external or mirror networks
Destructive hacks: deleting system files to trick grading scripts into passing
DeepSeek-V4.1 Containment (DSec)
Per-sandbox AppArmor profiles: restrict syscalls and filesystem access tightly
eBPF network policies: isolate traffic and block unauthorized external or mirror leaks
Crash = failure: any environment crash is scored as a failed trajectory, removing the incentive to break the harness
When optimizing executable rewards at scale, every sandbox escape is a high-reward policy waiting to be found.
Non-Verifiable Tasks: Agentic Generative Judges
Many valuable tasks (writing, research synthesis, open-ended advice) lack unit tests—returning us to RLHF overoptimization.
Kimi K3 (July 2026) agentic judge: forces the reward model to explicitly write a rubric, score each candidate against it, and record scores
Binary tournament comparisons convert relative judgments into calibrated group rewards for RL
Why this helps against overoptimization: explicit rubric checks and pairwise tournaments are harder to exploit with superficial style hacks than a static scalar RM
RL Systems: Why Rollouts Dominate
On-policy = slow inference: every gradient step requires generating long reasoning traces and multi-turn tool calls
Two different software stacks:
Rollouts run on inference engines (SGLang, vLLM)
Training runs on distributed trainers (Megatron, FSDP) with different parallelism layouts
Uneven sequence lengths: long CoTs and multi-turn trajectories vary by orders of magnitude within a single batch
Making RL fast is primarily an inference-serving and scheduling problem.
The Long-Tail Problem: Synchronous vs. Asynchronous RL
Synchronous RL leaves most workers idle while one straggler finishes
Asynchronous RL keeps a fixed pool of samples in flight and trains as soon as enough groups complete
Async RL in Practice: Sample-Level Dispatch & Preemption
Design lessons from DeepSeek-V4.1 (Sept 2026):
Dispatch Granularity
Behavior
Outcome
Batch-level dispatch
Wait for whole batch to drain before launching next
Training metrics oscillated
Prompt-level dispatch
Dispatch only after all $G$ rollouts of a prompt finish
Pipeline stalled on slow prompts
Sample-level dispatch
Launch a new prompt as soon as finished samples fill one GRPO group
Smooth throughput & stable RL
Shared GPU time-sharing: rollout and training run on the same GPUs rather than splitting into static clusters
Token-granularity preemption:
When a training batch is ready, training pauses in-flight rollouts between decode tokens
KV cache and MoE expert routing are preserved, so rollouts resume immediately after the update without re-prefill
Four Complementary Fixes for the Rollout Long Tail
Technique
How It Works
Example / Evidence
Partial rollouts
Pause unfinished long generations at the iteration boundary; resume them in the next iteration
Introduced in Kimi K1.5; standard in async pipelines
Over-provisioning
Start more rollout requests than the batch needs; stop collecting once the target batch fills
APRIL; eliminates waiting on the slowest tail samples
Length bucketing
Group requests with similar expected output lengths into the same inference batches
Reduces decode-step padding and straggler waste
Online speculative decoding
Run speculative decoding inside rollout with draft models trained online as the policy shifts
Miles reported 25%+ speedup over a frozen MTP drafter
Online drafter updates matter because a frozen draft model loses acceptance rate as RL shifts the policy distribution.
Two Side Effects of Asynchronous RL
1. Async Length Bias
Short trajectories finish first, so early training batches systematically over-represent short answers
Fixes:
Per-dataset concurrency limits
Discarding early short samples before the steady-state length distribution fills the queue
2. Off-Policy Staleness
In-flight tokens may have been generated by an older checkpoint $\pi_{\theta_{\text{old}}}$
Fixes:
Bound maximum checkpoint staleness
Mask out the loss on tokens that are too stale
Connection back to PPO: PPO's clipped importance ratio $\mathrm{clip}\!\left(\frac{\pi_\theta}{\pi_{\theta_{\text{old}}}}, 1-\epsilon, 1+\epsilon\right)$ originally bounded multi-epoch updates—in async RL, the exact same mechanism also handles policy lag.
Weight Transfer: Trainer → Rollout Engine
Every policy step must reshard trainer layouts to engine layouts, optionally requantize, pause/resume the engine, and stamp a policy version
Point-to-point RDMA: each trainer rank sends its own shard directly (Mooncake TransferEngine)
LMSYS/Miles reported cutting Kimi-K2 FP8 weight sync from 53.3 s (NCCL) to 7.2 s on H100
Delta updates: only ~2% of BF16 parameters change per step, so sending deltas cuts transfer volume
At 1T scale: Moonshot reported checkpoint-engine updating a 1T-parameter model in ~20 s
Exact Token Capture & Decoupled RL Services
Exact token capture is mandatory in multi-turn RL:
Detokenizing a rollout to text and re-tokenizing chat messages silently changes token boundaries
Training then computes logprobs on trajectories that the policy never actually sampled
Solution: token-in-token-out servers and environment standards (OpenEnvreset/step/state, verifiers, Harbor, NeMo Gym) preserve exact sampled token IDs across external agent harnesses
Two ways to decouple the RL stack:
Rollout-as-a-service: move the agent loop, environments, and rewards behind HTTP APIs on CPU fleets (e.g., NeMo Gym separates agent, model, and resources servers)
Trainer-as-a-service: expose training and sampling as clean primitives while users own the loop (Thinking Machines' Tinker exposes forward_backward and sample)
A New Failure Mode: Train–Inference Mismatch
Different kernels, batching, and numerics make rollout and trainer assign slightly different probabilities to the exact same tokens
Standard monitoring: log rollout–trainer logprob gap directly (Miles train_rollout_logprob_abs_diff; verl IS-weight stats, effective sample size, KL)
Scale reality: exact zero gap is reached only on small dense models; large runs measure, bound, and correct it (Miles reported mean gap 0.0369 on a GLM-5.3 run, corrected with TIS)
Why Sparse MoE Makes Train–Inference Mismatch Worse
In a dense model, small rounding differences perturb outputs smoothly
In a sparse MoE (256–896 routed experts in 2026 frontier models), a tiny router logit shift flips a discrete top-$k$ choice
One flipped expert changes the entire downstream residual stream and compounds through every later layer
Mismatch Fixes 1 & 2: TIS and MoE Routing Replay
1. Truncated Importance Sampling (TIS)
Reweight each token loss by the truncated trainer-to-rollout probability ratio:
$$w_t = \min\!\left(\frac{\pi_{\text{train}}(a_t|s_t)}{\pi_{\text{rollout}}(a_t|s_t)},\; c\right)$$
Corrects off-policy drift without blowing up gradient variance
Exposed directly in frameworks (e.g., Miles --use-tis, used on GLM-5.3)
2. Routing Replay + FP32 LM Head
Record exact expert IDs chosen during rollout and replay them in the trainer forward pass
Nemotron 3.5 Super (Oct 2026): router replay + FP32 LM head cut trainer–inference KL by >1 order of magnitude(report)
MiniMax-M1 likewise traced mismatch to the LM head and fixed it in FP32
DeepSeek-V4.1: concatenates routing across segments when an async rollout spans checkpoints