arXiv:2510.16786cs.SEcs.AI2025-10被引 10

通过动态控制代码生成轮次,显著降低大模型编码代理的耗时耗资。

More with Less: An Empirical Study of Turn-Control Strategies for Efficient Coding Agents

  • 提出动态轮次策略,按需分配资源,避免无效迭代。
  • 固定轮次限制可降本24%-68%,且几乎不损解题率。
  • 动态策略再降12%-24%成本,适合追求效率的开发者部署。

基于大语言模型的编码代理在解决软件工程任务时采用迭代循环(轮次),但其实际部署受限于高昂且不可预测的成本。原因包括:每轮令牌数呈平方级增长、模型价格高、真实任务需大量轮次,以及代理常执行低效或冗余操作。现有研究多聚焦单轮优化,对轮次总数的战略控制仍待探索。本文在SWE-bench上对三种先进模型进行实证研究,评估三种轮次控制策略:无限制基线、固定轮次上限加提醒、以及一种新型动态轮次策略(按需扩展)。结果发现,无限制设置下无模型能同时优性能、低成本与高效。固定轮次上限设为基线75百分位时,成本大幅降低24%-68%,解题率影响极小。最显著的是,动态轮次策略持续优于固定限制,在保持或提升解题率的同时,额外节省12%-24%成本,实现智能资源分配。本工作首次系统分析轮次控制策略,为开发者平衡成本与效果提供简单有效的指导。证明动态资源分配是高效且易实现的编码代理部署方案。

原文摘要 · Abstract (English)

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.

编码代理资源优化大模型应用

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。