SWE-bench 科学:编码代理能否解决科学领域的工程任务?

·

研究论文 · 2026/08/21

软件日益成为科学仪器本身的一部分,科学代码中的故障不仅可能损害程序行为,还可能损害科学结论所依据的证据。然而,现有的编码代理评估主要强调总体任务成功率,对代理在修复科学软件时为何失败提供的洞察有限。我们引入了 SWE-bench Science,这是一个面向科学软件工程的仓库级基准,包含来自 20 个科学领域、98 个 GitHub 仓库的 119 个任务。每个任务被组织为三种范式之一:问题驱动、专家探索和工程集成。即使是最佳性能的代理 Claude Code with Opus-5(max),其 pass@1 也低于 50%,凸显了科学软件工程带来的巨大挑战。我们识别出四种反复出现的失败机制:科学知识或抽象不足、误导性探索或表面修复、修复覆盖或系统集成不完整,以及未能将科学知识泛化到分析中观察到的案例之外。我们进一步进行了配对消融实验,在保留仓库和可执行工程上下文的同时移除明确的科学指导。结果表明,科学知识并非总是有益的:有充分依据的信息可以约束修复并提高平均性能和令牌效率,而对齐不良的指导可能引发锚定效应,且不一定能提高精确修复成功率。总之,SWE-bench Science 为研究编码代理在科学软件工程中的能力和失败机制提供了一个广泛的测试平台。

该论文提出了一个针对科学软件工程的新基准,并系统分析了编码代理的失败机制,对提升科学计算可靠性具有重要意义。

Software increasingly functions as part of the scientific instrument itself, making failures in scientific code capable of compromising not only program behavior but also the evidence underlying scientific conclusions. Yet existing evaluations of coding agents largely emphasize aggregate task success, providing limited insight into why agents fail when repairing scientific software. We introduce SWE-bench Science, a repository-level benchmark for scientific software engineering comprising 119 tasks from 98 GitHub repositories across 20 scientific domains. Each task is organized into one of three paradigms: Issue-driven, Expert-exploratory, and Engineering-integration. Even the best-performing agent, Claude Code with Opus-5 (max), achieves a pass@1 below 50\%, highlighting the substantial challenges posed by scientific software engineering. We identify four recurring failure mechanisms: deficits in scientific knowledge or abstraction, misguided exploration or surface-level repair, incomplete repair coverage or system integration, and failures to generalize scientific knowledge beyond observed cases in our analysis. We further conduct a paired ablation that removes explicit scientific guidance while preserving the repository and executable engineering context. The results show that scientific knowledge is not uniformly beneficial: well-grounded information can constrain repair and improve average performance and token efficiency, whereas poorly aligned guidance can induce anchoring and does not necessarily improve exact repair success. Together, SWE-bench Science provides a broad testbed for studying both the capabilities and failure mechanisms of coding agents in scientific software engineering.

阅读原文

参与讨论