SWE-PolyBench
收藏资源简介:
SWE-PolyBench是一个多语言仓库级别的软件工程基准测试,包含四种语言(Java、JavaScript、TypeScript和Python)的2110个精选问题。此外,它还包含一个分层的500个问题子集(SWE-PolyBench500),用于快速实验。
SWE-PolyBench is a multilingual repository-level software engineering benchmark that includes 2110 curated problems across four programming languages: Java, JavaScript, TypeScript, and Python. It also contains a stratified subset of 500 problems (SWE-PolyBench500) for rapid experimentation.
SWE-PolyBench数据集概述
数据集简介
- 名称: SWE-PolyBench
- 类型: 多语言仓库级软件工程基准测试
- 语言: Java, JavaScript, TypeScript, Python
- 规模: 2110个精选问题(完整数据集PB),500个问题子集(PB500)
- 子集详情: PB500包含每种语言125个实例,任务类别分布为Bug修复(40%)、功能(40%)、重构(20%)
数据集获取
- 完整数据集:
AmazonScience/SWE-PolyBench(2110实例) - 子集:
AmazonScience/SWE-PolyBench_500(500实例)
评估方法
- 主文件:
src/poly_bench_evaluation/run_evaluation.py - 关键参数:
--dataset-path: 数据集路径(必需)--predictions-path: 模型生成的预测文件路径--result-path: 结果输出目录(必需)--num-threads: 线程数(默认1,推荐10-12)--evaluate-gold: 运行黄金代码补丁评估--repo-path: 基础仓库存储目录--delete-image: 删除实例级镜像(推荐存储不足时使用)--skip-existing: 跳过已存在的评估--metrics-only: 仅计算文件检索指标--node-metrics: 计算节点检索指标
运行环境
- 推荐环境: Conda环境(Python=3.11)
- Docker要求: x86_64 Linux机器,完整数据集需约5TB存储(PB500需1.2TB)
运行步骤
- 克隆仓库并安装依赖
- 运行评估命令(示例):
-
评估黄金补丁: sh python3 src/poly_bench_evaluation/run_evaluation.py --dataset-path AmazonScience/SWE-PolyBench --result-path ./eval_logs/ --num-threads 9 --repo-path ~/repos --delete-image --evaluate-gold
-
评估模型生成补丁: sh python3 src/poly_bench_evaluation/run_evaluation.py --dataset-path AmazonScience/SWE-PolyBench --result-path ./eval_logs/ --num-threads 9 --repo-path ~/repos --delete-image --predictions-path ./model_generated_predictions.jsonl --skip-existing
-
结果输出
- 实例级结果: 存储在
--result-path目录 - 综合结果: 输出到
./result.json - 运行日志: 存储在
./run_logs_{language}目录
运行时间
- PB500评估: 约7-8小时(使用7-8线程)
引用
bibtex @misc{rashid2025swepolybenchmultilanguagebenchmarkrepository, title={SWE-PolyBench: A multi-language benchmark for repository level evaluation of coding agents}, author={Muhammad Shihab Rashid and Christian Bock and Yuan Zhuang and Alexander Buccholz and Tim Esler and Simon Valentin and Luca Franceschi and Martin Wistuba and Prabhu Teja Sivaprasad and Woo Jung Kim and Anoop Deoras and Giovanni Zappella and Laurent Callot}, year={2025}, eprint={2504.08703}, archivePrefix={arXiv}, primaryClass={cs.SE}, url={https://arxiv.org/abs/2504.08703}, }
故障排除
- 容器冲突错误: 执行
docker rm -f $(docker ps -a -q)(注意:将删除所有运行中的容器)




