---
title: "Unlocking Agentic RL Training for GPT-OSS: A Practical Retrospective"
description: "Agentic RL training of GPT-OSS-20B in verl initially failed with exploding gradient norms, KL and entropy, and flat rewards."
url: "https://swe.quest/articles/unlocking-agentic-rl-training-for-gpt-oss-a-practical-retrospective-2439023c679282b9"
canonical: "https://huggingface.co/blog/LinkedIn/gpt-oss-agentic-rl"
source: "Hugging Face"
published: "2026-01-27"
difficulty: "hard"
kind: "Case study"
reading_minutes: 21
tags: ["model-training","llms","ai-agents","debugging"]
---

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

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2026-01-27, 21 min read, Case study. Original: [https://huggingface.co/blog/LinkedIn/gpt-oss-agentic-rl](https://huggingface.co/blog/LinkedIn/gpt-oss-agentic-rl)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Model training](https://swe.quest/tags/model-training.md) (AI & ML)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [Debugging](https://swe.quest/tags/debugging.md) (Engineering practices)

## Prerequisites

- PPO/GRPO reinforcement learning ([easy posts on Model training](https://swe.quest/tags/model-training.md?difficulty=easy))
- Mixture of Experts models
- attention and FlashAttention
- FSDP training ([easy posts on Model training](https://swe.quest/tags/model-training.md?difficulty=easy))

## Keywords

GPT-OSS, verl, FlashAttention v3, attention sinks, PPO, FSDP, SGLang, ReTool

## Related posts

- [Engineering and algorithmic interventions for multimodal post-training at Microsoft scale](https://swe.quest/articles/engineering-and-algorithmic-interventions-for-multimodal-post-training-at-fe8208ec9b40ef0c.md): Engineering@Microsoft · 2026-02-27 · Hard · 10 min read · Model training, AI agents, LLMs, Machine learning
  Production-scale RL post-training of multimodal Copilot agents fails silently because policy gradient advantage estimates lose informativeness even as aggregate reward climbs.
- [vLLM V0 to V1: Correctness Before Corrections in RL](https://swe.quest/articles/vllm-v0-to-v1-correctness-before-corrections-in-rl-4dc68bef7cff8909.md): Hugging Face · 2026-05-06 · Hard · 7 min read · Model training, Inference & serving, LLMs, Debugging
  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.
- [Diagnosing instability in production-scale agent reinforcement learning](https://swe.quest/articles/diagnosing-instability-in-production-scale-agent-reinforcement-learning-d64c85292b24dcc4.md): Engineering@Microsoft · 2026-01-28 · Hard · 6 min read · Model training, AI agents, Observability, LLMs
  Late-phase instability in on-policy RL for tool-using agents can come from variance amplification in tool-conditioned contexts.
- [IBM and UC Berkeley Diagnose Why Enterprise Agents Fail Using IT-Bench and MAST](https://swe.quest/articles/ibm-and-uc-berkeley-diagnose-why-enterprise-agents-fail-using-it-bench-and-mast-8ef90262771faa1d.md): Hugging Face · 2026-02-18 · Medium · 10 min read · AI agents, Evaluation, LLMs, SRE
  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).
- [Toward RL on mixed-precision, mixed-accelerator samplers](https://swe.quest/articles/toward-rl-on-mixed-precision-mixed-accelerator-samplers-1c0dc5519077aec1.md): Modal · 2026-10-13 · Hard · 17 min read · Model training, Inference & serving, LLMs, Hardware, Cost optimization
  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.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
