arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2511.00197cs.SEcs.AI
收藏

理解代码智能体行为:成功与失败轨迹的实证研究

Understanding Code Agent Behaviour: An Empirical Study of Success and Failure Trajectories

University College London(伦敦大学学院);Nanjing University(南京大学)

Oorja Majgaonkar, Zhiwei Fei, Xiang Li, Federica Sarro, He Ye

AI总结:

本文实证分析了 OpenHands、SWE-agent 和 Prometheus 三种代码智能体在 SWE-Bench 上的执行轨迹,揭示了防御性编程等成功策略、失败轨迹更长且方差更高,以及故障定位准确但代码修改需近似等关键行为特征,为开发更稳健可解释的自主软件工程系统奠定基础。

摘要:

大型语言模型(LLM)智能体在复杂软件工程任务中的日益部署,催生了在简单成功指标之外理解其问题解决行为的需求。尽管这些智能体在自动化问题解决中展现出令人印象深刻的能力,但其决策过程在很大程度上仍然不透明。本文对智能体轨迹进行了实证研究,即在尝试解决软件问题时捕捉智能体所采取步骤的执行轨迹。我们分析了在 SWE-Bench 基准测试上三种最先进的代码智能体(OpenHands、SWE-agent 和 Prometheus)的轨迹,考察了成功和失败的尝试。我们的调查揭示了几项关于智能体行为的关键见解。首先,我们确定了不同的解决问题策略(如防御性编程和上下文收集)如何在不同场景下促成成功。其次,我们发现失败的轨迹始终比成功的轨迹更长,并表现出更高的方差,且不同智能体之间的失败模式差异显著。第三,我们的故障定位分析表明,尽管大多数轨迹能正确识别有问题的文件(即使在失败中也有 72-81%),但成功更多取决于实现近似的而非精确的代码修改。这些以及我们研究揭示的其他发现,为通过轨迹分析理解智能体行为奠定了基础,有助于开发更稳健、更可解释的自主软件工程系统。

英文摘要:

The increasing deployment of Large Language Model (LLM) agents for complex software engineering tasks has created a need to understand their problem-solving behaviours beyond simple success metrics. While these agents demonstrate impressive capabilities in automated issue resolution, their decision-making processes remain largely opaque. This paper presents an empirical study of agent trajectories, namely the execution traces capturing the steps agents take when attempting to resolve software issues. We analyse trajectories from three state-of-the-art code agents (OpenHands, SWE-agent, and Prometheus) on the SWE-Bench benchmark, examining both successful and failed attempts. Our investigation reveals several key insights into agent behaviour. First, we identify how distinct problem-solving strategies, such as defensive programming and context gathering, enable success in different scenarios. Second, we find that failed trajectories are consistently longer and exhibit higher variance than successful ones, with failure patterns differing significantly between agents. Third, our fault localisation analysis shows that while most trajectories correctly identify problematic files (72-81\% even in failures), success depends more on achieving approximate rather than exact code modifications. These and other findings unveiled by our study, provide a foundation for understanding agent behaviour through trajectory analysis, contributing to the development of more robust and interpretable autonomous software engineering systems.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑