Skip to main content
QUICK REVIEW

[Paper Review] Hybrid-Gym: Training Coding Agents to Generalize Across Tasks

Yiqing Xie, Emmy Liu|arXiv (Cornell University)|Feb 18, 2026
Software Engineering ResearchComputer Science0 citations
TL;DR

Hybrid-Gym introduces a scalable set of synthetic multitask training tasks for coding agents, enabling strong transfer to real-world coding benchmarks without executable repositories. It improves generalization across SWE-Bench, SWT-Bench, and Commit-0 and complements in-domain data.

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.

Motivation & Objective

  • Identify common components and capabilities required by real-world coding tasks (e.g., reasoning, repo exploration, implementation).
  • Design scalable training tasks that teach these components without requiring complex executable environments.
  • Demonstrate transfer of agents trained on Hybrid-Gym to multiple downstream coding benchmarks.
  • Show how different task designs and data selection affect transferability and performance.

Proposed method

  • Decompose real-world coding tasks into intermediate components: reasoning, repo-exploration, execution, implementation, and verification.
  • Derive principles for task design to ensure outputs match downstream task formats, include repository exploration, require non-trivial reasoning, and avoid heavy environment setup.
  • Create four Hybrid-Gym tasks (function localization, issue localization, dependency search, function generation) that satisfy these principles.
  • Train coding agents (e.g., Qwen2.5Coder variants) on Hybrid-Gym and evaluate transfer to SWE-Bench, SWT-Bench, and Commit-0 without downstream-task finetuning.
  • Perform ablations and controlled experiments to analyze the impact of output format, repo-exploration, trajectory complexity, teacher-student distillation dynamics, and repository diversity on transfer performance.
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

Experimental results

Research questions

  • RQ1RQ1: What common intermediate components underlie real-world coding tasks and how do agents’ actions map to these components?
  • RQ2RQ2: What training task designs enable effective transfer of coding agents across diverse downstream tasks?
  • RQ3RQ3: Which factors (output format, repo-exploration, reasoning complexity, trajectory length, teacher model) most influence transfer performance?
  • RQ4RQ4: How does Hybrid-Gym compare to existing task-transfer datasets in promoting generalization across multiple benchmarks?

Key findings

  • Hybrid-Gym-trained agents show strong transfer to three real-world tasks (SWE-Bench, SWT-Bench, Commit-0) without downstream-task data, improving baseline models by substantial absolute gains.
  • Most agent actions in downstream tasks involve reasoning, repo-exploration, and implementation, with repo-exploration commands (grep, find, cd, ls) being highly transferable across tasks.
  • Task outputs that mimic downstream patch-like edits are crucial; removing patch-writing actions drastically reduces SWE-Bench performance.
  • Training with diverse repositories (high repo-diversity) enhances generalization to unseen codebases rather than memorizing evaluation repos.
  • Longer, more complex trajectories and instruction-rich teacher data improve transfer, while script-level tasks alone do not generalize to repo-level tasks.
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).

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.