How we make AI coding more cost efficient without sacrificing task quality
GitHub Copilot examines four changes to reduce costs without sacrificing task quality.
Intelligence analysis by Qwen 2.5 (3B)

GitHub Copilot improves efficiency by optimizing tool calls and preserving context, reducing repetitive output and saving tokens.
GitHub Copilot makes AI coding more efficient by keeping important information and removing extra details, so the AI doesn't have to repeat work and the coding process is faster.
Analysis
Understanding the Problem
GitHub Copilot, like other AI coding agents, faces challenges with token count and context preservation. Shorter tool responses can sometimes require additional calls or work, making tasks slower and more expensive.
The Solution
To address these issues, GitHub Copilot implemented four key changes: preserving useful context, removing repetitive output, shortening instructions, and delivering completed background work. These changes were evaluated using agentic coding benchmarks and validated through controlled online experiments.
Compressing Repetitive Output
The team developed a selective output compressor that preserves source-like and arbitrary output, reorganizes search results, and selectively compresses repetitive noise. This approach ensures that the model does not need to repeat work and maintains the necessary context for task completion.
Removing Formatting
The view tool, which agents use to read file contents, no longer prefixes lines with numbers, aligning with current file-editing tools that do not rely on line numbers for change targeting.
Evaluating the Changes
The changes were tested across various open-source repositories and benchmarks. The results showed that these optimizations led to a reduction in tokens per tool call and improved task success rates without sacrificing task quality.
Future Work
GitHub Copilot plans to continue refining these optimizations and exploring additional ways to improve efficiency and cost-effectiveness in AI coding.
Key points
- GitHub Copilot implemented four key changes to improve efficiency and cost-effectiveness in AI coding.
- The changes include preserving useful context, removing repetitive output, shortening instructions, and delivering completed background work.
- These optimizations were tested and validated through controlled online experiments.
- The results showed a reduction in tokens per tool call and improved task success rates.
- GitHub Copilot plans to continue refining these optimizations and exploring additional ways to improve efficiency.
These optimizations could lead to faster and cheaper AI coding, benefiting developers and organizations using GitHub Copilot.
However, if these optimizations are not implemented correctly, they could lead to errors or incomplete tasks.
