Editorial illustration for Alibaba Qwen Unveils QwenGyre: Elastic RL for Long-Horizon Agents
Alibaba Qwen Launches QwenGyre for Long-Horizon AI Agents
Alibaba's Qwen team built a reinforcement learning framework for agents that don't finish their job in minutes. QwenGyre, released this week by the Qwen group, trains coding agents on rollouts that stretch for hours and chew through close to a million tokens each, a scale that breaks most existing RL setups built for short-horizon tasks.
The framework works through unmodified, black-box harnesses, meaning it doesn't require rewriting the agent scaffolding to fit the training loop. Alibaba tested it on two models: Qwen 3.6 at 122B parameters and the flagship Qwen 3.8 at 2.4T. The 122B runs used 24 to 32 GPU nodes; the 2.4T run scaled up to 192 nodes split into four cells of 48. Megatron handles training, SGLang serves the rollouts.
Two core mechanics drive the system. One shifts idle GPUs between rollout generation and training as demand shifts. The other converts the branching, unpredictable histories that long agent runs produce into training samples with fixed, bounded size. That second piece addresses a problem specific to XLong-horizon work: agent trajectories that fork across hours of tool calls don't fit neatly into standard RL batches.
On the 2.4T model, QwenGyre finished 48 steps in 75.42 hours. Async took 134.55 hours and Colocate took 91.47 hours. Evaluation pass rate rose from 52.48% to 58.54%.
Why this matters
QwenGyre is a bet that the real bottleneck in agent training isn't model size, it's infrastructure plumbing. Most RL frameworks assume a clean, single trajectory per rollout. Real coding agents don't work that way: Claude Code and similar harnesses compact context, spawn sub-agents, retry on failure.
That produces branching trees of execution, not straight lines, and naive implementations duplicate shared work across every branch. Qwen's answer, splitting GPUs into cells with a shared training layout, is a direct response to that mess rather than a theoretical improvement.
For teams building long-horizon agents, this is worth watching closely. If GPUs can actually move between rollout and training without idling, and if cells can share structure across branching trajectories, training costs for hour-long, million-token episodes could drop meaningfully. We'd want to see benchmarks against standard RL pipelines before taking the efficiency claims at face value.
Alibaba hasn't published full comparative numbers here. But the design target, unmodified black-box harnesses at production scale, suggests this is meant for real deployment, not just research demos.
Common Questions Answered
What is QwenGyre and how does it differ from traditional reinforcement learning frameworks?
QwenGyre is Alibaba's elastic reinforcement learning framework designed specifically for long-horizon agents that require hours to complete tasks and process close to a million tokens per rollout. Unlike traditional RL setups built for short-horizon tasks, QwenGyre works through unmodified, black-box harnesses, meaning it doesn't require rewriting agent scaffolding to fit the training loop, making it more flexible and practical for complex coding agents.
What performance improvements did QwenGyre achieve on the 2.4T model compared to other methods?
QwenGyre completed 48 steps in 75.42 hours on the 2.4T model, significantly faster than the Async method which took 134.55 hours and the Colocate method which took 91.47 hours. Additionally, the evaluation pass rate improved from 52.48% to 58.54%, demonstrating substantial gains in both speed and accuracy.
Why is handling branching execution trees important for coding agents in QwenGyre?
Real coding agents like Claude Code don't follow simple linear execution paths; they compact context, spawn sub-agents, and retry on failures, which produces branching trees of execution rather than straight lines. QwenGyre addresses this by splitting GPUs into cells to avoid duplicating shared work across branches, making it suitable for the complex, non-linear nature of modern coding agents.
What is the main bottleneck that QwenGyre addresses in agent training?
According to the framework's design philosophy, the real bottleneck in agent training isn't model size but infrastructure plumbing. QwenGyre solves this by efficiently managing the computational demands of long-horizon tasks that span hours and process millions of tokens, rather than assuming clean, single trajectories per rollout like most traditional RL frameworks.