Borrowing the accounting

Coding agents are billed by the token, and software engineering has no theory of what a token actually buys. Alán Aspuru-Guzik and Varinia Bernales propose borrowing one from physics. Their paper sets out what they call a theory of software thermodynamics: count the tokens an agent generates as its cost, then divide that cost into work and heat.

In their framing the test suite is a software Maxwell’s daemon, the thing that judges every change and decides whether it counts. Tokens spent in model calls that leave the requested change where it was are heat. Tokens that move the repository towards the requested state are work.

The experiment

Aluminium heat sink fins photographed in close up
Tokens spent on calls that leave the change where it was are counted as heat. Illustrative image. Miguel Á. Padriñán · pexels · Pexels License

To test the analogy the authors borrow an experimental design from single-molecule physics, where a molecule is pulled open and allowed to fold again many times. Their version has an agent make a change to a repository and then undo it — coding and uncoding — over many cycles, each direction starting from a stored reference tree, counting the tokens of every model call.

The spread of the cost over repeated cycles defines what they call a software temperature, and it rose with the sampling temperature of the model, which is the sort of correspondence an analogy needs if it is going to be more than a metaphor.

The numbers

About 80% of the tokens in a successful run are generated in model calls that leave the requested change where it was. That is the heat. The free energy of a change, which the authors estimate by analogy with the Jarzynski equality, comes to 14% to 22% of the mean cost of a successful coding run. Coding costs between 1.1 and 1.5 times as much as uncoding.

A heating manifold with a circulation pump and a temperature gauge
Coding costs 1.1 to 1.5 times as much as undoing the same change. Illustrative image. Pavel Danilyuk · pexels · Pexels License

The daemon is also imperfect, and the paper prices that too. A test suite’s verdict varies with its environment, and a suite that accepts a broken change has a cost measured in tokens — the work that gets spent downstream on a change that should have been rejected.

What to watch

This is a theory paper with a demonstration attached, not a measurement of production systems, and the cycle it measures — make a change, undo it, repeat — is a laboratory construct rather than how anyone actually works. The 80% figure should be read as what that construct produced, not as a fleet-wide efficiency number.

What makes it worth following is the practical implication the authors name: if the cost of an agent run decomposes into work and heat, then tools that measure the ratio become possible, and so does optimising for it. Right now a team that halves its token bill cannot easily tell whether it removed waste or removed capability. A thermodynamic account, if it survives contact with real repositories, would tell them which.