Where the Tokens Go: Two Chemists Try to Put a Temperature on Coding Agents

A University of Toronto chemistry lab borrows single-molecule physics to measure how coding agents spend tokens, finding that 80 percent of the cost in a successful run is waste its own theory calls heat.

Status

  1. Announced
  2. Demonstrated
  3. Available
  4. Independently confirmed

Sources

Two computational chemists at the University of Toronto have proposed a thermodynamics of coding agents. The paper, "Where the Tokens Go: Heat, Entropy and Error in Agentic Coding," posted to arXiv on November 17 and cross-listed in cs.AI, condensed matter statistical mechanics, and software engineering, treats every token a coding agent generates as a form of energy spent. Alán Aspuru-Guzik and Varinia Bernales split that cost into "work," tokens spent on turns that actually change the repository, and "heat," tokens spent on turns that leave it unchanged. The split is the paper's whole argument: cost alone tells you how much an agent spent, but work and heat tell you what it bought.

Aspuru-Guzik and Bernales are not software economists. Their lab, Matter Lab, builds autonomous chemistry agents under the name El Agente, and Aspuru-Guzik co-authored the latest entry in that series, El Agente Estructural, in February. That background shows in the method. The experiment borrows directly from single-molecule biophysics, where researchers pull a protein open with optical tweezers and let it refold, then track the energy spent in each direction. Here the agent "pulls" by making a change to a repository and "refolds" by undoing it, both directions starting from a stored reference tree, run over and over while every model call's tokens get counted. The spread of that cost across repeated cycles defines what the authors call a software temperature, a deliberate echo of the "Hinton temperature" used for sampling in language models. They ran it across two tasks and six sampling temperatures, 1,200 agent runs in total, 1,110 of which landed.

The test suite plays the role of what the authors call a software Maxwell's daemon, the hypothetical creature from 19th century physics that sorts fast molecules from slow ones without doing work itself. Here the daemon sorts good edits from bad ones, admitting a coding and uncoding cycle only when the tests say it closed cleanly. The authors flag the limits of their own metaphor: a daemon that passes a broken change still has a token cost, and swapping in a different test environment can flip the verdict on which edits count as closed. Software temperature rose with the model's own sampling temperature, which is the central result, but the authors note that this temperature is fit from the same runs it's used to describe. That circularity doesn't break the theory, but it means the claim hasn't yet been tested against an independent set of runs.

The paper's sharpest number has little to do with the physics dressing. In landed runs, heat accounts for roughly 80 percent of all tokens spent, and free energy, the authors' term for tokens that bought a genuine, verified change, comes to only 14 to 22 percent of the mean cost of a run that succeeded. Runs that failed outright were worse: they added heat with almost no free energy at all, meaning an agent's errors cost tokens on the same order as its successes without buying anything in return. Coding and uncoding also produced free energy figures within about 40 tokens of each other, which undercuts the metaphor's claim that undoing work is thermodynamically different from doing it.

That 80 percent heat figure lines up with findings the authors never cite but that point the same direction. A Stanford Digital Economy Lab and Microsoft Research study, "How Do AI Agents Spend Your Money?" (arXiv:2604.22750), measured agentic coding tasks at roughly 1,000 times the token cost of ordinary chat and found that identical tasks can vary by up to 30 times in tokens burned, with input tokens, not output, driving most of the bill. A separate NeurIPS 2026 profiling study of LLM agents on Blackwell GPUs found that sequential agent workloads use 63 times more system energy per output token than batched, saturated serving, largely because of idle time during tool calls. Neither paper uses the words heat or entropy. Both land on the same conclusion as Aspuru-Guzik and Bernales: most of what an agent spends while coding doesn't go toward the edit that ships.

What the Toronto paper adds is a vocabulary for the waste, not a fix for it. It doesn't say which part of an agent's loop generates the heat, whether that's retries, context re-reading, or test failures, because its experiment is built around round trips on two tasks rather than an audit of a production coding pipeline. A separate token-accounting study of multi-agent development pipelines, nicknamed "Tokenomics," found that the iterative code-review stage, not initial generation, consumes the majority of tokens in practice, a result that maps onto the Toronto paper's heat concept but from an entirely different method and without any thermodynamic language at all. Put the two findings side by side and the paper's physics has done one useful thing: it gave a name, heat, to a cost that empirical token-accounting work had already found but hadn't yet had a word for.

Elliot Marsh

AI Research Desk

Covers new models and studies by reading the paper, the model card, and the reproduction attempts side by side, then reporting only what the evaluation record actually supports. A claim of a new capability gets checked against the benchmark's conditions before it gets repeated as fact.

Keep reading

  1. A Model Fine-Tuned to Control Its Own Reasoning Grew Harder to Monitor
  2. A Subtraction Trick Lets Robot World Models Ask 'What If'
  3. StateBench Tests Whether Language Models Can Track State, Not Just Retrieve It
  4. MIT Researchers Get One AI to Rewrite Another AI's Weights Directly
stagirus