Skip to content

The Best Programming Language for Tokenmaxxing: An Investigation of Coding Agent Behavior Across Programming Languages

Jul 2026 · arXiv.org · Vol abs/2607.22807 · 1 citation · ⚡ 1 influential · 34 references
Computer Science

TL;DR

The results show that by-language token efficiency is a metric that should be considered when benchmarking and developing multilingual agents, and, for the tokenmaxxer, a guide to the most expensive language to work in.

Abstract

Although coding agents are now very effective in a variety of programming languages, this paper first shows that the cost (in tokens) can very significantly by programming language. We evaluate five recent models on programming problems in Python, Java, Rust, and OCaml. We carefully control for problem difficulty, and show that there can be stark variation in token consumption that is consistent across models. To understand why, we analyze both the structure and content of agent trajectories. First, we re-execute every intermediate solution and abstract each trajectory as a sequence of test-outcome vectors, then label the work between successive solutions. This reveals agents repeatedly producing noncompiling solutions in unfamiliar languages and revising solutions that already pass. Second, we analyze trajectory text, finding that agents plan solutions in code comments, distrust the provided tests in favor of inputs they invent, and sidestep unfamiliar target languages by prototyping in Python. Our results show that by-language token efficiency is a metric that should be considered when benchmarking and developing multilingual agents, and, for the tokenmaxxer, a guide to the most expensive language to work in.

View source

Similar papers

Sep 2026

Compiling with the Sequent Calculus

This work is a continuation, and generalization, of Andrew Appel's landmark work on “Compiling with Continuations”, but instead of natural-deduction-based languages like the lambda calculus, it uses sequent-calculus-inspired languages throughout all intermediate stages.

Marius Müller, David Binder, Marco Tzschentke et al. · 0 citations
Preprint Sep 2026

Where the LLM Ends and Reliable Decisions Begin

The ANVIL compiler architecture is proposed, where ANVIL performs exceptionally well on leading benchmarks by using language models purely where they are effective, rather than as a catch-all tool.

Priyadarshan Patil, A. Basu, Vikas Reddy et al. · 0 citations
Open access 2026

Mathematical Methods and Algorithms for Large Language Model Token Optimization in Modern Agentic Artificial Intelligence Enterprise Systems

Large language models now sit at the centre of enterprise agentic pipelines that plan, retrieve, call tools, and generate answers under strict cost and latency budgets. In these systems the token is the fundamental unit of both computation and price, so the mathematics of spending tokens efficiently has become a first...

S. S · 0 citations
#natural language process... Preprint Sep 2026

When Agents Slow Down: Understanding LLM Agents'Test-Time Strategies via Elo-per-token Analysis

This work defines the scaling inflection point as the per-session budget where marginal Elo gains match the independent-sampling reference, and proposes Elo-per-token analysis, which tracks the best solution found at each token budget and uses a Bradley-Terry model to aggregate within-task orderings into Elo ratings ac...

Kai-Yuan Liu, Qiu-Yang Mang, Bo-Fei Peng et al. · 3 citations
Open access Sep 2026

From Voice to Robot: Evaluating Large Language Models for Industrial Programming with HARPA

Recent advances in generative artificial intelligence and large language models (LLMs) have increased the feasibility of translating natural-language instructions into executable robot programs, reducing the technical barrier separating shop-floor operators from industrial robotic programming. However, current evalua...

Beatriz Consciência, Ricardo Correia, C. Wanzeller · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.