How Do AI Agents Spend Your Money? Analyzing and Predicting Token Consumption in Agentic Coding Tasks
This paper presents the first systematic study of token consumption in agentic coding tasks, revealing that agentic workflows are exceptionally expensive and stochastic, models vary significantly in efficiency, and frontier LLMs struggle to accurately predict their own token costs.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you hire a highly skilled, but slightly unpredictable, digital handyman to fix a leak in your house. You don't know if he’ll finish in ten minutes or spend three days tearing up your entire floor, and you only find out the total bill once he’s finished and the tools are put away.
This research paper is essentially a "financial audit" of these digital handymen (called AI Agents). The researchers wanted to know: How much do these agents actually cost, where does the money go, and can they tell you the price before they start working?
Here is the breakdown of what they found, using some everyday analogies:
1. The "Black Hole" of Costs (Input vs. Output)
When you chat with a standard AI (like a quick text message), it’s like buying a coffee—cheap and predictable. But when you give an AI an "agentic task" (like "fix this entire software project"), it’s like hiring a contractor.
The researchers found that these tasks are 1,000 times more expensive than a simple chat. Most importantly, the cost isn't coming from the AI "talking" (the output); it’s coming from the AI "reading" (the input).
- The Analogy: Imagine you hire a researcher. You aren't paying them for the three sentences they write in their report; you are paying them for the 500 books they had to read and keep on their desk just to understand your question. In AI terms, the "books" are the massive amounts of code the agent has to re-read over and over again to keep track of what it's doing.
2. The "Lost in the Woods" Problem (Efficiency)
You might think that if an agent spends more time and "brainpower" (tokens) on a problem, it will eventually solve it. The researchers found this isn't true.
Sometimes, an agent gets stuck in a loop. It reads a file, tries to fix it, fails, reads the same file again, tries something else, and fails again.
- The Analogy: It’s like a person trying to find their way out of a forest. Instead of walking in a straight line, they keep walking in circles. They are burning calories (money) and getting more tired, but they aren't actually getting any closer to the exit. In fact, the more "energy" they burn, the less likely they are to succeed because they are just spinning their wheels.
3. The "Expert vs. Robot" Gap
If you asked a human plumber how long a job would take, they’d give you a pretty good estimate. But the researchers found that human experts are actually bad at predicting how much an AI will spend.
- The Analogy: A human might look at a leaky faucet and say, "That's a 10-minute job." But the AI agent might look at that same faucet and decide it needs to inspect every single pipe in the entire house first. The "difficulty" a human sees is totally different from the "complexity" the robot experiences.
4. Can the AI give you a Quote? (The Prediction Test)
The most important question was: Can we ask the AI, "Hey, before you start, how much is this going to cost me?"
The researchers let the AI "scout" the job first and then give a quote. The result? The AI is a terrible accountant.
- The Analogy: It’s like asking a contractor, "How much will this renovation cost?" and they say, "$500," only for you to receive a bill for $5,000. The AI almost always underestimates the cost. It’s "optimistic" to a fault—it thinks it can solve the problem easily, but it doesn't realize how many "books" it will end up having to read once it actually gets into the messy details.
The Bottom Line
The paper concludes that as we move from "AI you talk to" to "AI that does work for you," the economics change completely. We are moving from a world of "pay per word" to a world of "pay per project," and right now, those projects are expensive, unpredictable, and the "contractors" (the AIs) aren't very good at telling us what the final bill will be.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.