跳到主内容
@wquguru
精选88MarkTechPost(RSS)技巧与观点多源精选 ×2

阿里Qwen发布QwenGyre弹性强化学习框架

Alibaba Qwen Introduces QwenGyre: Elastic Reinforcement Learning RL for XLong-Horizon Agents

原文
发到 X
推荐理由

Agent RL 训练效率痛点明显,QwenGyre 的弹性调度与轨迹压缩方案提供了可复用的工程思路,值得做 Agentic 的同学参考。

Alibaba’s Qwen team has introduced QwenGyre, an elastic reinforcement learning RL framework for extreme-long-horizon agent training. QwenGyre is an online reinforcement learning system from Alibaba that trains coding agents through unmodified, black-box harnesses. It targets rollouts that run for hours and process close to 1M tokens. The QwenGyre elastic RL framework was used on Qwen’s flagship Qwen 3.8 2.4T model. It rests on 2 core ideas. It moves idle GPUs between rollout and training. It also turns branching agent histories into bounded training samples.

阿里巴巴 Qwen 团队推出了 QwenGyre,这是一个用于超长视界智能体训练的弹性强化学习 RL 框架。QwenGyre 是阿里巴巴推出的在线强化学习系统,通过未经修改的黑盒工具链训练代码智能体。它针对运行时间长达数小时且处理近 100 万 token 的 rollout。QwenGyre 弹性 RL 框架已应用于 Qwen 的旗舰模型 Qwen 3.8 2.4T。其基于两个核心理念:在 rollout 和训练之间移动空闲 GPU;以及将分支化的智能体历史转化为有界的训练样本。

TL;DR

TL;DR(太长不看版)

  • Size: A training framework, not a model. Tested on Qwen 3.6 122B and Qwen 3.8 2.4T (A95B per Qwen), with ~700K tokens per rollout.
  • Runs on: Multi-node GPU clusters. The 122B runs used 24 to 32 nodes; the 2.4T run used 192 nodes (4 cells of 48). GPU model not disclosed. Megatron trains, SGLang serves rollouts.
  • Performance: 1.38x to 1.78x faster than Async, 1.21x to 1.85x faster than Colocate, at matched scores.
  • Best: 1.85x end-to-end speedup over Colocate on TerminalBench.
  • Worst: Only 1.21x over Colocate on the 2.4T model, where many queries ran near the timeout.
  • Bottom line:
  • Best: NL2RepoBench rises from 52.5% to 58.5% in 48 steps.
  • Worst: the paper links no public code release.
  • 规模:这是一个训练框架,而非模型。已在 Qwen 3.6 122B 和 Qwen 3.8 2.4T(据 Qwen 数据为每节点 A95B)上测试,每次 rollout 约含 70 万 token。
  • 运行环境:多节点 GPU 集群。122B 版本使用 24 至 32 个节点;2.4T 版本使用 192 个节点(4 个由 48 个组成的单元)。GPU 型号未公开。Megatron 负责训练,SGLang 负责服务 rollout。
  • 性能:在得分相当的情况下,比 Async 快 1.38 倍至 1.78 倍,比 Colocate 快 1.21 倍至 1.85 倍。
  • 最佳表现:在 TerminalBench 上,相比 Colocate 实现了 1.85 倍的端到端加速。
  • 最差表现:在 2.4T 模型上仅比 Colocate 快 1.21 倍,因为许多查询接近超时。
  • 结论:
  • 最佳表现:NL2RepoBench 在 48 步内从 52.5% 提升至 58.5%。
  • 最差表现:论文未链接任何公开代码发布。

What problem does QwenGyre solve?

QwenGyre 解决了什么问题?

The research team defines ‘XLong-horizon’ tasks as agent runs spanning hours and hundreds of model and tool interactions. Examples include generating full repositories from specs, as in NL2Repo-Bench.

研究团队将‘XLong-horizon’任务定义为持续数小时并涉及数百次模型和工具交互的智能体运行。示例包括根据规范生成完整仓库,如 NL2Repo-Bench 所示。

Two problems appear at this scale:

在此规模下出现两个问题:

  • First, rollouts have long tails. In a Colocate setup, training waits for the slowest execution while GPUs idle. In an Async setup, fixed GPU pools cannot lend spare capacity to each other.
  • Second, harnesses like Claude Code compact context, spawn sub-agents and retry. One execution becomes a branching tree, not a single trajectory. Expanding every path duplicates shared prefixes and inflates training cost.
  • 首先,rollout 存在长尾效应。在 Colocate 设置中,训练需等待最慢的执行过程,导致 GPU 闲置。在 Async 设置中,固定的 GPU 池无法互相借用空闲容量。
  • 其次,像 Claude Code 这样的工具会压缩上下文、生成子智能体并重试。一次执行变成一个分支树,而非单一轨迹。展开每条路径都会复制共享前缀,从而推高训练成本。

How does the Elastic Scheduler work?

弹性调度器如何工作?

QwenGyre splits GPUs into cells that share a training layout. Each cell can serve rollouts or host a full training replica. A core cell owns the authoritative weights and optimizer state. Satellite cells join training later.

QwenGyre 将 GPU 划分为共享相同训练布局的单元。每个单元可服务于 rollout 或托管完整的训练副本。核心单元拥有权威权重和优化器状态。卫星单元随后加入训练。

The scheduler tracks a rollout waterlevel: queued and running executions. As executions finish, cells switch to training once the remaining cells can still serve all live work. Model calls are rerouted through a proxy, so the harness keeps running.

调度器跟踪 rollout 水位线:排队中和正在运行的执行任务。随着执行完成,一旦剩余单元仍能服务所有活跃工作,单元即切换至训练模式。模型调用通过代理重新路由,以便工具链继续运行。

Key mechanics:

关键机制:

  • KV-cache blocks migrate over RDMA during rerouting, reducing prefix recomputation.
  • Satellites pull core weights through Mooncake’s Transfer Engine and join an ongoing batch.
  • Streaming training lets cells claim micro-steps as data becomes ready.
  • Average role switches took 8.52 s (rollout to training) and 3.46 s (training to rollout).
  • 在重路由过程中,KV缓存块通过RDMA迁移,从而减少前缀重新计算。
  • 卫星节点通过Mooncake的传输引擎拉取核心权重,并加入正在进行的批处理。
  • 流式训练允许单元格在数据就绪时认领微步(micro-steps)。
  • 平均角色切换耗时为8.52秒(从 rollout 到 training)和3.46秒(从 training 到 rollout)。

How does the Trajectory Processor build training samples?

轨迹处理器如何构建训练样本?

A proxy records exact token IDs and behavior log-probabilities using token-in, token-out (TITO). Calls are stored as prefix-shared trajectory trees.

代理使用 token-in、token-out (TITO) 记录精确的 token ID 和行为对数概率。调用请求被存储为共享前缀的轨迹树。

  • Partial scoring: Timed-out executions are still scored on their preserved workspace. Evaluator failures are excluded, never treated as a zero reward.
  • Bounded sampling: At most 5 trajectories per execution are kept, ranked main > main-summary > sub-agent > sub-agent-summary.
  • Deduplication: Shared targets count once, and only policy-generated tokens are trained.
  • Fair weighting: Losses average within each execution, so extra branches do not inflate its weight.
  • 部分评分:超时的执行仍基于其保留的工作区进行评分。评估器失败会被排除,绝不被视为零奖励。
  • 有界采样:每次执行最多保留5条轨迹,按主要 > 主摘要 > 子代理 > 子代理摘要排序。
  • 去重:共享目标只计一次,且仅训练由策略生成的 token。
  • 公平加权:损失在每个执行内部平均,因此额外的分支不会膨胀其权重。

A cap of 5 matched uncapped training scores while cutting forward-backward time by 25.2%. Training uses an adapted GSPO with 16 rollouts per group.

限制匹配无上限的训练分数,同时将前向-反向时间减少了25.2%。训练采用适配的GSPO算法,每组包含16次 rollout。

How fast is QwenGyre? Benchmark results

QwenGyre的速度有多快?基准测试结果

All runs used Claude Code 2.1.220 as the harness, with equal GPU budgets and matched staleness.

所有运行均使用 Claude Code 2.1.220 作为框架,GPU预算相等且陈旧度匹配。

Workload (model)vs Asyncvs Colocate
NL2RepoBench (Qwen 3.6 122B, 48 steps)1.42x to 1.53x1.36x to 1.47x
DeepSWE (Qwen 3.6 122B, 24 steps)1.569x to 1.572x1.610x to 1.824x
TerminalBench (Qwen 3.6 122B, 24 steps)1.383x to 1.430x1.809x to 1.849x
NL2RepoBench (Qwen 3.8 2.4T, 48 steps)1.78x1.21x
工作负载(模型)对比异步对比共置
NL2RepoBench (Qwen 3.6 122B, 48步)1.42x 至 1.53x1.36x 至 1.47x
DeepSWE (Qwen 3.6 122B, 24步)1.569x 至 1.572x1.610x 至 1.824x
TerminalBench (Qwen 3.6 122B, 24步)1.383x 至 1.430x1.809x 至 1.849x
NL2RepoBench (Qwen 3.8 2.4T, 48步)1.78x1.21x

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%.

在2.4T模型上,QwenGyre在75.42小时内完成了48步。异步模式耗时134.55小时,共置模式耗时91.47小时。评估通过率从52.48%提升至58.54%。

How does QwenGyre compare with other agentic RL frameworks?

QwenGyre与其他智能体强化学习框架相比如何?

FeatureQwenGyreveRLAReaLAgent Lightning
DeveloperAlibaba QwenByteDance Seed + communityTsinghua IIIS + Ant GroupMicrosoft
LicenseNot disclosedApache-2.0Apache-2.0MIT
GPU placementElastic cells, switch mid-rolloutFlexible device mapping, HybridEngine reshardingFully asynchronousNot disclosed
Black-box harnessYes, via proxyNot disclosedYes, via base_url swapYes, near-zero code change
Training / rolloutMegatron / SGLangFSDP, Megatron / vLLM, SGLangMegatron, FSDP, Archon / vLLM, SGLangNot disclosed
Largest stated scaleQwen 3.8 2.4T671B modelsNot disclosedNot disclosed
Headline speedupUp to 1.85x vs ColocateNot disclosed2.77x vs synchronous (v0.3)Not disclosed
Public codeNot disclosedYesYesYes
特性QwenGyreveRLAReaLAgent Lightning
开发者阿里巴巴 Qwen字节跳动 Seed + 社区清华大学 IIIS + 蚂蚁集团微软
许可证未公开Apache-2.0Apache-2.0MIT
GPU 部署弹性单元,中途切换(switch mid-rollout)灵活的设备映射,HybridEngine 重分片完全异步未公开
黑盒工具链是,通过代理未公开是,通过 base_url 交换是,近乎零代码改动
训练/ rolloutMegatron / SGLangFSDP, Megatron / vLLM, SGLangMegatron, FSDP, Archon / vLLM, SGLang未公开
最大声明规模Qwen 3.8 2.4T671B 模型未公开未公开
headline 加速比相比 Colocate 最高提升 1.85x未公开相比同步方式(v0.3)提升 2.77x未公开
公开代码未公开是是是

Speedups come from each project’s own setup and are not directly comparable.

加速效果源于各项目各自的设置,因此不可直接比较。

Key Takeaways

关键要点

  • QwenGyre moves GPUs between rollout and training without stopping live agents.
  • Trajectory trees cap samples at 5 per execution and train shared prefixes once.
  • Timed-out runs still get scored on their partial work.
  • Up to 1.85x faster than Colocate and 1.78x faster than Async.
  • Qwen 3.8 2.4T NL2RepoBench improved from 52.5% to 58.5% in 48 steps.
  • QwenGyre 在不中断在线智能体的情况下,在 rollout 和训练之间移动 GPU。
  • 轨迹树将每次执行的样本数限制为 5 个,并对共享前缀仅训练一次。
  • 超时的运行仍会根据其部分工作获得评分。
  • 比 Colocate 快 1.85 倍,比 Async 快 1.78 倍。
  • Qwen 3.8 2.4T 在 NL2RepoBench 上的表现从 52.5% 提升至 58.5%,共 48 步。

Check out the full QwenGyre paper on arXiv and Qwen’s announcement post. All credit goes to the researcher of this project. Also, feel free to follow us on Twitter and don’t forget to join our 150k+ML SubReddit and Subscribe to our Newsletter. Wait! are you on telegram? now you can join us on telegram as well.

请在 arXiv 上查看完整的 QwenGyre 论文以及 Qwen 的公告文章。所有功劳归于该项目的研究人员。此外,欢迎在 Twitter 上关注我们,别忘了加入拥有 15 万+成员的 ML SubReddit 并订阅我们的新闻通讯。等等!你在 Telegram 上吗?现在你也可以加入我们的 Telegram 群组了。

更进一步:量化金融体系

看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力

进入量化体系 →

关联讨论

同一事件的更多信源

相似阅读

关联信息,但可能不是同一事件