工作日早上 7 点读 AI,周日早上 8 点读周报订阅邮件

METAL LAB

SWE-Bench ProMax: Benchmarking Agents on Large-Scale Multilingual Code Refactoring

arXiv:2608.098022026-08-09

让AI编程智能体挑战多文件重构任务,结果最强模型也只解决了41.2%

现有代码基准正快速饱和,一项审查还发现SWE-bench Verified中近60%未解决的用例其测试本身存在缺陷。本文提出SWE-Bench ProMax,一个由专家精心整理、覆盖七种编程语言、共170个真实提交的大规模代码重构基准。在两种智能体框架下评测六个前沿模型后,表现最好的模型解决率也仅为41.2%,说明跨文件协同重构对当前AI智能体仍是真正的难题。

METAL LAB 解读图

SWE-Bench ProMax的构建与评测流程

证据状态已报告实测结果

  1. 第一阶段:数据收集从星标500以上、采用认可开源许可证、目标语言占比80%以上的仓库中,挖掘2025年1月后含'refactor'关键词的29,782个候选提交
  2. 第二阶段:环境验证为每个候选提交构建Docker环境,验证黄金补丁应用后能否通过完整测试套件,失败者被剔除
  3. 第三阶段:专家审校过滤复杂度不足的任务,从零重写问题描述,剔除过窄或过宽的测试,最终确定170个实例
  4. 模型评测在mini-swe-agent和OpenHands两种框架下测试GPT-5.2、Claude Sonnet 4.6、Gemini-3-Pro、GLM-5、Kimi-K2.5、Qwen3.5,最高解决率为41.2%
  5. 失败模式分析发现智能体在大补丁上修改的文件数明显少于所需,且失败尝试消耗的交互轮数远多于成功尝试
这是 METAL LAB 制作的解读图,并非论文作者提供的原图。

他们做了什么

  1. 研究出发点是现有基准(如SWE-bench Verified)难度已经见顶,且测试质量存在缺陷,导致分数不能真实反映智能体的实际能力。
  2. 作者从星标数500以上、采用认可开源许可证、且某一目标语言代码占比80%以上的GitHub仓库中,挖掘出29,782个包含'refactor'关键词的候选提交,再经环境验证与专家改写,最终仅保留170个实例。
  3. 每个问题描述都从零重写以消除歧义,测试套件也经人工审查,剔除了过于狭窄(会误判正确解为错误)和过于宽泛(检查未声明要求)的测试。
  4. 基准覆盖Python、Java、TypeScript、Go、C、C++、Rust七种语言,平均每个任务需要修改11.4个文件、261.6行代码,规模远超现有基准。
  5. 在mini-swe-agent和OpenHands两种智能体框架下评测了Claude Sonnet 4.6、GPT-5.2、Gemini-3-Pro、GLM-5、Kimi-K2.5、Qwen3.5六个前沿模型,GPT-5.2以41.2%的解决率位居第一。
Figure 1: Distribution of modified files (left) and lines of code (right) per instance across benchmarks. SWE-Bench ProMax instances are substantially larger: 30% modify more than 10 files and 32% change over 200 lines of code, while 86% of SWE-bench Verified instances modify only a single file.
Figure 1: Distribution of modified files (left) and lines of code (right) per instance across benchmarks. SWE-Bench ProMax instances are substantially larger: 30% modify more than 10 files and 32% change over 200 lines of code, while 86% of SWE-bench Verified instances modify only a single file.
Table 1: Comparison of SWE-Bench ProMax with existing benchmarks. Avg. >5 Files: the average gold patch modifies more than 5 files. Expert Curated: problem descriptions and/or test suites undergo manual expert review or authoring beyond automated collection.
BenchmarkExecution BasedRepo LevelMulti LingualRefac- toringAvg. >5 FilesExpert Curated
HumanEval [5]
MBPP [2]
LiveCodeBench [19]
SWE-bench [21]
Multi-SWE-bench [49]
SWE-PolyBench [33]
SWE-bench Pro [8]
SWE-EVO [23]
Terminal-Bench [26]
RefactorBench [13]
SWE-Refactor [47]
SWE-Bench ProMax (Ours)
Figure 3: Data collection and curation pipeline for SWE-Bench ProMax.
Figure 3: Data collection and curation pipeline for SWE-Bench ProMax.
Table 3: Resolve rates (%) of all evaluated models across scaffolds on SWE-Bench ProMax.
OverallAvg. StepsAvg. CostPer-Language Resolve Rate
PyJavaTSGoCC++Rust
Mini-SWE-Agent
Proprietary
Gemini-3-Pro26.558.0$0.6017.215.414.326.150.045.527.3
Claude Sonnet 4.630.699.5$2.3213.819.232.113.065.040.940.9
GPT-5.221.825.2$0.1917.215.421.413.045.031.813.6
Open-weight
GLM-522.9108.9$0.1013.87.725.021.750.022.727.3
Kimi-K2.526.585.3$0.3717.223.121.417.460.031.822.7
Qwen3.520.6155.4$0.9317.27.710.713.045.027.331.8
OpenHands
Proprietary
Gemini-3-Pro19.451.2$1.4913.819.20.08.745.036.422.7
Claude Sonnet 4.638.8117.9$4.7717.230.853.626.150.036.463.6
GPT-5.241.2115.1$3.6048.319.235.726.175.036.454.5
Open-weight
GLM-536.5114.2$0.2420.734.628.634.865.045.536.4
Kimi-K2.532.999.6$0.7224.130.810.743.570.045.518.2
Qwen3.536.5141.2$0.7837.926.917.939.165.054.522.7
Figure 4: Language distribution in SWE-Bench ProMax.
Figure 4: Language distribution in SWE-Bench ProMax.
Table 4: Repositories and licenses used in SWE-Bench ProMax, grouped by language. 70 repositories across 7 languages.
LanguageRepositoryLicense
Cbetaflight/betaflightGPL-3.0
aviggiano/redis-roaringMIT
davidesantangelo/krepBSD-2-Clause
radareorg/radare2LGPL-3.0
CESNET/libyangBSD-3-Clause
arkq/bluez-alsaMIT
aws/s2n-tlsApache-2.0
bitcoin-core/secp256k1MIT
openssl/opensslApache-2.0
C++deskflow/deskflowGPL-2.0
ETLCPP/etlMIT
nasa/fprimeApache-2.0
Icinga/icinga2GPL-3.0
LMMS/lmmsGPL-2.0
OpenOrienteering/mapperGPL-3.0
WasmEdge/WasmEdgeApache-2.0
bloomberg/blazingmqApache-2.0
biojppm/rapidyamlMIT
Gocli/cliMIT
go-gitea/giteaMIT
TecharoHQ/anubisMIT
restic/resticBSD-2-Clause
OpenListTeam/OpenListAGPL-3.0
caddyserver/caddyApache-2.0
derailed/k9sApache-2.0
gitleaks/gitleaksMIT
gohugoio/hugoApache-2.0
grpc/grpc-goApache-2.0
istio/istioApache-2.0
jesseduffield/lazygitMIT
Figure 5: Left: Cumulative distribution of files modified by agents (Claude Sonnet 4.6, Kimi-K2.5) versus the gold patch. Agents modify fewer files than required overall, with the gap widening for larger patches. Right: Cumulative distribution of interaction rounds on resolved (solid) versus unresolved (dashed) instances. Failed attempts consume substantially more rounds than successful ones.
Figure 5: Left: Cumulative distribution of files modified by agents (Claude Sonnet 4.6, Kimi-K2.5) versus the gold patch. Agents modify fewer files than required overall, with the gap widening for larger patches. Right: Cumulative distribution of interaction rounds on resolved (solid) versus unresolved (dashed) instances. Failed attempts consume substantially more rounds than successful ones.
Table 5: Per-language statistics for SWE-Bench ProMax, including number of repositories, instances, and average patch complexity.
Language#Repos#Inst.Avg. #FilesAvg. LOCAvg. #Non-test
C92017.9424.115.2
C++92221.4196.316.0
Go162316.0227.49.4
Java112620.8309.816.8
Python182910.6299.87.0
Rust52214.5284.811.0
TypeScript22811.9122.67.5
Overall7017015.9261.611.4
Figure 6: Distribution of task categories across SWE-Bench ProMax instances (multi-label; percentages sum to more than 100%). The dominant categories—Refactoring Cleanup (66.5%) and API Interface Change (65.3%)—confirm the refactoring focus of the benchmark, while the substantial presence of New Feature (43.5%) and Bug Fix (41.2%) reflects the multi-faceted nature of real-world code restructuring.
Figure 6: Distribution of task categories across SWE-Bench ProMax instances (multi-label; percentages sum to more than 100%). The dominant categories—Refactoring Cleanup (66.5%) and API Interface Change (65.3%)—confirm the refactoring focus of the benchmark, while the substantial presence of New Feature (43.5%) and Bug Fix (41.2%) reflects the multi-faceted nature of real-world code restructuring.
Table 6: Summary of representative instances in SWE-Bench ProMax, one per language, sorted by number of modified files.
Lang.RepositoryFilesLOCRefactoring summary
C++nasa/fprime244559Unify header includes across framework
Javaplantuml/plantuml941,629Add hour-level time resolution to Gantt engine
Cbetaflight/betaflight62846Rename motor protocol configuration fields
Rusttracel-ai/burn491,084Unify scalar arguments across tensor operations
GoOpenListTeam/OpenList47608Refactor upload stream buffering across drivers
Pythongoogle/langextract301,960Centralize provider output-format handling
TSant-design/ant-design2797Unify destroyOnHidden across components
Figure 7: Number of categories per instance. Every instance involves at least two categories, and nearly half (46.5%) involve three or more simultaneously, indicating that SWE-Bench ProMax tasks require holistic software engineering skills rather than isolated refactoring ability.
Figure 7: Number of categories per instance. Every instance involves at least two categories, and nearly half (46.5%) involve three or more simultaneously, indicating that SWE-Bench ProMax tasks require holistic software engineering skills rather than isolated refactoring ability.

研究结果

  • 在六个前沿模型和两种智能体框架下评测,表现最好的GPT-5.2解决率仅为41.2%,远低于前沿智能体在SWE-bench Verified上超过75%的水平。
  • 开源模型GLM-5和Qwen3.5在OpenHands框架下均达到36.5%,接近GPT-5.2(41.2%)和Claude Sonnet 4.6(38.8%),但每个实例成本仅0.24美元,约为Claude Sonnet 4.6(4.77美元)的二十分之一。
  • 将智能体修改的文件数与黄金补丁对比发现,对于大规模补丁,智能体修改的文件数明显不足:黄金补丁的累积分布约在20个文件处达到90%,而智能体在约10个文件处就已达到90%。
  • 失败的尝试消耗的交互轮数明显多于成功的尝试,这与智能体陷入反复编辑-撤销的低效循环有关。
  • 不同语言间性能差异很大,没有单一模型在所有语言上都占优:Claude Sonnet 4.6在TypeScript(53.6%)和Rust(63.6%)上领先,GPT-5.2在Python(48.3%)和C(75.0%)上表现最好,GLM-5在Java(34.6%)上领先。
Figure 8: Co-occurrence matrix of task categories. API Interface Change and Refactoring Cleanup co-occur in 79 instances, while Bug Fix frequently accompanies both (33 and 48 instances respectively), reflecting how refactoring often surfaces latent defects that must be addressed concurrently.
Figure 8: Co-occurrence matrix of task categories. API Interface Change and Refactoring Cleanup co-occur in 79 instances, while Bug Fix frequently accompanies both (33 and 48 instances respectively), reflecting how refactoring often surfaces latent defects that must be addressed concurrently.

可应用场景

  • 可作为评测AI编程智能体处理大规模多文件重构任务能力的标准基准。
  • 可用于比较不同智能体框架或提示策略对跨文件协同能力的影响。
  • 为在开源模型与商业模型之间权衡解决率与成本效率提供参考依据。
  • 可用于分析类型系统、内存模型等语言特性如何影响智能体在七种语言上的重构表现。
Figure 9: Distribution of required reasoning skills across SWE-Bench ProMax instances (multi-label). Nearly all instances require cross-file reasoning (99.4%) and API semantics understanding (98.8%), confirming that the benchmark systematically tests sustained multi-file comprehension. Pattern matching (91.8%) and interface contract reasoning (97.1%) are also near-universal, while data flow (88.8%), domain knowledge (79.4%) and type system reasoning (50.6%) appear in the majority of instances.
Figure 9: Distribution of required reasoning skills across SWE-Bench ProMax instances (multi-label). Nearly all instances require cross-file reasoning (99.4%) and API semantics understanding (98.8%), confirming that the benchmark systematically tests sustained multi-file comprehension. Pattern matching (91.8%) and interface contract reasoning (97.1%) are also near-universal, while data flow (88.8%), domain knowledge (79.4%) and type system reasoning (50.6%) appear in the majority of instances.

局限与待验证事项

  • 基准规模不算大(170个实例、70个仓库),部分语言的实例高度集中在极少数仓库中(例如TypeScript的28个实例仅来自2个仓库)。
  • 评测仅使用了mini-swe-agent和OpenHands两种智能体框架,其他架构下的表现尚未验证。
  • 任务类别和所需推理技能的标注(附录B)由Claude Sonnet 4.6完成,仅用于分析目的,不影响基准的标准答案或评测结果本身。
  • 数据仅取自2025年1月之后的提交,这在一定程度上但并不能完全排除较新模型训练数据污染的可能性。

为什么重要

代码重构是实际软件开发中最常见的工作之一,要求在不改变外部行为的前提下协调修改多个文件,因此是检验智能体真实能力的更严苛、更贴近现实的测试。在现有基准趋于饱和、可信度受质疑的背景下,这一基准为衡量AI编程智能体的真实进步提供了一把尚未被'刷分'的新尺子。

本文术语

  • SWE-bench · 一个基于真实GitHub issue和代码仓库来评测AI编程智能体的知名基准系列
  • 代码重构 · 在不改变代码外部可观察行为的前提下,对代码结构进行整理和调整
  • 解决率 · 智能体修改后的代码通过全部测试用例的任务所占的百分比
  • 黄金补丁 · 原始开发者实际提交的正确代码修改,作为参考答案
  • 智能体框架 · 让模型能够循环执行查看文件、编辑代码、运行命令等操作的执行环境,如mini-swe-agent、OpenHands

论文原文摘要(英文)

As AI coding agents take on increasingly complex, long-horizon software engineering tasks, existing benchmarks are rapidly saturating and their evaluation quality has come under serious scrutiny: a recent audit found that nearly 60% of unsolved SWE-bench Verified instances contain flawed tests -- either overly narrow tests that reject correct solutions or overly broad tests that check unstated requirements -- and that frontier models can verbatim reproduce gold patches from training data. Code refactoring, which requires coordinated, behavior-preserving changes across many files, offers a substantially harder and more realistic test of agent capability, yet remains underserved by current benchmarks. We introduce SWE-Bench ProMax, an expert-curated, multilingual code refactoring benchmark of 170 instances drawn from real commits across seven programming languages (Python, Java, TypeScript, Go, C, C++, and Rust). Every instance undergoes rigorous, multi-stage curation that directly addresses the quality problems identified in prior benchmarks: issue descriptions are rewritten from scratch to provide precise, unambiguous specifications, and test suites are manually reviewed to remove overly narrow and overly broad tests. Tasks with insufficient complexity or limited cross-file scope are filtered out, yielding a benchmark of challenging, large-scale refactoring tasks that average 11.4 modified files and 261.6 lines of code per instance, substantially exceeding the scale of existing benchmarks. Experiments with frontier models under two agent scaffolds show that the best model achieves only 41.2% resolve rate, confirming that SWE-Bench ProMax presents a meaningful and unsaturated challenge for current AI coding agents. Our benchmark is available at https://huggingface.co/datasets/swe-bench-promax/SWE-Bench-ProMax.

作者 · Yuling Shi

在 arXiv 阅读

最新论文

全部论文 →

METAL LAB 最新报道

图片来源: Yuling Shi et al., arXiv:2608.09802, CC BY 4.0