Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Hugging Face 21 min read Case study hardMaster

Unlocking Agentic RL Training for GPT-OSS: A Practical Retrospective

Agentic RL training of GPT-OSS-20B in verl initially failed with exploding gradient norms, KL and entropy, and flat rewards. The LinkedIn team traced this to three problems. First, MoE routing nondeterminism made on-policy PPO importance ratios deviate from 1, fixed by reusing the detached current log-prob as the old log-prob. Second, a training–inference mismatch between SGLang/vLLM and FSDP was partly mitigated with sequence-level rollout correction. Third, and most important, FlashAttention v2 lacks support for GPT-OSS attention sinks, so the team took the forward pass from vLLM's FlashAttention v3 fork and implemented the sink-gradient backward pass, deriving the gradient formula. With the fix, training is stable and rewards improve steadily on GSM8K, verifiable instruction following and multi-turn ReTool tool use; the post also covers FSDP memory blow-ups caused by repeated MoE expert materialization.

Assumes: PPO/GRPO reinforcement learningMixture of Experts modelsattention and FlashAttentionFSDP training

Related posts

  • Engineering and algorithmic interventions for multimodal post-training at Microsoft scale

    Engineering@Microsoft hardMaster

    Production-scale RL post-training of multimodal Copilot agents fails silently because policy gradient advantage estimates lose informativeness even as aggregate reward climbs. Five interventions address this: a staged curriculum (verifiable rewards only for the first 30% of training, with an entropy floor), an adaptive loop that injects near-miss trajectories when effective sample size drops below 20%, per-trajectory gradient normalization by σ_source·sqrt(length) to cut gradient concentration (Gini ~0.75 to ~0.35), softplus constraint penalties plus an annealed parallelism reward to avoid serial collapse, and mixed-horizon sampling instead of horizon curricula. ESS collapse proved a leading indicator of learning stalls by about 35 epochs, and each fix comes with explicit costs such as ~15% memory overhead or lower peak single-horizon performance.

  • vLLM V0 to V1: Correctness Before Corrections in RL

    Hugging Face hardMaster

    Migrating PipelineRL's rollout generation from vLLM V0 (0.8.5) to V1 (0.18.1) caused training metrics (clip rate, KL, entropy, reward) to diverge. Matching the V0 reference took four backend fixes: setting logprobs-mode=processed_logprobs so returned logprobs reflect temperature and top-k/top-p processing, explicitly disabling V1's default prefix caching and async scheduling, reproducing V0's inflight weight-update semantics with pause_generation(mode="keep", clear_cache=False), and computing the lm_head in fp32 to match the trainer. Batch invariance and the logprob-mode fix alone did not close the gap. The broader recommendation is to restore inference-backend correctness before adding objective-side off-policy corrections such as truncated importance sampling, so those corrections don't hide backend bugs.

  • Diagnosing instability in production-scale agent reinforcement learning

    Engineering@Microsoft hardMaster

    Late-phase instability in on-policy RL for tool-using agents can come from variance amplification in tool-conditioned contexts. Post-tool states fall in low-support regions of the reference policy, so importance-ratio tails grow while loss, reward, entropy and global KL stay flat. A small-scale reproduction shows p95 per-token log-ratio growth and right-tail CDF stretching in post-tool slices, with effective sample size used as a supporting signal; constraining tool outputs or drift-aware baselines suppressed the growth. The proposed fix is monitoring rather than a new optimizer: slice diagnostics by pre-tool versus post-tool contexts, track tail percentiles in-stream across workers, and treat KL caps and rollbacks as load-bearing guardrails. These checks ship in Microsoft's open-source Post-Training Toolkit, now integrated into Hugging Face TRL.

  • IBM and UC Berkeley Diagnose Why Enterprise Agents Fail Using IT-Bench and MAST

    Hugging Face mediumAdept

    Applying the MAST failure taxonomy to 310 annotated ITBench SRE agent traces shows that frontier models fail in isolated ways (Gemini-3-Flash averages 2.6 failure modes per failed trace). Open models fail through cascading errors (Kimi-K2 4.7, GPT-OSS-120B 5.3), where an early reasoning-action mismatch poisons context and leads to derailment. Incorrect verification is the strongest predictor of failure overall: agents declare success without checking ground truth. Kimi-K2 struggles mainly with termination, and GPT-OSS-120B loses conversation history in 24% of traces. The recommended fixes are architectural rather than prompt tweaks: external tool-based verification gates, termination and loop control via state machines outside the model, explicit clarify-or-read-only branches, and aggressive context hygiene.

  • Toward RL on mixed-precision, mixed-accelerator samplers

    Modal hardMaster

    RL training of Qwen3.6-35B-A3B on agentic coding stays stable when samplers run on six accelerator types (A100 through B300, RTX PRO 6000) in NVFP4, FP8 and BF16 with their own kernels, feeding a BF16 trainer on B200. Uncorrected GRPO collapses on both mixed and homogeneous samplers. Only score centering plus masked importance sampling (optionally with top-p mask replay) trains to the end, matching homogeneous-sampler SWE-bench Pro V2 pass@4 despite 4.7× larger sampler–trainer KL, at about 15% lower sampling cost per update. The central claim is that stability depends on whether mismatch keeps growing, not on its size, so off-policy correction can stand in for bitwise-identical on-policy matching. Collapse shows up as falling reward, KL growing 3× or more, and episodes ending when the model stops calling its tool.

The quest for software engineering knowledge.

Look:
Layout: