薛定谔的代码仓库:LLM 是学会了 SWE-bench 还是记住了它?

·

研究论文 · 2026/09/24

仓库级编码基准已成为评估编码代理的标准,但由于它们建立在被反复用于训练的流行开源仓库之上,因此本质上存在数据泄漏问题。因此,强大的性能可能反映的是对规范仓库线索的记忆,而非稳健的仓库推理。我们提出了SchrodingerRepo(薛定谔的仓库),一个在动态实例化仓库表示下测试编码代理的评估框架。SchrodingerRepo不是重复使用测试仓库的静态表示,而是将测试仓库视为评估时的潜在变量,仅在代理进入评估环境时动态实例化。实例化的仓库保留了原始的可执行行为,同时通过四个转换级别侵蚀熟悉的线索,如命名约定、文件布局和实现模式:问题陈述重构、命名空间重映射、文件内布局重排序和功能保持的代码重写。我们在SWE-bench Verified和SWE-QA上评估了流行的LLM。结果表明,移除熟悉的仓库线索会持续降低代理性能,并大幅增加跨模型的交互成本。进一步分析揭示,额外成本主要是由仓库探索和定位难度增加引起的。这些发现表明,当前的编码代理可能部分依赖于记忆的仓库侧线索,凸显了在动态实例化仓库表示下进行评估的必要性。

该研究揭示了编码代理在仓库级基准测试中可能依赖记忆而非推理的问题,并提出了创新的动态评估框架,对于提高评估的可靠性和推动更稳健的编码代理发展具有重要意义。

Repository-level coding benchmarks have become the standard for evaluating coding agents, yet they inherently suffer from data leakage because they are built upon popular open-source repositories repeatedly used for training. Consequently, strong performance may reflect memorization of canonical repository cues rather than robust repository reasoning. We propose SchrodingerRepo (Schrödinger's Repository), an evaluation framework for testing coding agents under dynamically instantiated repository representations. Instead of repeatedly using a static representation of the test repository, SchrodingerRepo treats the test repository as an evaluation-time latent variable that is dynamically instantiated only when the agent enters the evaluation environment. The instantiated repository preserves the original executable behavior while eroding familiar cues such as naming conventions, file layouts, and implementation patterns through four transformation levels: problem statement reconstruction, namespace remapping, intra-file layout reordering, and functionality-preserving code rewriting. We evaluate popular LLMs on SWE-bench Verified and SWE-QA. Results show that removing familiar repository cues consistently degrades agent performance and substantially increases interaction costs across models. Further analysis reveals that the additional cost is primarily caused by increased difficulty in repository exploration and localization. These findings suggest that current coding agents may partially rely on memorized repository-side cues, highlighting the need for evaluation under dynamically instantiated repository representations.

阅读原文

参与讨论