Training autonomous AI agents on large-scale engineering tasks traditionally hits a computational bottleneck: while a model spends hours interacting with an environment and generating million-token contexts, expensive graphics accelerators remain idle. The Alibaba Qwen team, together with specialists from Tsinghua University and the University of Science and Technology of China (USTC), has proposed an architectural solution to this problem — the QwenGyre system.
What makes multi-hour tasks difficult?
Modern software agents solve tasks that require hundreds of sequential steps and context windows ranging from 700,000 to 1 million tokens per rollout. During real-time reinforcement learning (RL), two bottlenecks arise:
- Massive capacity underutilization: with colocated infrastructure, the fine-tuning stage stalls while waiting for slow rollouts to finish; with an asynchronous approach, computing nodes remain idle while a data batch is being collected.
- Path redundancy: branching actions, retries after errors, and the delegation of subtasks to auxiliary agents generate duplicate chains, overloading the cluster’s memory.
QwenGyre architecture: flexibility and deduplication
To overcome hardware delays, the authors introduced two key components:
- Elastic Scheduler: this mechanism dynamically reallocates GPUs between generating inference rollouts and directly training the model without stopping active processes. Stream-based synchronization prevents load imbalances across the distributed network.
- Trajectory Processor: this module transforms branching logs into unified trees with shared prefixes. It removes duplicates, recalculates the weights of repeated tokens, and records the agent’s partial successes even if the task ends with an emergency timeout.
Test results and a speedup of up to 1.85x
Experiments showed that the framework delivers a significant performance increase without sacrificing training quality:
| Compared configuration | Speedup |
|---|---|
| Colocated deployment | 1.21x to 1.85x |
| Asynchronous setup | 1.38x to 1.78x |
The approach’s effectiveness was confirmed on the Qwen 3.6 122B architecture, using the DeepSWE and TerminalBench benchmarks, as well as on the flagship Qwen 3.8 2.4T model. With a workload of approximately 700,000 tokens per rollout, the larger model improved its accuracy on the NL2RepoBench repository benchmark by 6% — from 52.5% to 58.5% — in just 48 training steps.