Skip to main content
QUICK REVIEW

[论文解读] Hybrid-Gym: Training Coding Agents to Generalize Across Tasks

Yiqing Xie, Emmy Liu|arXiv (Cornell University)|Feb 18, 2026
Software Engineering ResearchComputer Science被引用 0
一句话总结

Hybrid-Gym 引入可扩展的合成多任务训练任务集,使编码代理在无需执行仓库的前提下即可实现对现实世界编码基准的强泛化,并在 SWE-Bench、SWT-Bench 和 Commit-0 上提升表现,同时对领域内数据具有互补作用。

ABSTRACT

When assessing the quality of coding agents, predominant benchmarks focus on solving single issues on GitHub, such as SWE-Bench. In contrast, in real use, these agents solve more various and complex tasks that involve other skills such as exploring codebases, testing software, and designing architecture. In this paper, we first characterize some transferable skills that are shared across diverse tasks by decomposing trajectories into fine-grained components, and derive a set of principles for designing auxiliary training tasks to teach language models these skills. Guided by these principles, we propose a training environment, Hybrid-Gym, consisting of a set of scalable synthetic tasks, such as function localization and dependency search. Experiments show that agents trained on our synthetic tasks effectively generalize to diverse real-world tasks that are not present in training, improving a base model by 25.4% absolute gain on SWE-Bench Verified, 7.9% on SWT-Bench Verified, and 5.1% on Commit-0 Lite. Hybrid-Gym also complements datasets built for the downstream tasks (e.g., improving SWE-Play by 4.9% on SWT-Bench Verified). Code available at: https://github.com/yiqingxyq/Hybrid-Gym.

研究动机与目标

  • 识别现实世界编码任务所需的常见组成部分与能力(如推理、仓库探索、实现)。
  • 设计可扩展的训练任务,教授这些组成部分,而不需要复杂的可执行环境。
  • 证明在 Hybrid-Gym 上训练的代理能够迁移到多个下游编码基准。
  • 展示不同任务设计与数据选择如何影响迁移性与性能。

提出的方法

  • 将现实世界的编码任务分解为中间组成部分:推理、仓库探索、执行、实现和验证。
  • 推导任务设计原则,确保输出与下游任务格式匹配,包括仓库探索、需要非平凡推理、并避免繁重的环境搭建。
  • 创建四个 Hybrid-Gym 任务(函数定位、问题定位、依赖搜索、函数生成),以满足这些原则。
  • 在 Hybrid-Gym 上训练编码代理(如 Qwen2.5Coder 变体),并在不进行下游任务微调的情况下评估向 SWE-Bench、SWT-Bench 和 Commit-0 的迁移。
  • 进行消融与对照实验,分析输出格式、仓库探索、轨迹复杂度、教师-学生蒸馏动态,以及仓库多样性对迁移性能的影响。
Figure 1 : ( Left ) We decompose general coding agent tasks into a set of intermediate components and compute the percentage of agent actions spent on each component. Our training tasks partially cover verification and fully cover reasoning, repository exploration, and implementation, which consist
Figure 1 : ( Left ) We decompose general coding agent tasks into a set of intermediate components and compute the percentage of agent actions spent on each component. Our training tasks partially cover verification and fully cover reasoning, repository exploration, and implementation, which consist

实验结果

研究问题

  • RQ1RQ1:现实世界编码任务背后的共同中间组成部分是什么,以及代理的行为如何映射到这些组成部分?
  • RQ2RQ2:哪些训练任务设计能够实现对多样化下游任务的有效迁移?
  • RQ3RQ3:哪些因素(输出格式、仓库探索、推理复杂度、轨迹长度、教师模型)对迁移性能影响最大?
  • RQ4RQ4:Hybrid-Gym 相较于现有任务迁移数据集在促进对多个基准的泛化方面有何表现?

主要发现

  • 通过 Hybrid-Gym 训练的代理对三个现实世界任务(SWE-Bench、SWT-Bench、Commit-0)实现强迁移且无需下游任务数据,且在基线模型上取得显著绝对提升。
  • 下游任务中的大多数代理动作涉及推理、仓库探索和实现,其中仓库探索命令(grep、find、cd、ls)在跨任务间具有高度可迁移性。
  • 模仿下游补丁式编辑的任务输出至关重要;移除补丁编写动作会大幅降低 SWE-Bench 的表现。
  • 使用多样化仓库进行训练(高仓库多样性)有助于对未见代码库的泛化,而非记忆评估仓库。
  • 更长更复杂的轨迹和含丰富指令的教师数据可以提升迁移,而仅有脚本级任务则难以泛化到仓库级任务。
Figure 2 : Scaling law analysis. Performance on SWE-bench Verified improves consistently as training data size increases from around 5% (250 trajectories) to 100% (4.4k trajectories).
Figure 2 : Scaling law analysis. Performance on SWE-bench Verified improves consistently as training data size increases from around 5% (250 trajectories) to 100% (4.4k trajectories).

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。