AI
Coding Agents Burn Far More Tokens in Some Languages Than Others
New research shows AI models solving programming problems can consume vastly different amounts of tokens depending on whether they work in Python, Java, Rust, or OCaml.
Researchers have discovered that coding agents incur dramatically different computational costs depending on which programming language they use to solve the same problems. The study, submitted to arXiv in July 2026 and revised in October, evaluates five recent AI models across Python, Java, Rust, and OCaml to measure how language choice impacts token consumption.
Token Costs Vary Dramatically by Language#
Token efficiency is far from uniform across programming languages. Even when controlling for problem difficulty, the researchers found stark and consistent differences in how many tokens different models burn depending on the target language. This variability held true regardless of which specific model was being tested, suggesting the patterns are inherent to language choice rather than model-specific quirks.
Why the Variation Occurs#
To explain these differences, the team traced the actual behavior of agents throughout their problem-solving process. They re-executed intermediate solutions and mapped each agent's work as sequences of test outcomes, then categorized what the agent was doing between successive iterations.
Two main culprits emerged:
- Struggling with unfamiliar languages: Agents frequently produced code that failed to compile in languages they were less trained on, then spent tokens revising those broken attempts. This iterative fixing cycle bloats token consumption.
- Mistrust of provided tests: Rather than trusting the test cases given to them, agents invented their own inputs and spent additional tokens validating solutions against self-generated examples.
The researchers also found that agents often bypassed unfamiliar target languages altogether by prototyping solutions in Python first, then attempting to translate—a detour that adds substantial overhead.
Implications for Benchmarking#
The findings highlight an overlooked dimension in evaluating multilingual coding agents: raw token efficiency should be tracked alongside correctness. Current benchmarks may mask significant cost differences. The research suggests that developers building or assessing multilingual agents should account for language-specific token consumption as a performance metric, not just whether models produce working code.

