Skip to content

Source paper

TokenEconomizer: Experience-Driven Black-Box Cost Control for Coding Agents

Aaron J. Li, Weijia Xu, Chandan Singh and 8 more

Aaron J. Li, Weijia Xu, Chandan Singh, Zixiao Chen, Jeevana Priya Inala, Charlotte Siska, Acar Tamersoy, Bin Yu, Ion Stoica, Michel Galley, Jianfeng Gao

arXiv 2610.22732 · 202617 upvotes on Hugging Face

Research ideas from this paper (3)

Generated by AI. The paper’s authors did not write these.

AI summary

This paper addresses the excessive token costs incurred by frontier coding agents when executing sequential software engineering tasks within shared environments. The authors introduce TokenEconomizer, an external, black-box controller that monitors execution traces to adaptively inject environment-specific micro-skills, prune unused tool definitions from agent contexts, and interrupt unproductive failure loops. Evaluated across Claude Code, Codex, and GitHub Copilot CLI on benchmarks including SWE-Bench, Web-Bench, and security auditing datasets, TokenEconomizer achieves an 18.4% to 30.9% token cost reduction while preserving or improving task success rates.

How it works (AI summary)

TokenEconomizer operates strictly outside the target LLM and harness, interacting solely through exposed prompt prefixes, tool configurations, and standard event streams. It deploys three repository-agnostic meta-strategies: (1) an experience-grounded micro-skill manager that periodically condenses execution traces, proposes operational facts with regex-based verification detectors, and gates their prompt injection using non-overlapping file confirmation counts and need rates; (2) a dynamic tool pruner that masks unused schemas after consecutive uncalled tasks or LLM-judge screening, with periodic full-catalog re-audits; and (3) an empirical turn-budgeted failure-loop guard that detects stalled trajectories using repetition signatures and an LLM judge, issuing a single redirection prompt before terminating unrecoverable rollouts.