PapersSelected

UC Berkeley 与 Microsoft 论文:TokenEconomizer 将编码智能体 token 成本降低 18.4%–30.9%

Why we picked it

做编码智能体的开发者都会遇到 token 账单越滚越大的问题,这篇论文给出黑盒外挂方案:学事实注入、剪工具、砍死循环。在 Claude Code、Codex、Copilot CLI 上实测省两到三成成本,准确率还不掉。自己搭 agent 工作流的人值得照着复现。

UC Berkeley 与 Microsoft 的研究者发布 TokenEconomizer,一个位于编码智能体之外的外部控制器,在 277 个 SWE-Bench 任务上将平均单任务 token 成本降低 18.4% 到 30.9%。编码智能体按 token 计费,每轮对话都会重发不断增长的历史记录,同一代码库中跨任务的累计成本往往被忽视。

Body

TokenEconomizer 以黑盒方式工作,只修改提示词和工具设置:从过去的运行记录中学习应注入哪些事实、剪枝哪些未使用的工具,以及在失败循环中何时提前停止。它不改动智能体内部实现。

实验覆盖 Claude Code、Codex 和 GitHub Copilot CLI 三种智能体,在 5 个智能体-模型组合中的 4 个里 Pass@1 不降反升,且成本节省在每个代码库中都成立。论文建议按整个项目而非单任务度量智能体成本,并使用能适配各代码库的外部控制器,而非固定插件。

Original · rohanpaul_ai

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.

Industry Coordinates & Source Verification

This report is categorized under AITOP's "Papers" desk, focusing on US frontier AI labs and Silicon Valley technology leaders. Within our cross-regional analytical framework, it directly maps to AI developer toolchains, coding agents, and engineering workflows and US-China foundation model benchmarks and commercialization comparison. Key entities and technical topics under continuous tracking include TokenEconomizer, Claude Code, Codex, SWE-Bench.

Source attribution: curated from rohanpaul_ai (@rohanpaul_ai).