Diagnosing instability in production-scale agent reinforcement learning
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.
Related posts
- Engineering and algorithmic interventions for multimodal post-training at Microsoft scale
Engineering@Microsoft hardMasterProduction-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.
- TRL v1.0: Post-Training Library Built to Move with the Field
Hugging Face mediumAdeptTRL v1.0 turns Hugging Face's post-training codebase, now covering 75+ methods and downloaded 3M times a month, into a library with an explicit stability contract. A semver-governed stable core (SFT, DPO, reward modeling, RLOO, GRPO trainers) sits alongside a fast-moving trl.experimental namespace. Methods are promoted based on the ratio of usage to maintenance cost. Because post-training paradigms keep shifting (PPO to DPO to RLVR/GRPO), the design deliberately avoids shared base classes and generic abstractions and accepts near line-for-line duplication between trainers like RLOO and GRPO, illustrated by the failed Judge abstraction. A comparison against OpenRLHF, veRL, PRIME-RL, Tinker, LLaMA-Factory and others positions TRL as broad, low-infrastructure and stable but lacking native tensor parallelism, with asynchronous GRPO planned next.
- vLLM V0 to V1: Correctness Before Corrections in RL
Hugging Face hardMasterMigrating 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.
- Unlocking Agentic RL Training for GPT-OSS: A Practical Retrospective
Hugging Face hardMasterAgentic 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.
- Reinforcement learning is an infrastructure problem
Modal mediumAdept
RL post-training of LLMs is bottlenecked by infrastructure rather than algorithms: training engines, rollout inference and isolated environments must all scale together, and once training goes multi-node, trainer-to-rollout weight sync dominates. Measured estimates show RDMA cutting weight transfer roughly 60x versus TCP (e.g. GLM 4.7 from 115 s to 1.8 s per step), and delta compression shrinking WAN transfers for disaggregated setups by about 98%. Teams commonly struggle with glue code, cluster queueing and GPUs starved by environments; the guidance is to keep at least one sandbox per rollout plus headroom for failures. Modal recommends building on open-source frameworks like slime and verl, upstreams improvements such as delta compression, and introduces Modal Dojo, an experimental library for defining RL jobs in under 100 lines.