自动化构建开源问题修复数据集,提升LLM训练与评估效率
SWE-Factory: Your Automated Factory for Issue Resolution Training Data and Evaluation Benchmarks
- 全自动化流程恢复缺失二进制文件,确保测试补丁正确性
- 用LLM多智能体系统自动搭建评估环境,成本仅0.047美元/实例
- 基于退出码的自动日志解析,准确率达F1=0.99,无需人工校验
构建大规模的GitHub问题修复数据集对训练和评估大语言模型的软件工程能力至关重要。然而现有数据构建流程存在三大瓶颈:(1)测试补丁常遗漏二进制文件变更;(2)评估环境手动搭建耗时费力;(3)fail2pass验证阶段需人工查看日志并编写解析代码。本文提出SWE-Factory,一个全自动的问题修复数据构建流水线。首先,自动恢复缺失的二进制测试文件,保障补丁正确性;其次,引入SWE-Builder——基于LLM的多智能体系统,实现评估环境的自动化构建;第三,提出标准化的退出码日志解析方法,实现完全自动化的fail2pass验证。在4种编程语言、671个真实GitHub问题上的实验表明,该方法以合理成本有效构建可运行的评估环境。例如,使用GPT-4.1 mini,SWE-Builder在671个问题中成功构建337个有效任务实例,单例成本仅为0.047美元。消融实验证明各组件有效性。人工检验显示,退出码方法准确率高达F1=0.99。此外,初步实验验证了SWE-Factory可增强模型的软件工程能力。
原文摘要 · Abstract (English)
Constructing large-scale datasets for the GitHub issue resolution task is crucial for both training and evaluating the software engineering capabilities of Large Language Models (LLMs). However, the existing GitHub issue resolution data construction pipeline is challenging and labor-intensive. We identify three key limitations in existing pipelines: (1) test patches collected often omit binary file changes; (2) the manual construction of evaluation environments is labor-intensive; and (3) the fail2pass validation phase requires manual inspection of test logs and writing custom parsing code to extract test status from logs. In this paper, we propose SWE-Factory, a fully automated issue resolution data construction pipeline, to resolve these limitations. First, our pipeline automatically recovers missing binary test files and ensures the correctness of test patches. Second, we introduce SWE-Builder, a LLM-based multi-agent system that automates evaluation environment construction. Third, we introduce a standardized, exit-code-based log parsing method to automatically extract test status, enabling a fully automated fail2pass validation. Experiments on 671 real-world GitHub issues across four programming languages show that our method can effectively construct valid evaluation environments for GitHub issues at a reasonable cost. For example, with GPT-4.1 mini, our SWE-Builder constructs 337 valid task instances out of 671 issues, at $0.047 per instance. Our ablation study further shows the effectiveness of different components of SWE-Builder. We also demonstrate through manual inspection that our exit-code-based fail2pass validation method is highly accurate, achieving an F1 score of 0.99. Additionally, we conduct an exploratory experiment to investigate whether we can use SWE-Factory to enhance models' software engineering ability.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。