Lune

ISSTA2026顶会

To Run or Not to Run: Analyzing the Cost-Effectiveness of Code Execution in LLM-Based Program Repair

Zhihao Lin, Junhua Zhu, Mingyi Zhou, Xin Wang, Zhensu Sun, Renyu Yang, David Lo, Li Li

摘要

LLM-based agents for program repair are increasingly built on a “generate-run-revise” paradigm, iteratively executing tests to evaluate and refine patches. This execution-based approach has become standard practice in state-of-the-art systems. However, executions can be time-consuming and expensive, yet their impact on these agents remains underexplored. In this paper, we conduct a two-stage empirical study of execution behavior in LLM-based program repair. To characterize execution behavior at scale, we first analyze 7,745 agent traces from SWE-bench leaderboard submissions. Second, we evaluate 3,000 end-to-end repair attempts across 200 SWE-bench instances and three agents (Claude Code, Codex, and the open-source OpenCode) under four execution paradigms, which allows for a fine-grained comparison of performance and cost. Our analysis reveals three key observations: (1) Code execution is used across all agents and models analyzed, with an average of 8.8 test runs per task. Execution behavior varies substantially across agents and models, with frequency ranging from 2 to 19 per task, and late-stage executions (66–100% of conversation) consistently achieve higher success rates than early-stage ones (57.9% average). (2) Execution restrictions have little effect on repair success: On commercial agents with SOTA models, the resolve-rate gap between Prohibited and Unrestricted is only 1.25pp (not statistically significant, p > 0.05). The corresponding value for open-source OpenCode with Qwen2.5-Coder-32B is approximately 0pp, with equivalence holding under both prompt-level and tool-level enforcement of the restriction. Prohibited saves 56–62% of tokens and 48–54% of wall-clock time on Claude Code, and removes the need to maintain per-repository test environments. (3) Execution benefit is concentrated rather than uniform. For commercial agents, 54–66% of cases complete in a single edit, localization accuracy under Prohibited is over 95%, and 81–100% of failed cases pass agent-executed validation but fail the official evaluation. OpenCode with Qwen2.5-Coder-32B shows another failure mode: it retries more frequently and only 11% of its failed cases pass self-validation. These patterns suggest that current agents apply execution indiscriminately, paying its cost on instances where it provides little benefit. Execution, therefore, should be treated as a resource with an explicit cost-benefit tradeoff, not a default capability.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

可以从这些问题问起

Lune 可以查阅

全文 · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Tree of Thoughts: Deliberate Problem Solving with Large Language Models 引用了 Self-Refine: Iterative Refinement with Self-Feedback
  • Tree of Thoughts: Deliberate Problem Solving with Large Language Models 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • Self-Refine: Iterative Refinement with Self-Feedback 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering 引用了 SWE-bench: Can Language Models Resolve Real-world Github Issues?
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

它引用的 Paper25

  1. Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma 等NeurIPS 2022 · 22,562 次引用
  2. Tree of Thoughts: Deliberate Problem Solving with Large Language ModelsShunyu Yao, Dian Yu, Jeffrey Zhao, Izhak Shafran 等NeurIPS 2023 · 5,068 次引用
  3. Self-Refine: Iterative Refinement with Self-FeedbackAman Madaan, Niket Tandon, Prakhar Gupta, Skyler Hallinan 等NeurIPS 2023 · 4,972 次引用
  4. SWE-bench: Can Language Models Resolve Real-world Github Issues?Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao 等ICLR 2024 · 2,082 次引用
  5. SWE-agent: Agent-Computer Interfaces Enable Automated Software EngineeringJohn Yang, Carlos E. Jimenez, Alexander Wettig, Kilian Lieret 等NeurIPS 2024 · 2,059 次引用

相关 Paper

  1. More with Less: An Empirical Study of Turn-Control Strategies for Efficient Coding AgentsPengfei Gao, Chao PengICSE 2026
  2. PostTrainBench: Can LLM Agents Automate LLM Post-Training?Ben Rank, Hardik Bhatnagar, Ameya Pandurang Prabhu, Shira Eisenberg 等ICML 2026 · 28 次引用
  3. CODESTRUCT: Code Agents over Structured Action SpacesMyeongsoo Kim, Chao-Chun Hsu, Dingmin Wang, Shweta Garg 等ACL 2026
  4. FeatureBench: Benchmarking Agentic Coding for Complex Feature DevelopmentQixing Zhou, Jiacheng Zhang, Haiyang Wang, Rui Hao 等ICLR 2026 · 30 次引用
  5. daVinci-Dev: Agent-native Mid-training for Software EngineeringJi Zeng, Dayuan Fu, Tiantian Mi, Zhuang Yumin 等ICML 2026 · 13 次引用
黄昏的海面,两侧是细线勾勒的悬崖