AI 程式助理會在每一輪重送越來越長的對話紀錄,長期維護同一個程式專案時,token 費用也會一路累積。
- UC Berkeley 與 Microsoft 的研究提出 TokenEconomizer,讓它在助理外部參考過往執行紀錄,挑出要補進提示詞的資訊、移除沒用到的工具,並在失敗的迴圈持續時提早停止。研究在 Claude Code、Codex 和 GitHub Copilot CLI 的 277 項 SWE-Bench 任務中測試,平均每項任務的成本降低 18.4% 到 30.9%。
- 5 種助理與模型組閤中有 4 種的 Pass@1 也提升。研究也指出,成本應按整個專案的多項任務一起計算。
AI 伴隨問答
針對這篇報導有疑問?可直接點選快捷問題或向 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.