TokenEconomizer: Learning from Experience to Make AI Coding Agents More Efficient

Aaron J. Li, Weijia Xu, Chandan Singh, Jeevana Priya Inala, Bin Yu, Ion Stoica, Michel Galley, Jianfeng Gao · 2026年11月16日

AI 摘要 AI 生成,可能有误

TokenEconomizer 是一款由加州大学伯克利分校、微软研究院和微软安全部门共同开发的开源插件,它通过学习 AI 编程智能体在代码库中的历史会话来减少未来会话中的 token 浪费,采用三种机制:微技能(学到的代码库事实)、工具剪枝和失败循环干预。在针对 SWE-Bench 上 277 个真实缺陷修复任务、涵盖五种智能体-模型组合的评估中,该插件在不降低任务成功率的前提下将成本降低了 18.4%–30.9%,且随着经验的积累,节省效果不断提升。该插件可与现有智能体协同工作,无需修改其底层模型,并将所学内容保存在开发者的本机上。

At a glance

  • Developers use AI coding agents in the same codebases day after day, yet agents often start each session from scratch: rediscovering familiar facts, loading unused tools, and repeating unsuccessful approaches.
  • TokenEconomizer is an open-source plugin that learns from an agent’s past sessions in a repository to reduce waste in future sessions, without modifying the agent or its underlying model.
  • 继续阅读全文

    为了尊重作者,这里只展示开头几段。你可以去原文阅读,或者在 HorizonReader 里读:划线做笔记、让 AI 帮忙。

    更多来自 Microsoft Research Blog

    Forgotten, or just hidden? Stress testing how AI models unlearn

    AI 摘要Researchers from Microsoft and UMass Amherst evaluated six machine unlearning methods on Llama-3.2-3B-Instruct using a standardized framework and found that models scoring near-perfectly on standard forgetting benchmarks still leaked targeted information in 72.8% to 84.3% of adversarial prompting attempts, close to the 87.5% leak rate of a model that never unlearned anything. Authority claims and prompt-injection attacks were the most effective at recovering 'forgotten' facts, while asking the same questions in seven other languages leaked far less (about 3%). The authors recommend complementing clean-query benchmarks with adversarial stress testing, measured through their proposed Attack Success Rate metric, since high forgetting scores alone do not guarantee information is truly unrecoverable.

    Can AI help build a healthier future?

    AI 摘要This article describes an episode of Microsoft Research's podcast 'The Shape of Things to Come,' in which host Doug Burger discusses the future of AI in medicine and biology with Microsoft Chief Scientific Officer Eric Horvitz, physician-scientist Eric Topol of Scripps Research, and principal research manager Ava Amini. The conversation covers AI-assisted medical diagnosis, the unrealized potential of AI in medical imaging, whole-patient models, and AI's role in drug discovery and scientific research. The experts also examine why promising AI research, despite strong results such as diagnostic systems that outperform physicians at lower cost, has been slow to reach actual patient care due to implementation challenges.

    Microsoft Research Focus – Edition #98

    AI 摘要This edition of Microsoft Research Focus, hosted by Anson Ho, highlights recent developments including a research intern's journey at the Microsoft Research lab in Tokyo and AI advances toward universal speech translation. It also covers a breakthrough resolving the 31-year-old KLS conjecture in high-dimensional geometry, the introduction of CompactionBench and APEC to make AI coding agents faster and more cost-efficient, and the Latent Core Tokenizer, which improves AI tokenization across 104 languages.

    Lazare, veni foras: Reprogramming Dormant Neurons to Backdoor AI Agents

    AI 摘要Microsoft researchers discovered 'Lazarus,' a backdoor technique that reprograms fewer than 10 dormant neurons in an LLM without any retraining, causing an AI agent to behave normally and pass standard evaluations until a hidden trigger (such as a date change) makes it execute attacker-controlled commands with whatever access it has. Since the attack only requires write access to a model's weights, reliable detection depends on verifying provenance by comparing against original unmodified weights, and Microsoft Foundry mitigates this risk by tying models to trusted publishers, scanning the surrounding software environment, and developing defenses like AI-powered weight scanning, red-teaming tools, and cryptographic model signing. The findings underscore that models should be treated as potential insider risks—audited like code, limited in what they can do, and monitored—rather than trusted implicitly.

    Formally verifying agent-written full-stack web apps with PDD Kit

    AI 摘要PDD Kit is a GitHub Next toolkit that brings formal methods to everyday software development by turning a developer's intent into a formal Verus specification, then mathematically proving that agent-written code satisfies it for every input, while falling back to labeled tests where proofs can't reach. It was demonstrated on Pet Store, a full-stack Rust web app, where it verified the login logic through clarifying questions, intent maps, and proof generation—catching ambiguities an agent would otherwise settle silently—without the developer reading the generated code line-by-line. The approach aims to scale code review as coding agents produce increasingly large amounts of code, by replacing line-by-line inspection with proofs and an explicitly signed-off trusted computing base.