GitHub Copilot cut inference costs ~5% by removing line numbers — and found shortening tool output can backfire
GitHub Blog AI/ML · rss · 2026-09-03
GitHub shares four changes that made Copilot more cost-efficient, based on a key principle: optimize for task outcomes, not tokens per tool call.
- The local-metric trap: Evaluating RTK (a shell-output shortener) showed that truncated output forces agents to re-read or re-run commands, making whole tasks longer and more expensive despite shorter individual responses.
- Selective output compression: Compress only repetitive install/build/test noise; preserve cat, git diff, and arbitrary output verbatim, with a recovery path to the full original. No statistically significant task-success regression; agents almost never reopened originals.
- Remove unused formatting: Dropping line-number prefixes from the view tool cut offline inference cost 5% and online per-user daily cost 3%, since current edit tools match surrounding code, not line numbers.
- Meta-prompting loop: Copilot rewrote its own task-tool prompt, cutting it roughly in half, with behavioral tests guarding against regressions that offline evals initially missed.
- Methodology: offline agentic benchmarks first, then controlled online A/B experiments using a unified AI-credit cost metric.
More from coding & agent
- Developer asks: is LangChain still worth it vs rolling your own agent harness? — curious_vii · 2026-09-03
- Inference Engineering Is Just a Recipe: vLLM/SGLang, Replicas, Cache-Aware Routing — GabGarrett · 2026-09-03
- Developer accidentally built an entire agent factory with Fable 5.1 — 0xkarasy · 2026-09-03
- Microsoft adds Fabric data agents to Foundry agents via Fabric IQ (preview) — adnan_hashmi · 2026-09-03
- Databricks pitches agent-native data infrastructure, Lakebase Postgres at VLDB 2026 — matei_zaharia · 2026-09-03
- doodlestein ships a comprehensive web app review skill after months of debugging — doodlestein · 2026-09-03