用蒙特卡洛树搜索让编程智能体能回溯重试,提升复杂任务解决能力。
SWE-Search: Enhancing Software Agents with Monte Carlo Tree Search and Iterative Refinement

- 引入混合价值函数,结合数值评估与自然语言反馈实现策略迭代优化。
- 在SWE-bench上相比基准模型性能提升23%,且无需更大模型或新数据。
- 适合追求高鲁棒性代码生成的开发者和自动化测试研究者。
软件工程师在复杂动态环境中需持续适应需求、从经验中迭代学习并根据新洞察调整策略。然而,现有基于大语言模型(LLM)的软件智能体多采用线性流程,缺乏回溯与探索能力,导致初始方法失败时无法有效重构策略。为此,我们提出SWE-Search,一个融合蒙特卡洛树搜索(MCTS)与自改进机制的多智能体框架,用于提升智能体在仓库级软件任务中的表现。SWE-Search通过引入混合价值函数,利用LLM进行数值评估与定性判断,实现自我反馈循环,使智能体能基于量化指标与自然语言评价不断优化路径。框架包含负责自适应探索的SWE-Agent、提供迭代反馈的Value Agent以及促进多智能体辩论的Discriminator Agent。在SWE-bench基准上的实验表明,该方法相较无MCTS的标准开源智能体,在五种模型上平均提升23%性能。分析还揭示性能随推理计算量增加而提升,证明通过深度搜索即可增强智能体能力,无需更大模型或额外训练数据。这凸显了自评估驱动搜索技术在复杂软件工程场景中的潜力。
原文摘要 · Abstract (English)
Software engineers operating in complex and dynamic environments must continuously adapt to evolving requirements, learn iteratively from experience, and reconsider their approaches based on new insights. However, current large language model (LLM)-based software agents often follow linear, sequential processes that prevent backtracking and exploration of alternative solutions, limiting their ability to rethink their strategies when initial approaches prove ineffective. To address these challenges, we propose SWE-Search, a multi-agent framework that integrates Monte Carlo Tree Search (MCTS) with a self-improvement mechanism to enhance software agents' performance on repository-level software tasks. SWE-Search extends traditional MCTS by incorporating a hybrid value function that leverages LLMs for both numerical value estimation and qualitative evaluation. This enables self-feedback loops where agents iteratively refine their strategies based on both quantitative numerical evaluations and qualitative natural language assessments of pursued trajectories. The framework includes a SWE-Agent for adaptive exploration, a Value Agent for iterative feedback, and a Discriminator Agent that facilitates multi-agent debate for collaborative decision-making. Applied to the SWE-bench benchmark, our approach demonstrates a 23% relative improvement in performance across five models compared to standard open-source agents without MCTS. Our analysis reveals how performance scales with increased inference-time compute through deeper search, providing a pathway to improve software agents without requiring larger models or additional training data. This highlights the potential of self-evaluation driven search techniques in complex software engineering environments.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。