更多但更少:一种关于高效编码代理的实证研究:回合控制策略
More with Less: An Empirical Study of Turn-Control Strategies for Efficient Coding Agents
AI总结:
本文通过实证研究分析了编码代理的回合控制策略,发现动态资源分配在成本和效率之间取得平衡,优于固定回合限制方法。
摘要:
基于大型语言模型的编码代理,通过迭代循环(回合)来解决软件工程任务,正变得越来越强大。然而,其实际部署受到显著且不可预测的成本的阻碍。这一挑战源于多种因素的结合:每次回合token数量呈二次增长,模型价格高,现实任务所需的回合数多,以及代理倾向于采取低效或不必要的行动。尽管现有研究侧重于优化单个回合,但对总回合数的战略控制仍然是管理代理性能和成本的未探索领域。为解决这一差距,我们对SWE-bench进行了全面的实证研究,使用三种最先进的模型,并评估了三种不同的回合控制策略的影响:一个无限制的基线、一个带有提醒的固定回合限制,以及一种新的动态回合策略,该策略按需授予扩展。我们的发现首先揭示了在无限制设置中的根本性权衡,即没有单一模型在性能、成本和回合效率上都表现出色。然后我们显示,一个固定回合限制,特别是基线的75百分位数,成为了一个“甜点”,显著降低了成本(减少24%-68%),同时对解决率的影响很小。最显著的是,动态回合策略在固定限制方法上表现更优,实现了可比或更好的解决率,同时通过智能分配资源仅用于需要的任务,进一步降低了成本12%-24%。这项工作提供了对回合控制策略的首次系统分析,为开发者提供了简单而有效的指南,以平衡成本和效果。我们证明动态资源分配是一种更优、易于实施的方法,用于部署强大且经济可行的编码代理。
英文摘要:
LLM-powered coding agents, which operate in iterative loops (turns) to solve software engineering tasks, are becoming increasingly powerful. However, their practical deployment is hindered by significant and unpredictable costs. This challenge arises from a combination of factors: quadratically growing token counts with each turn, the high price of models, the large number of turns required for real-world tasks, and the tendency of agents to take inefficient or unnecessary actions. While existing research focuses on optimizing individual turns, the strategic control of the total number of turns remains an underexplored area for managing agent performance and cost. To address this gap, we conduct a comprehensive empirical study on SWE-bench using three state-of-the-art models and evaluate the impact of three distinct turn-control strategies: an unrestricted baseline, a fixed-turn limit with reminders, and a novel dynamic-turn strategy that grants extensions on-demand. Our findings first reveal a fundamental trade-off in the unrestricted setting, where no single model excels across performance, cost, and turn efficiency. We then show that a fixed-turn limit, specifically at the 75th percentile of the baseline, serves as a "sweet spot", substantially reducing costs (by 24%-68%) with minimal impact on solve rates. Most significantly, the dynamic-turn strategy consistently outperforms fixed-limit approaches, achieving comparable or better solve rates while further reducing costs by an additional 12%-24% by intelligently allocating resources only to tasks that need them. This work provides the first systematic analysis of turn-control strategies, offering simple yet effective guidelines for developers to balance cost and efficacy. We demonstrate that dynamic resource allocation is a superior, easy-to-implement approach for deploying powerful yet economically viable coding agents.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。