通过超时级联降低编码智能体的推理成本
Reducing Inference Cost of Coding Agents with Timeout Cascades
AI总结:
本文针对编码智能体GPU成本高的问题,提出先尝试小型模型、必要时升级到大型模型的混合推理策略,在SWE-bench Verified上实现33%的GPU成本降低,且工程复杂度极低。
摘要:
AI编码智能体已成为大语言模型最受欢迎的应用之一,但智能体AI需要消耗大量GPU计算资源,这限制了其盈利性和规模化应用的可行性。本文研究了更小、更廉价的模型能否在不损失准确率的前提下降低成本。我们在软件工程基准SWE-bench Verified上评估了2024年以来发布的36种流行的大、小开源权重模型,发现近期的小型模型与大型模型之间的准确率差距正在缩小。我们分析了该差距的结构,发现差距高度集中在小型语言模型无法解决的困难任务上,而小型模型在简单和中等复杂度任务上的准确率却相当不错。基于这一观察,我们提出了一种混合推理策略:先尝试小型模型,仅在需要时升级到大型模型。该策略可使SWE-bench Verified所有任务的总GPU小时成本降低多达33%,准确率仅下降16.4%,且未牺牲准确率。值得注意的是,这种简单的级联策略几乎能达到神谕式任务路由器的效果,为在生产环境中部署成本敏感的编码智能体提供了一条实用路径,无需复杂的学习型任务路由器,且工程复杂度极低。
英文摘要:
AI coding agents have become one of the most popular applications of large language models. Yet, agentic AI comes at the cost of a tremendous amount of GPU compute resources, which limits its profitability and its viability at scale. In this paper, we investigate whether smaller, cheaper models can cut this cost without sacrificing accuracy. We evaluate 36 popular large and small open-weight models released since 2024 on a software engineering benchmark, and find that recent small models are closing the accuracy gap compared to their large counterparts. We investigate the structure of this gap and find that the gap is highly concentrated around hard tasks that small language models fail to solve while achieving remarkably good accuracy for easy and medium complexity tasks. Following this observation, we show that by utilizing a hybrid inference strategy that tries a small model first and escalates to a large one only when needed, we can achieve up to 33% reduction in total GPU-hour costs and 16.4% on all tasks from SWE-bench Verified, without sacrificing accuracy. Strikingly, this simple cascade nearly matches an oracle-style task router, highlighting a practical path for deploying cost-aware coding agents in production without complex learned task routers and with minimal engineering complexity.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。