原帖引用 · AI 翻译
标题:“TokenEconomizer:面向编程智能体的经验驱动式黑盒成本控制”
加州大学伯克利分校与微软的新论文提出使用一种从以往运行中学习的外部控制器,将编程智能体的令牌成本降低了 18.4% 至 30.9%。
具体方法是注入学到的事实、移除未使用的工具,并及早停止失败的循环。
编程智能体按令牌计费,而每一轮都会重新发送不断增长的历史记录,因此长期项目的费用会越来越高。令牌效率通常按单个任务衡量,这会漏掉同一代码库中一系列任务累积产生的成本。
TokenEconomizer 作为黑盒位于智能体外部,只调整提示词和工具设置。它从以往运行中学习该注入哪些事实、移除哪些未使用的工具,以及何时停止失败的循环。
在 Claude Code、Codex 和 GitHub Copilot CLI 执行的 277 个 SWE-Bench 任务中,它将平均每项任务的成本降低了 18.4% 至 30.9%。在 5 种智能体与模型组合中,有 4 种的 Pass@1 得到提升,而且每个代码仓库都实现了成本节省。
应衡量智能体在整个项目中的成本,而不是单项任务的成本;应使用能适应各个代码仓库的外部控制器,而不是固定的插件。
原文
New UC Berkeley and Microsoft paper cuts coding-agent token costs by 18.4% to 30.9% using an external controller that learns from past runs. by injecting learned facts, pruning unused tools, and stopping failed loops early. Coding agents are billed by the token, and each turn resends the growing history, so long projects get expensive. Token efficiency is usually measured on isolated tasks, missing the cost that builds up across a sequence of tasks in the same codebase. TokenEconomizer sits outside the agent as a black box, changing only prompts and tool settings. From past runs it learns which facts to inject, which unused tools to drop, and when to stop a failing loop. Across Claude Code, Codex, and GitHub Copilot CLI on 277 SWE-Bench tasks, it cut mean per-task cost 18.4% to 30.9%. It improved Pass@1 in 4 of 5 agent-model settings, and savings held in every repository. Measure agent cost across a whole project, not per task, and use an external controller that adapts to each repo, not fixed plugins.