TokenEconomizer:面向编码智能体的经验驱动黑盒成本控制

·

研究论文 · 2026/10/20

前沿编码智能体在真实项目中的令牌成本被低估,现有方法难以降低。本文提出TokenEconomizer,一个外部控制器,通过注入操作微技能、修剪持续无关工具、干预无效失败循环,在任务序列中降低环境特定令牌成本。在Claude Code、Codex和GitHub Copilot CLI上,平均令牌成本降低18.4-30.9%,任务成功率相当,且在不同仓库和领域(如顺序Web开发和安全审计)中均有效,成本降低6.4-21.2%。

该研究针对真实开发场景中编码智能体的令牌成本问题,提出了一种无需修改智能体内部的黑盒控制方法,在多个主流智能体上显著降低成本且保持任务成功率,具有实际应用价值。

Advances in frontier coding agents have sharply increased the token costs of AI-assisted software engineering. Their token efficiency is typically evaluated on isolated tasks, whereas real-world developers use them to continuously build, update, and maintain large-scale projects. This mismatch motivates us to evaluate agents over sequences of realistic coding tasks, where we find that agents exhibit recurring environment-dependent token costs that existing methods struggle to reduce. To minimize these costs, we introduce TokenEconomizer, an external controller that cuts environment-specific token costs over a sequence of tasks. These cuts come from determining (i) which operational micro-skills to inject, (ii) which persistently irrelevant tools to prune, and (iii) when to intervene in unproductive failure loops. Across Claude Code, Codex, and GitHub Copilot CLI paired with frontier models, TokenEconomizer reduces the average token cost by 18.4-30.9% with comparable task success. Savings hold in every repository under every tested agent-model setting and generalize to diverse domains such as sequential web development and security auditing, where costs fall by 6.4-21.2% depending on task structure. Our work establishes adaptive black-box cost control as a promising direction for reducing token costs of coding agents in realistic settings.

阅读原文

参与讨论