Token 都去哪儿了:智能体编程中的热、熵与错误
摘要
该论文提出了一种面向智能体编程的软件热力学理论,将词元视为由功和热两部分构成的成本,并将测试套件视为一个不完美的麦克斯韦妖,通过实验测量编码与撤销编码的往返成本,并估算自由能。
arXiv:2611.23375v1 Announce Type: new
Abstract: Coding agents are billed by the token, yet software engineering says nothing about what a token actually buys. Here we introduce a theory of software thermodynamics. The theory draws analogues from classical and stochastic thermodynamics, extends them, and applies them to modern agentic coding. We count the tokens an agent generates as its cost and divide that cost into work and heat. The test suite acts as a software Maxwell's daemon that judges every coding change. We test the theory with an analogue of the experiments in which a single molecule is pulled open and let fold again: an agent makes a change to a repository (coding) and then undoes it (uncoding), many times over, and we count the tokens of every model call. The cycle returns the requested edits to where they began, with each direction started from a stored reference tree, and the spread of its cost over repeated cycles defines a software temperature, which rose with the sampling temperature of the model. About 80 per cent of the tokens of a successful run are generated in model calls that leave the requested change where it was, and we call these tokens heat. The free energy of a change, which we estimate by analogy with the equality of Jarzynski, is 14 to 22 per cent of the mean cost of a successful coding run. Coding costs 1.1 to 1.5 times as much as uncoding. The daemon is imperfect: the verdict of a test suite varies with its environment, and a suite that accepts a broken change has a cost in tokens. The practical implication of the proposed theory could be new tools for analysing and optimising coding agents through the lens of thermodynamics.
查看缓存全文
缓存时间: 2026/11/20 09:02
# Where the Tokens Go: Heat, Entropy and Error in Agentic Coding
Source: [https://arxiv.org/html/2611.23375](https://arxiv.org/html/2611.23375)
Alán Aspuru\-GuzikAffiliation:Department of Computer Science, University of Toronto, Toronto, CanadaAffiliation:Department of Chemistry, University of Toronto, Toronto, CanadaAffiliation:Acceleration Consortium, Toronto, CanadaAffiliation:Vector Institute for Artificial Intelligence, Toronto, CanadaAffiliation:NVIDIA, Toronto, CanadaAffiliation:Corresponding authors: alan@aspuru\.com, varinia@bernales\.orgVarinia BernalesAffiliation:Department of Computer Science, University of Toronto, Toronto, CanadaAffiliation:Department of Chemistry, University of Toronto, Toronto, CanadaAffiliation:Acceleration Consortium, Toronto, CanadaAffiliation:Corresponding authors: alan@aspuru\.com, varinia@bernales\.org
November 2026
###### Abstract
Coding agents are billed by the token, yet software engineering says nothing about what a token actually buys\. Here we introduce a theory of software thermodynamics\. The theory draws analogues from classical and stochastic thermodynamics, extends them, and applies them to modern agentic coding\. We count the tokens an agent generates as its cost and divide that cost into work and heat\. The test suite acts as a software Maxwell’s daemon that judges every coding change\. We test the theory with an analogue of the experiments in which a single molecule is pulled open and let fold again: an agent makes a change to a repository \(coding\) and then undoes it \(uncoding\), many times over, and we count the tokens of every model call\. The cycle returns the requested edits to where they began, with each direction started from a stored reference tree, and the spread of its cost over repeated cycles defines a software temperature, which rose with the sampling temperature of the model\. About 80 per cent of the tokens of a successful run are generated in model calls that leave the requested change where it was, and we call these tokens heat\. The free energy of a change, which we estimate by analogy with the equality of Jarzynski, is 14 to 22 per cent of the mean cost of a successful coding run\. Coding costs 1\.1 to 1\.5 times as much as uncoding\. The daemon is imperfect: the verdict of a test suite varies with its environment, and a suite that accepts a broken change has a cost in tokens\. The practical implication of the proposed theory could be new tools for analysing and optimising coding agents through the lens of thermodynamics\.
A model proposes changes to a repository, one after another, and every word it proposes costs tokens; that is the engine, and the tokens are its fuel\. The daemon at the gate cannot write code\. She runs the tests on each change and opens the door for the changes that pass\. Maxwell’s daemon sorted fast molecules from slow ones by looking; ours sorts working changes from broken ones the same way, and like his, she pays for looking, and sometimes she makes mistakes herself\! A change made and then unmade passes her twice and leaves the requested change where it began, so everything the round trip cost was lost\. This article asks four things of the engine and its daemon: what a round trip costs, what is the least that a change can cost and where the rest goes, how reliably she reads the errors, and what her wrong readings cost\.
## \\materiaDisplay1\\materiaDisplayIntroduction
In one survey of 2025, 90 per cent of technology professionals reported that they use AI at work\[[1](https://arxiv.org/html/2611.23375#bib.bib1)\]\. In another, about 31 per cent of respondents reported that they use AI agents at work, some of them infrequently\[[2](https://arxiv.org/html/2611.23375#bib.bib2)\]\. Therefore, it is important to understand the efficiency of the tools that these professionals employ\. A coding agent is a language model that acts on a repository through a harness, the program that gives the model its tools\[[3](https://arxiv.org/html/2611.23375#bib.bib3)\]\. It edits a repository toward a stated goal, and in the setting we study it edits until the change passes a set of tests, which we call the gate\. Code that passes the gate is kept\. We ask how many tokens go into the code that is kept and how many are spent elsewhere\. Borrowing a word from thermodynamics, we call the latter*heat*\.
One change and its bill\.An agent renames a module, updates every reference to it and runs the tests\. The run costs about 2,300 tokens\. About 1,900 of them go to reading, searching and testing, which we call heat, and about 400 go to the edits, which we call work\. We estimate that the change could cost as little as 350 tokens, its free energy\.111The numbers of the box are means over the landed coding runs of Task A at a Hinton temperature of 0\.5 \(§[4\.8](https://arxiv.org/html/2611.23375#S4.SS8)\): 2,305 tokens, of which 1,890 are heat and 415 are work, and an estimated free energy of 351 tokens\.This article is about where the rest goes\.
Figure 1:The three experiments described in this article, shown schematically\. In every panel the forward direction is drawn in rose and the reverse direction in black\. \(A\) Carnot’s engine\. A Maxwell daemon moves the piston, so that the gas expands and is then compressed\. The cycle has two isotherms \(solid\) and two adiabats \(dashed\), and the area that they enclose is the work delivered\. \(B\) The pulling of a single molecule\. A Maxwell daemon holds optical tweezers and pulls an RNA molecule with their optical trap\. Moving the trap away unfolds the molecule, and moving it back lets the molecule refold\[[4](https://arxiv.org/html/2611.23375#bib.bib4)\]\. The force against the extension differs from one repetition to the next, and the shaded area under the refolding curve is the work that the molecule returns as it refolds\. \(C\) Coding and uncoding \(this work\)\. An agent changes a repository \(coding, forward\) and then undoes the change \(uncoding, reverse\)\. The gate daemon stands for the test suite and judges every change\. The plot shows the output tokens that three runs in each direction had spent after each turn\. Both directions cost tokens\.Table 1:Correspondence between classical thermodynamics and the software thermodynamics proposed in this work, in four groups\. The first column names the idea, the second gives its symbol or symbols, the third its meaning in classical thermodynamics, either as a concept or as an example, and the fourth its counterpart in software\. The last two columns give the section where the line is defined, set or chosen, and the section where it is measured or estimated\. The results test how far the definitions behave like the originals\.Statusof each software entry:ddefined;eestimated from runs;aanalogy;huntested hypothesis\.IdeaSymbol\(s\)Classical thermodynamicsSoftware thermodynamicsStatusDefinedMeasuredThe system, work and heatSystemA gas in a cylinderA*tree*: a code repository at one exact versiond§[2\.1\.1](https://arxiv.org/html/2611.23375#S2.SS1.SSS1)ProcessOne stroke of the pistonA*run*: an agent edits the tree, call by call, until the tests passd§[2\.1\.2](https://arxiv.org/html/2611.23375#S2.SS1.SSS2)Reaction coordinateqqThe extension of a pulled moleculeThe fraction of the change’s blocks that are in place in the treed§[2\.1\.1](https://arxiv.org/html/2611.23375#S2.SS1.SSS1)§[4\.1](https://arxiv.org/html/2611.23375#S4.SS1)CostCCThe fuel burnedThe tokens that the model generates in a run, whether or not the run landsd§[2\.1\.2](https://arxiv.org/html/2611.23375#S2.SS1.SSS2)§[2\.2](https://arxiv.org/html/2611.23375#S2.SS2)WorkWWThe energy that the piston puts inThe tokens of the turns that add target edits to the tree; turns that remove them count negative \(Eq\.[6](https://arxiv.org/html/2611.23375#S2.E6)\)d§[2\.1\.3](https://arxiv.org/html/2611.23375#S2.SS1.SSS3)§[2\.5](https://arxiv.org/html/2611.23375#S2.SS5)HeathhThe energy that leaves as disorderThe tokens of the turns that leave the target edits unchangedd§[2\.1\.3](https://arxiv.org/html/2611.23375#S2.SS1.SSS3)§[2\.2](https://arxiv.org/html/2611.23375#S2.SS2)QQThe sum of all the tokens of a cycled§[2\.1\.4](https://arxiv.org/html/2611.23375#S2.SS1.SSS4)§[2\.5](https://arxiv.org/html/2611.23375#S2.SS5)EnergyEEThe energy of one microstateThe minimum average work that builds one exact tree from the empty repository \(Eq\.[9](https://arxiv.org/html/2611.23375#S2.E9)\)d§[2\.1\.6](https://arxiv.org/html/2611.23375#S2.SS1.SSS6)Free energyFFThe least work that takes a system from one state to anotherThe minimum average work that a change can cost \(Eqs\.[8](https://arxiv.org/html/2611.23375#S2.E8)and[13](https://arxiv.org/html/2611.23375#S2.E13)\)e§[2\.1\.5](https://arxiv.org/html/2611.23375#S2.SS1.SSS5)§[2\.5](https://arxiv.org/html/2611.23375#S2.SS5)DissipationThe work beyond the reversible minimum, lost as heatThe mean work above the free energy,⟨W⟩−ΔF\\langle W\\rangle\-\\Delta Fe§[2\.1\.5](https://arxiv.org/html/2611.23375#S2.SS1.SSS5)§[2\.5](https://arxiv.org/html/2611.23375#S2.SS5)Temperature, entropy and informationSoftware temperature1/β1/\\betaHow hard the molecules jostle,kBTk\_\{B\}TThe tokens that one nat costs the model \(Eqs\.[19](https://arxiv.org/html/2611.23375#S4.E19)and[14](https://arxiv.org/html/2611.23375#S2.E14)\)eHinton temperature\[[5](https://arxiv.org/html/2611.23375#bib.bib5)\]THT\_\{\\rm H\}No counterpart: a dial on the apparatusThe sampling setting of the LLM’s API \(lower samples less, higher samples more\)dEntropySSThe logarithm of the number of microstates compatible with what one can seeThe logarithm of the number of distinct trees that count as done; our count is a lower bounde§[2\.3](https://arxiv.org/html/2611.23375#S2.SS3)§[2\.3](https://arxiv.org/html/2611.23375#S2.SS3)Unit of informationThe nat and the bit; one bit isln2\\ln 2natsThe same; a verdict of the gate is at most one bit, and a fork withkkbranches carries at mostlog2k\\log\_\{2\}kbitsdPrice of a bitkBTln2k\_\{B\}T\\ln 2of heat to erase it \(Landauer, Eq\.[3](https://arxiv.org/html/2611.23375#S1.E3)\)By analogy,\(1/β\)ln2\(1/\\beta\)\\ln 2tokens to settle one fork between two waysh§[2\.3](https://arxiv.org/html/2611.23375#S2.SS3)The cycle and its landscapeCycle*Unfolding and refolding*: a molecule is pulled open, then let fold*Coding and uncoding*: a change is made, then unmade, and its edits return to where they begand§[2\.1\.4](https://arxiv.org/html/2611.23375#S2.SS1.SSS4)Two tasksTwo strokes of the same engineTask A and Task B: each renames one module, and the program behaves the same before and afterdReversibilityA process that is slow enough to produce no entropy\. When run backwards, it returns its workNot observed: every cycle cost tokens\. Our reference is weaker, a change that costs the same to undo as to makee§[2\.2](https://arxiv.org/html/2611.23375#S2.SS2)Visit potentialΦ\\PhiThe potential of mean force,−kBTlnρ\-k\_\{B\}T\\ln\\rho\[[6](https://arxiv.org/html/2611.23375#bib.bib6)\]; out of equilibrium, the quasi\-potential\[[7](https://arxiv.org/html/2611.23375#bib.bib7),[8](https://arxiv.org/html/2611.23375#bib.bib8)\]Φ=−lnρ\\Phi=\-\\ln\\rho, withρ\\rhothe density of the repository states that the runs visited; a pure number, and a different quantity fromFFeBasinℳ\\mathcal\{M\}The basin of a minimum of the potential energy surface\[[9](https://arxiv.org/html/2611.23375#bib.bib9)\], or a metastable state when the system stays in it for long\[[10](https://arxiv.org/html/2611.23375#bib.bib10)\]The repository states around one minimum ofΦ\\PhieEfficiencyThe share of the heat drawn that an engine turns into work, bounded by Carnot \(Eq\.[1](https://arxiv.org/html/2611.23375#S1.E1)\)Tokens needed over tokens spent, 14 to 22 per cent heree§[3](https://arxiv.org/html/2611.23375#S3)The gate \(the software’s test suite\)Two reservoirsA hot and a cold reservoir, with an engine between themThe model, sampled through its harness, as the hot reservoir and the gate as the cold onea§[1](https://arxiv.org/html/2611.23375#S1)Clausius’s version of the second lawHeat does not pass by itself from a colder body to a hotter oneA gate colder than the agent takes disorder out of the repository, and a gate hotter than the agent lets disorder ina§[1](https://arxiv.org/html/2611.23375#S1)§[2\.7](https://arxiv.org/html/2611.23375#S2.SS7)Measurement deviceMaxwell’s daemon, reading a moleculeThe gate, reading a treed§[2\.1\.7](https://arxiv.org/html/2611.23375#S2.SS1.SSS7)§[2\.6](https://arxiv.org/html/2611.23375#S2.SS6)Measurement errorThe daemon misreadsA flaky test serves a wrong verdict \(Eq\.[22](https://arxiv.org/html/2611.23375#S4.E22)\)e§[2\.7](https://arxiv.org/html/2611.23375#S2.SS7)Table 2:Three experiments: Carnot’s cycle, the unfolding and refolding of a single molecule, and the coding and uncoding of a single repository, which is the experiment of this work\. Our experiment is of the second kind\. It has one bath, its cycle delivers no work, and what it yields is the free energy of a change, read from the work of many runs\.Software engineering measures correctness, coverage and velocity, but it has no theory, and no instrument, for the value or the efficiency of a token in agentic coding\. Thermodynamics is the science that divides the energy a machine uses into work and heat\. We apply it to the tokens that a coding agent generates and call the resulting theory software thermodynamics\.
Figure[1](https://arxiv.org/html/2611.23375#S1.F1)shows the three experiments we compare: a Carnot engine \(A\), the pulling of a single molecule \(B\), and coding and uncoding \(C\)\.
The best\-known machine of thermodynamics is the Carnot engine \(Fig\.[1](https://arxiv.org/html/2611.23375#S1.F1)A\)\. It works between two reservoirs, one hot and one cold\. In each cycle it draws heat from the hot reservoir, converts part of that heat into work and gives the rest to the cold one\. The two temperatures set the largest efficiencyη\\etathat the engine can reach, the share of the heat that becomes work,
η≤1−TcoldThot\.\\eta\\leq 1\-\\frac\{T\_\{\\rm cold\}\}\{T\_\{\\rm hot\}\}\.\(1\)
In this work, we employ the same idea that Carnot employed: a cycle that goes from one state to another and back\. Here the two states are the repository before a change and after it: the change is made \(coding, the forward direction\) and then unmade \(uncoding, the reverse direction\)\. An analogy with Carnot’s engine would be appealing, but it would be wrong: in software, coding and uncoding are run at a single temperature, that of the model, and therefore the cycle delivers no work\.
Luckily, there are classical experiments on molecules in which the pulling and refolding of a single molecule is a much more direct analogue of the coding cycle that we study \(Fig\.[1](https://arxiv.org/html/2611.23375#S1.F1)B\)\. Liphardt, Collin and their co\-workers held single RNA molecules in optical tweezers, pulled each open and let it fold again, many times, in a bath at one temperature\[[11](https://arxiv.org/html/2611.23375#bib.bib11),[4](https://arxiv.org/html/2611.23375#bib.bib4)\]\. Opening the molecule cost more work than folding it returned, and the work differed from pull to pull\. The least work that takes the molecule from one state to the other is its free energy\. From that spread Liphardt and co\-workers recovered the free energy of the stretching with Jarzynski’s equality\[[12](https://arxiv.org/html/2611.23375#bib.bib12)\], and Collin and co\-workers recovered free energies of folding with Crooks’ relation\[[13](https://arxiv.org/html/2611.23375#bib.bib13)\]\.
We carry out an analogue of the unfolding and refolding experiment, but with code \(Fig\.[1](https://arxiv.org/html/2611.23375#S1.F1)C\)\. A change to a code repository \(coding\) takes the place of the unfolding, and undoing that change \(uncoding\) takes the place of the refolding\. Tokens take the place of energy, and the spread of the work over many coding and uncoding runs gives an estimate of the free energy of the change\. We call this experiment*coding and uncoding*\.
Our comparison asks the reader to hold two vocabularies at once\. Hoffmann faced the same task when he explained the language of solid\-state physics to chemists, and he solved it by drawing parallels to the language of molecular orbitals and bonds\[[14](https://arxiv.org/html/2611.23375#bib.bib14)\]\. Inspired by his comparison, we set out ours in two tables\. Table[1](https://arxiv.org/html/2611.23375#S1.T1)translates the terms of classical thermodynamics into those of software thermodynamics\. Table[2](https://arxiv.org/html/2611.23375#S1.T2)places Carnot’s cycle, the unfolding and refolding of a molecule and our coding and uncoding side by side\.
Even though the agent does not run a Carnot cycle, we keep one more idea of Carnot’s: his two reservoirs\. The similarity is that the gate is at a different temperature from the agent\. The model, sampled through its harness, is the hot side\. The test suite at the gate is the cold side: a perfect gate would catch every faulty change and would sit at zero temperature\. We therefore read the model as the hot reservoir and the gate as the cold one, and we call this the*two\-reservoir reading*\. Two reservoirs bring with them Clausius’s version of the second law: heat does not pass by itself from a colder body to a hotter one\[[15](https://arxiv.org/html/2611.23375#bib.bib15),[16](https://arxiv.org/html/2611.23375#bib.bib16)\]\. A refrigerator obeys this law by spending work to carry heat out of what it holds\. In our reading the gate plays the refrigerator\. It takes out of the repository the disorder that the agent puts in, and it can do so only while it is the colder of the two\. Tests are never perfect in software engineering, so a real gate is not at zero\. We make the gate err at a known rate, which gives it a temperature we can read\.
So far, we have spoken loosely of temperature, and this is the place to define what we mean by it in this article\. We employ two different temperatures\. The one that we measure we call the software temperature\. As in thermodynamics, it is defined through the constantβ\\betaof the Boltzmann weight: it is1/β1/\\beta, in units of tokens per nat\. A nat is a unit of information, the analogue of the bit when logarithms are natural: one bit isln2=0\.693\\ln 2=0\.693nats\. The software temperature is therefore the number of tokens that makes an outcomeeetimes rarer\.
The second temperature that we employ is a setting and has no thermodynamic meaning of its own\. It is the sampling temperature of the model’s API, a dimensionless parameter\. Its origins hark back to the work of Hinton and co\-workers, whose Boltzmann machine carries a temperature of this kind\[[5](https://arxiv.org/html/2611.23375#bib.bib5)\]\. Hinton shared the Nobel Prize in Physics in 2024 for this line of work\. Therefore, we call the sampling temperature the Hinton temperature,THT\_\{\\rm H\}\.
The two temperatures interact as follows\. We useTHT\_\{\\rm H\}as a setting that moves the model from cold, where sampling is more repetitive and explores less, to hot, where it explores more\. Language models are usually run at a Hinton temperatureTHT\_\{\\rm H\}close to 1\.0\. Many of our experiments therefore measure the software temperature, or quantities derived from it, as a function of the Hinton temperature, which, we recall, is only a setting\.The software temperature is a measurement of the model, the task and the harness together, and nothing forces it to agree with the Hinton temperature\.
The units of the software temperature are important, because they say how many tokens are spent for a given amount of information\. As we describe in §[2\.1\.4](https://arxiv.org/html/2611.23375#S2.SS1.SSS4), these units let us read thermodynamic quantities as probabilities and tokens as information\.
With the two temperatures defined, we can name the remaining parts of the picture\. The gate plays the part of Maxwell’s daemon \(see the box\): it sorts the proposed changes and keeps those that pass\. The tokens spent are the cost, which divides into work and heat, and the code tree that results is the thermodynamic state\. We aim for a theory that is both predictive and useful for understanding and optimising coding processes\.
We first describe the experiment and define*coding*and*uncoding*\. We gave a coding agent a change to make in a repository and counted the tokens of every model call, which we call a*turn*, until the tests passed\. We then gave it the changed repository and asked it to undo the change\. We call the first direction coding \(forward\) and the second uncoding \(reverse\)\. We repeated both directions many times, for two changes and at several settings of the Hinton temperatureTHT\_\{\\rm H\}\. We call one change at one setting a*condition*\. A run*lands*when it reaches its goal and the tests pass there\.
To track the progress of a run, we record the fraction of the requested change that is in place\. It is zero before the change and one when the change is complete\. The tokens of a turn that advances this fraction are*work*\. The tokens that are spent without changing it are*heat*\. For example, heat is spent reading a file, searching, running the tests or editing lines that do not advance the fraction\.
Table[1](https://arxiv.org/html/2611.23375#S1.T1)is a translation guide: it gives the correspondences used throughout the article in plain language\. The equations, their derivations and the experimental controls are in §[4](https://arxiv.org/html/2611.23375#S4)\.
Now that we have the background of the theory and an overview of the experiment, we are ready to discuss four distinct measurements that quantify the predictions of our theory\. We describe each of them below, each with a short preview of its results\.
#### 1\. The round trip: a hairpin experiment in code
We measured the cycle: a coding run followed by an uncoding run, which returns the requested edits to where they started\. It is the counterpart of the pulling experiment of Table[2](https://arxiv.org/html/2611.23375#S1.T2), in which a single molecule is unfolded and refolded \(Fig\.[2](https://arxiv.org/html/2611.23375#S2.F2)\)\. The cycle delivers no work, so every token of it is lost\. The spread of the cycle’s cost over repetitions defines the software temperature\.
#### 2\. Where the tokens go: work, heat and free energy
In the second experiment, we track how a run spends its tokens\. We sort the tokens of each run into work and heat, as defined above: work advances the change and heat does not\.
Two runs of the same change never spend the same work, because some runs take a direct route and others wander\. The change, however, is the same in every run, and therefore there is a least amount of work that it requires on average\. We call that least amount the*free energy*of the change\. The work that is spent above that minimal work is lost to dissipation\.
No single run gives us the free energy, because we cannot know whether that run took the most direct route\. The same problem arises when a single molecule is pulled open: every pull costs a different amount of work\. Jarzynski showed that the free energy can still be obtained from many pulls, with an average that gives the most weight to the cheapest ones\[[12](https://arxiv.org/html/2611.23375#bib.bib12)\]\.
Arguably, Jarzynski’s result is one of the most consequential recent results of modern stochastic thermodynamics, because nonequilibrium trajectories can still reproduce equilibrium information in a practical and elegant way\. In this experiment, we apply Jarzynski’s approach to estimate the free energy of our coding changes, in analogy to the classical stochastic thermodynamics approach\.
Armed with this toolkit, we tested whether uncoding is the true reverse of coding\. The refolding of a molecule is the true reverse of its unfolding: the same path, travelled in the opposite direction\. For such a pair, Crooks showed that the free energy and the temperature predict how much more one direction costs than the other\[[13](https://arxiv.org/html/2611.23375#bib.bib13)\]\. We asked whether the same prediction holds for coding and uncoding\.
#### 3\. The daemon’s eyesight: the noise of the gate
In the third experiment, we turn from the agent to the test suite\. The test suite is the daemon of our picture: it reads each change and decides whether the change lands\.
Maxwell imagined a daemon with perfect eyesight\. A real daemon is made of matter, and therefore it has a temperature of its own and it trembles\. Feynman’s ratchet is the classical example: when the pawl is as warm as the gas that it sorts, it opens at random and sorts nothing\[[17](https://arxiv.org/html/2611.23375#bib.bib17)\]\. Sagawa and Ueda made this quantitative: a daemon that sometimes misreads gains less than one bit from each reading, and the work that it can extract falls accordingly\[[18](https://arxiv.org/html/2611.23375#bib.bib18)\]\.
A gate \(a test suite\) is a daemon at a non\-zero temperature\. Its thermal noise is the tests that fail from time to time for reasons that have nothing to do with the change, such as timing or the state of the machine\. In this experiment, we ask the thermodynamic question: is the signal of a defect larger than the noise of the daemon that must read it?
We measured the noise by running the same tests several times on the same unchanged code and counting the tests that failed\. We measured the signal by planting known defects in the code and counting how many of them the suite caught\. Because of its noise, a test suite is given a pass mark: a change lands when no more than a set number of tests fail\. We set the pass mark in two ways: from a single run on unchanged code, as it is set in practice, and from the noise measured over many runs\. We also compared the whole suite with a smaller gate, the tests of the changed file alone\.
#### 4\. When the daemon errs: a gate with a temperature
In the fourth experiment, we give the noise of the daemon a temperature\. In the third experiment, we observed the noise that a test suite has by itself\. Here we controlled it: we made the gate give the wrong verdict at a rate that we set, and we counted the broken changes that it let through\.
The thermodynamic idea is Boltzmann’s\. A system at temperatureTTcrosses a barrier of heightΔ\\Deltawith a probability proportional toe−Δ/Te^\{\-\\Delta/T\}\. A cold system almost never crosses, and a warm one crosses often, because its thermal noise carries it over\. For a gate, the barrier is the repair: a broken change should land only after the agent has spent the tokens that fix it, about a thousand in our runs\. When the gate errs, a broken change lands with no repair\. The noise of the gate has carried it over the barrier, as thermal noise carries a particle\.
We therefore define the temperature of the gate from two quantities that we measure: the share of landed changes that are broken, and the cost of the repair in tokens\. A gate that never errs has zero temperature, and a gate that errs more often is hotter\. This temperature has the same unit as the software temperature of the model, tokens a nat, and therefore the daemon and the engine can be compared on one scale\. Clausius’s version of the second law then says what to expect: the gate removes disorder only while it is colder than the model\.
We did this on two systems: a toy in which most attempts were broken, and our own repository with a one\-line defect planted, in which about half of the attempts were broken\.
##### Preview of the results\.
Coding cost more than uncoding, and the software temperature rose with the Hinton temperature\. About 80 per cent of the tokens of a landed run were heat, and the free energy was 14 to 22 per cent of the mean cost of a landed coding run\. The whole test suite caught no more planted defects than the tests of the changed file alone\. The more often the gate was wrong, the more broken changes landed\.
#### Where this work comes from
This work draws on four earlier lines of work\. The first is stochastic thermodynamics\. It is the thermodynamics of small systems, in which work, heat and entropy are defined for a single trajectory and differ from one trajectory to the next\[[19](https://arxiv.org/html/2611.23375#bib.bib19),[20](https://arxiv.org/html/2611.23375#bib.bib20)\]\. Its two central results are the ones that we use in the second experiment\. Jarzynski’s equality gives the free energy of a change from the work of many trajectories, and Crooks’s relation compares the work of a process with the work of its reverse\[[12](https://arxiv.org/html/2611.23375#bib.bib12),[13](https://arxiv.org/html/2611.23375#bib.bib13)\]\.
Both results are theorems for a small system in contact with a heat bath\. They assume that every trajectory starts from thermal equilibrium, that the bath sets the temperature, and that the system keeps no memory of its path\. It would be convenient if a coding agent met these conditions, but it does not: a run does not start from equilibrium, no bath sets its temperature, and the agent remembers every turn that it has taken\. The cost of our runs also has a long tail, because a few heavy runs cost far more than the rest\. Therefore, we cannot take the two results as theorems for our setting, and we use them by analogy\.
The analogy also gives us our definition of temperature\. When the work of a process follows a Gaussian distribution, the two results give the temperature as the variance of the work divided by twice its mean\. We take this expression as the definition of the software temperature, and we let the data say whether it behaves like a temperature in our more complex situation\. How to define a temperature for work distributions with a long tail, such as ours, is a research question that we leave for future work\.
The second line of work we build on concerns the price of a measurement\. Maxwell imagined a small being, later called a daemon, who watches the molecules of a gas and opens a door only for the fast ones\. The daemon sorts hot from cold without doing any work, and the second law forbids this\[[21](https://arxiv.org/html/2611.23375#bib.bib21),[22](https://arxiv.org/html/2611.23375#bib.bib22)\]\. Szilard reduced the puzzle to its smallest case, a single molecule in a box at temperatureTT\. Knowing which half of the box the molecule is in is one bit of information, and it lets the daemon draw
Wbit=kBTln2W\_\{\\rm bit\}=k\_\{B\}T\\ln 2\(2\)of work by letting the molecule push a piston\. Szilard concluded that the measurement must itself cost at least that much, or the second law fails\[[23](https://arxiv.org/html/2611.23375#bib.bib23)\]\. Landauer then focused on the cost of forgetting\. Erasing one bit of memory, whatever the physical device, dissipates at least
Qerase≥kBTln2Q\_\{\\rm erase\}\\geq k\_\{B\}T\\ln 2\(3\)of heat\[[24](https://arxiv.org/html/2611.23375#bib.bib24)\]\. Bennett closed the argument\. A measurement can in principle be made without dissipation, but the daemon must clear its memory before it can act again, and it pays for that erasure\. Therefore, over a full cycle
Wgained−Qerase≤0,W\_\{\\rm gained\}\-Q\_\{\\rm erase\}\\leq 0,\(4\)and the daemon breaks even at best\[[25](https://arxiv.org/html/2611.23375#bib.bib25)\]\.
Two later results concern daemons that are closer to real devices\. Sagawa and Ueda, and Horowitz and Parrondo, extended the bound to a daemon whose measurement sometimes errs\. The work that such a daemon can draw falls with its error, and it is set by the mutual information that the measurement still carries\[[18](https://arxiv.org/html/2611.23375#bib.bib18),[26](https://arxiv.org/html/2611.23375#bib.bib26)\]\. Parrondo and Español showed that Feynman’s ratchet, a mechanical daemon, never reaches the bound, because it touches both baths at once\[[17](https://arxiv.org/html/2611.23375#bib.bib17)\]\. Parrondo, Horowitz and Sagawa review the modern accounting, which treats information as a physical resource and memories as information reservoirs on an equal footing with thermal and chemical baths\[[27](https://arxiv.org/html/2611.23375#bib.bib27)\]\.
A gate of tests is a daemon of this kind\. It reads a verdict, green or red, and acts on it: a green change lands and a red one does not\. A verdict carries at most one bit, and it carries the whole bit only when green and red are equally likely before the gate is read\. When the gate’s verdict is sometimes wrong, we price it as Sagawa and Ueda price an erring daemon’s measurement, by the mutual information between the true state of the change and the verdict that the agent receives\. For a verdict that is wrong with probabilityPP, when half of the attempts are truly red, this information is1−h\(P\)1\-h\(P\)bits, whereh\(P\)=−Plog2P−\(1−P\)log2\(1−P\)h\(P\)=\-P\\log\_\{2\}P\-\(1\-P\)\\log\_\{2\}\(1\-P\)is the binary entropy\. The expression for any share of red attempts is in §[4\.13](https://arxiv.org/html/2611.23375#S4.SS13)\(Eq\.[21](https://arxiv.org/html/2611.23375#S4.E21)\)\. The price we put on a verdict is the price of its use, in tokens\. We make no claim about a physical cost of measuring or of erasing in the machine that runs the tests\.
The third line of work we build on measures free energies on single molecules that are driven far from equilibrium\. Liphardt and co\-workers pulled one RNA molecule open again and again and tested Jarzynski’s equality on the work of the pulls\[[11](https://arxiv.org/html/2611.23375#bib.bib11)\]\. Collin and co\-workers then pulled and released single RNA molecules\[[4](https://arxiv.org/html/2611.23375#bib.bib4)\]\. They held one RNA hairpin between two beads in optical tweezers, moved the beads apart until the hairpin opened, and brought them back until it folded, hundreds of times\. Figure[2](https://arxiv.org/html/2611.23375#S2.F2)a shows five such pulls and five releases\. The work of a pull is the area under its curve of force against extension\. Unfolding cost more work than refolding returned, and both amounts changed from one repetition to the next\. Crooks’s fluctuation theorem says that the distributions of the two works cross at the free energy of the change, whatever the pulling speed\[[13](https://arxiv.org/html/2611.23375#bib.bib13)\]\. In the experiment of Collin and co\-workers, the two distributions crossed at the same free energy at each of three pulling speeds\.
Our coding experiment follows the same design\. Each run corresponds to one pull of the molecule: the agent receives the same instruction on each repetition and does a different amount of work\. Figure[2](https://arxiv.org/html/2611.23375#S2.F2)d shows the two work distributions, of coding and of uncoding\.
Two refinements of these experiments matter for our estimates, because we have tens of runs in each condition and some of them never land\. First, the exponential average over a small number of pulls overestimates the free energy, by an amount that falls as pulls are added\[[28](https://arxiv.org/html/2611.23375#bib.bib28)\]\. Second, when only a part of the pulls ends in the state of interest, the estimate carries a term that depends on the size of that part\[[29](https://arxiv.org/html/2611.23375#bib.bib29)\]\. A related group of results, the thermodynamic uncertainty relations, ties the regularity of a driven process to the dissipation that pays for it, first for currents and then for the time to reach a target\[[30](https://arxiv.org/html/2611.23375#bib.bib30),[31](https://arxiv.org/html/2611.23375#bib.bib31),[32](https://arxiv.org/html/2611.23375#bib.bib32)\]\.
The fourth line of work we build on is the evaluation of coding agents\. These studies count the tasks that an agent resolves on fixed test suites and report the token cost\[[3](https://arxiv.org/html/2611.23375#bib.bib3)\]\. Entropy has been defined for software before, in two ways\. The first is the Shannon entropy of how the changes of a period are spread over the files\[[33](https://arxiv.org/html/2611.23375#bib.bib33)\]\. The second is the logarithm of the number of programs that pass a given set of tests, which is estimated in practice from the mutants of one program that survive the tests\[[34](https://arxiv.org/html/2611.23375#bib.bib34)\]\. To our knowledge, no study has defined an energy for a state of the code, or measured a temperature, a work or a fluctuation relation for software\. In this work, each analogy is a definition tied to a quantity that we measure, and the measurements show how far the quantity behaves like its thermodynamic original\.
## \\materiaDisplay2\\materiaDisplayResults
### 2\.1 Overview and definitions
Before the measurements, we define the quantities of Table[1](https://arxiv.org/html/2611.23375#S1.T1)in terms of what we recorded\. We measured model calls, file edits and test outcomes from the agent’s*records*\. We describe how we computed each quantity in §[4](https://arxiv.org/html/2611.23375#S4)\.
#### 2\.1\.1 The system and its state
The system is a code repository, and its files at one exact version are a*tree*\. A*task*is a goal stated in words together with two trees: the base tree, where the change has not been made, and the target tree, where it has\. We describe the change by a fixed list ofNN*blocks*\. Each block is one piece of the difference between the two trees: the renaming of a file, or a contiguous group of changed lines\. A block is*in place*in a tree when the tree already has that change: the file carries its new name, or the changed lines are there\. The*reaction coordinate*of a tree is the fraction of the blocks that are in place,
wherennis the number of blocks in place\. It is zero at the base tree and one when every block is in place, whatever else the tree contains\. The reaction coordinate plays the part of the extension of the molecule in a pulling experiment\[[11](https://arxiv.org/html/2611.23375#bib.bib11)\]: it says how far the change has been made, as the extension says how far the molecule has been pulled open\. We call the value ofqqthe*state*of the tree\. Many trees share one state, as many configurations of a molecule share one extension\. The definitions in this section describe each tree byqqalone, except the energy, which belongs to one exact tree \(§[2\.1\.6](https://arxiv.org/html/2611.23375#S2.SS1.SSS6)\)\.
The*agent*is a language model that edits the tree through its harness, one model call at a time\. One call is a*turn*\. The*gate*is the repository’s test suite, run on the agent’s edits\. It answers pass or fail, which we call*green*and*red*, and its purpose is to stop a change that breaks the code from being accepted\.
#### 2\.1\.2 A run and its cost
A*run*is what the agent does to the system: one attempt at a task in one direction\. In a*coding*run \(the forward direction\), the agent starts from the base tree with instructions to make the change\. In an*uncoding*run \(the reverse direction\), the agent starts from the target tree with instructions to undo the change\. A run*lands*when it reaches its goal and the gate passes there\. A run that ends in any other way, because the agent stops short of the goal or reaches the limit on turns, is*unfinished*\. The*cost*CCof a run is the sum of the tokens that the model generated across its turns\. A cost is never negative, and it is paid whether or not the run lands\.
#### 2\.1\.3 Work and heat
We divide the cost of a run into two parts, according to whether each turn changes the stateqq\. The tokens of a turn that leavesqqunchanged are*heat*\. In such a turn, the agent read a file, searched, ran the tests or edited outside the goal’s blocks, and the state did not move\. The tokens of a turn that changesqqare*work*, and they carry the sign of the step, positive whenqqrises and negative when it falls\. Withcic\_\{i\}the tokens of turniiandqiq\_\{i\}the state after it, the work and the heat of a run are
W=∑icisgn\(qi−qi−1\),h=∑i:qi=qi−1ci\.W=\\sum\_\{i\}c\_\{i\}\\,\\mathrm\{sgn\}\(q\_\{i\}\-q\_\{i\-1\}\),\\qquad h=\\sum\_\{i\\,:\\,q\_\{i\}=q\_\{i\-1\}\}c\_\{i\}\.\(6\)The work is zero for a run that never touches the goal’s blocks, and it does not depend on how long the agent read before it wrote\. A run that never steps back hasC=\|W\|\+hC=\|W\|\+h, in either direction\. No landed run in this study stepped back\.
An uncoding run takesqqfrom one to zero, so its work is negative\. The sign records the direction of the step\. No token is returned, and an uncoding run pays for every token it generates\. We keep the sign because it lets us compare the two directions as one compares the stretching of a molecule with its refolding: the work put in on the way out against the work given back on the way in\[[11](https://arxiv.org/html/2611.23375#bib.bib11),[4](https://arxiv.org/html/2611.23375#bib.bib4)\]\.
#### 2\.1\.4 The cycle
A coding run followed by an uncoding run brings the state back to where it began, and we call the pair a*cycle*\. Nothing is stored in the state at the end of a cycle, so we call its whole cost the cycle’s*heat*,QQ\. It is the mean cost of a landed coding run plus that of a landed uncoding run\. The cycle’s*asymmetry*𝒜\\mathcal\{A\}is the mean cost of a landed coding run minus the mean cost of a landed uncoding run\. We measured the two directions separately\. Every coding run started from the same stored base tree and every uncoding run from the same stored target tree, as the unfolding and the refolding of a molecule are measured in separate pulls from prepared states\[[4](https://arxiv.org/html/2611.23375#bib.bib4)\]\. What returns to its start is the stateqq, which goes from zero to one and back to zero\. A landed tree may differ from its start in lines outside the goal’s blocks \(§[4\.5](https://arxiv.org/html/2611.23375#S4.SS5)\)\.
We define the*software temperature of the cycle*,1/βcyc1/\\beta\_\{\\rm cyc\}, from the mean and variance of the cost around the cycle, by the relation that Gaussian work obeys under the fluctuation theorems \(§[4\.5](https://arxiv.org/html/2611.23375#S4.SS5), Eq\.[19](https://arxiv.org/html/2611.23375#S4.E19)\)\. This relation is a definition and involves no fit\. The cycle has this one temperature\. It carries no heat from a hotter reservoir to a colder one and delivers no work\. It is therefore a*hysteresis loop*, like that of a molecule pulled open and folded again\[[4](https://arxiv.org/html/2611.23375#bib.bib4)\], and its heatQQis all lost\.
We also measure the*arrow of time*of a run\. A process that produces entropy can be told from its own record played backwards, and Prigogine placed this irreversibility at the centre of the thermodynamics of systems far from equilibrium\[[35](https://arxiv.org/html/2611.23375#bib.bib35)\]\. Letxxbe the record of a run, its tokens per turn in order, andx~\\tilde\{x\}the same record read backwards\. WithP\(x\)P\(x\)the probability of a record among the runs of one condition, the arrow of time is the relative entropy between the records and their reverses,
D=∑xP\(x\)lnP\(x\)P\(x~\)\.D=\\sum\_\{x\}P\(x\)\\,\\ln\\frac\{P\(x\)\}\{P\(\\tilde\{x\}\)\}\.\(7\)DDis zero when a record and its reverse are equally likely\. In thermodynamics,DDis a lower bound on the mean entropy that a process produces, in nats\[[36](https://arxiv.org/html/2611.23375#bib.bib36),[37](https://arxiv.org/html/2611.23375#bib.bib37)\]\. We estimateDDfrom how well a classifier tells the recorded runs from the same runs reversed \(§[4\.7](https://arxiv.org/html/2611.23375#S4.SS7)\)\.
#### 2\.1\.5 The free energy of a change
The*free energy difference*ΔF\\Delta Fof a change is the minimum average work that takes the state fromq=0q=0toq=1q=1, in tokens\. It is zero for a change with no blocks, and it belongs to a task for a given model and harness\. An agent that writes the same blocks in fewer tokens assigns the change a lower free energy\. No single run shows it, because runs of one task do different amounts of work\. The minimum is taken over ways of making the change and the average over runs, so a single run can do less work thanΔF\\Delta F, as a single pull of a molecule can\. In thermodynamics, the mean work of a process is never less than the free energy difference it crosses,
⟨W⟩≥ΔF,\\langle W\\rangle\\geq\\Delta F,\(8\)and the excess⟨W⟩−ΔF\\langle W\\rangle\-\\Delta Fis the*dissipated work*\. In §[2\.5](https://arxiv.org/html/2611.23375#S2.SS5), we estimateΔF\\Delta Ffrom the spread of the work over many runs in both directions, and we compare the result with the ratio of the landing rates of the two directions\.
#### 2\.1\.6 The energy of a tree
The free energy of the last subsection belongs to a goal, and many trees meet one goal\. We also define a quantity that belongs to one exact tree\. The*energy*EEof a tree is the minimum average work that builds exactly that tree from the empty repository, in tokens, for a given model and harness\. The empty repository has zero energy\. The energy of a change from one exact tree to another is the difference of their energies,ΔE\\Delta E\. In statistical mechanics, the free energy of a set of microstates follows from their energies,
F=−1βln∑ie−βEi,F=\-\\frac\{1\}\{\\beta\}\\ln\\sum\_\{i\}e^\{\-\\beta E\_\{i\}\},\(9\)and we take the same relation for the treesiithat meet a goal\. WhenNNtrees of equal energy meet the goal, the relation givesΔF=ΔE−\(1/β\)lnN\\Delta F=\\Delta E\-\(1/\\beta\)\\ln N: the more trees meet the goal, the less work the goal costs\. We define the energy in this work and we do not measure it\. The mean work of runs that are asked for one exact tree bounds its energy from above \(Eq\.[8](https://arxiv.org/html/2611.23375#S2.E8)\), and we leave that experiment for future work\.
#### 2\.1\.7 The gate as an instrument
The quantities defined so far depend on the gate, because a run lands only when the gate passes\. The gate is therefore our instrument, and we study it in two ways\.
First, the gate is a*thermometer*with noise of its own\. On a clean tree, which is a tree with no defect, the test suite still fails some tests, and the number of failuresNNchanges from one run of the suite to the next\. The gate answers red when more than a set number of tests fail, and we call this number the*threshold*\. A threshold is therefore a quantile of the distribution ofNN: it fixes how often a clean tree is called red\. A tree with a defect can still pass the gate\. The share of landed trees that carry a defect follows from how often this happens \(§[4\.12](https://arxiv.org/html/2611.23375#S4.SS12), Eq\.[20](https://arxiv.org/html/2611.23375#S4.E20)\)\.
Second, the gate makes*mistakes*\. We call the verdict that the gate gives the agent the*served*verdict, and the verdict that the tree deserves the true verdict\. When the served verdict is wrong with probabilityPP, some trees that are truly red land, and we call each of them a*false landing*\. The share of landings that are false exceedsPPonce more than half of the attempts are truly red \(§[4\.13](https://arxiv.org/html/2611.23375#S4.SS13), Eqs\.[22](https://arxiv.org/html/2611.23375#S4.E22)and[23](https://arxiv.org/html/2611.23375#S4.E23)\)\.
Figure 2:A molecule pulled open and folded again, and a change made and undone\. \(a\) Force against extension for one RNA hairpin held in optical tweezers and pulled at a loading rate of 7\.5 pN/s: five unfolding curves \(rose\) and five refolding curves \(black\), redrawn from the data of Fig\. 1 of ref\.\[[4](https://arxiv.org/html/2611.23375#bib.bib4)\]\(§[4\.6](https://arxiv.org/html/2611.23375#S4.SS6)\)\. The shaded area under one refolding curve is the work returned as the molecule folds, 392 pN nm between 355 and 380 nm of extension, or 95kBTk\_\{B\}Tat 298 K\. \(b–e\) The coding agent on Task A at Hinton temperature 0\.5\. \(b\) The 48 landed coding runs \(rose\), in which the agent made the change \(forward\)\. Each thin line is one run: the output tokens it had spent after each turn, ending in a dot at the turn where it landed\. A turn that changed the stateqqis drawn dark, and its tokens are work\. A turn that leftqqunchanged is drawn pale, and its tokens are heat\. The thick line is the mean over the runs, each run held at its final cost after it landed\. \(c\) The 48 landed uncoding runs \(black\), in which it undid the change \(reverse\), on the same axes\. \(d\) The work of the runs of b and c, in bins of 50 tokens:WWfor coding \(filled\) and−W\-Wfor uncoding \(outline\)\. The dashed line is the free energy of the change,ΔFJ\\Delta F\_\{J\}, 351 tokens\. \(e\) The mean output tokens of a run in each direction, divided into work \(dark\) and heat \(pale\)\. The dashed line isΔFJ\\Delta F\_\{J\}\. Supplementary Fig\.[1](https://arxiv.org/html/2611.23375#S6.F1)gives panels b to e for Task B\.
### 2\.2 Coding costs more than uncoding
Coding cost more than uncoding\. We studied two changes, Task A and Task B\. Each task renames a working module in place and updates every file that refers to it, much as relabelling a book requires correcting every catalogue card that points to it\. We describe what the two modules do in §[4\.1](https://arxiv.org/html/2611.23375#S4.SS1)\. Their functions do not affect this comparison\. Task A is the longer of the two: its cycle cost about 1\.5 times the tokens of the cycle of Task B \(§[6](https://arxiv.org/html/2611.23375#S6), Table[5](https://arxiv.org/html/2611.23375#S6.T5)\)\. Neither task changes what the code does, and each can be undone exactly\.
At three Hinton temperatures, we ran each task in both directions, coding \(forward\) and uncoding \(reverse\)\. This gives six conditions, and for each one we measured the heat and the asymmetry \(§[6](https://arxiv.org/html/2611.23375#S6), Table[5](https://arxiv.org/html/2611.23375#S6.T5)\)\. The asymmetry is zero when the two directions cost the same\. The asymmetry was positive in all six conditions, and its 97\.5 per cent interval excluded zero in four\. For Task A, the intervals included zero at the two lower Hinton temperatures\. Note that symmetry is different from reversibility\. Symmetry means that the two directions cost the same, however much they cost\. Reversibility means that the whole cycle costs nothing\.
Some runs did not land, and the cost of a landing depends on how we count them\. In thermodynamics, a mean is taken over all the trajectories of an experiment\. A molecule that fails to unfold when it is pulled still counts in the mean work\. We therefore report the cost of one landing under three approximations, which differ only in what they assume about the unfinished runs \(§[4\.4](https://arxiv.org/html/2611.23375#S4.SS4)\)\. LetCiC\_\{i\}be the cost of runiiandnLn\_\{\\rm L\}the number of landed runs of one direction\.
The first way counts the landed runs alone\. We call it VIVA, for victors in, vanquished absent:
⟨C⟩VIVA=1nL∑ilandedCi\.\\langle C\\rangle\_\{\\rm VIVA\}=\\frac\{1\}\{n\_\{\\rm L\}\}\\sum\_\{i\\ \\rm landed\}C\_\{i\}\.\(10\)The second way counts every token of every run, with each unfinished run cut where it stopped, and divides by the number of landings that these tokens bought\. We call it CORTA, the cut\-off run truncation approximation:
⟨C⟩CORTA=1nL∑iallCi\.\\langle C\\rangle\_\{\\rm CORTA\}=\\frac\{1\}\{n\_\{\\rm L\}\}\\sum\_\{i\\ \\rm all\}C\_\{i\}\.\(11\)The third way follows each run that the limit stopped until the context window of the model is full, because a run cannot continue beyond that point\. We call it LOCA, the limit of context approximation\. The window holdsM=1,048,576M=1\{,\}048\{,\}576tokens\. A stopped runiihad a prompt ofpip\_\{i\}tokens at the limit\. Over the last two thirds of its turns the prompt grew byaia\_\{i\}tokens a turn, and the model generatedgig\_\{i\}tokens a turn\. At these rates the window fills after\(M−pi\)/ai\(M\-p\_\{i\}\)/a\_\{i\}more turns, and the run generatesgi\(M−pi\)/aig\_\{i\}\\,\(M\-p\_\{i\}\)/a\_\{i\}more tokens\. The mean cost of a landing is then
⟨C⟩LOCA=1nL\[∑iallCi\+∑istoppedgiM−piai\]\.\\langle C\\rangle\_\{\\rm LOCA\}=\\frac\{1\}\{n\_\{\\rm L\}\}\\left\[\\,\\sum\_\{i\\ \\rm all\}C\_\{i\}\+\\sum\_\{i\\ \\rm stopped\}g\_\{i\}\\,\\frac\{M\-p\_\{i\}\}\{a\_\{i\}\}\\right\]\.\(12\)VIVA leaves out tokens that were spent, and it is a lower bound on the cost of a landing under CORTA\. CORTA is what we spent, and it depends on our limit\. LOCA is the cost when no stopped run ever lands\. The tokens of the unfinished runs were heat: we show in §[2\.5](https://arxiv.org/html/2611.23375#S2.SS5)that they change the free energy of the change by at most 13 per cent\.
The three approximations agreed where every run landed, and they differed by up to two orders of magnitude where runs were unfinished \(Fig\.[3](https://arxiv.org/html/2611.23375#S2.F3)for Task A; Supplementary Fig\.[2](https://arxiv.org/html/2611.23375#S6.F2)for Task B\)\. On Task A atTH=0\.1T\_\{\\rm H\}=0\.1, the cycle heat was about 4,000 tokens under VIVA, 61,000 under CORTA and 556,000 under LOCA \(§[4\.5](https://arxiv.org/html/2611.23375#S4.SS5)\)\. The asymmetry was positive in all six conditions under each of the three approximations \(§[6](https://arxiv.org/html/2611.23375#S6), Table[5](https://arxiv.org/html/2611.23375#S6.T5)\)\.
Figure 3:The heat and the asymmetry of the cycle of Task A, counted in three ways\. \(a\) The heat of the cycle,QQ, against the Hinton temperature,THT\_\{\\rm H\}, at 0\.1, 0\.5 and 1\. \(b\) The asymmetry of the cycle,𝒜\\mathcal\{A\}\. Black circles employ the VIVA approximation, which means that they are the landed runs alone \(Eq\.[10](https://arxiv.org/html/2611.23375#S2.E10)\)\. Rose squares employ the CORTA approximation, which means that all runs are counted, each up to the call at which it stopped \(Eq\.[11](https://arxiv.org/html/2611.23375#S2.E11)\)\. Tan triangles employ the LOCA approximation, in which a run stopped by the limit on turns is followed until its context window is full \(Eq\.[12](https://arxiv.org/html/2611.23375#S2.E12)\)\. The vertical axes are logarithmic\. Bars are 95 per cent bootstrap intervals over runs, and a bar that reaches the bottom of an axis extends below it\. We offset the three counts horizontally within each condition so readers can distinguish the bars\. The three conditions of Task A hold 144 runs, of which 131 landed\. Supplementary Fig\.[2](https://arxiv.org/html/2611.23375#S6.F2)shows Task B\.Survivor selection does not explain the asymmetry at the middle Hinton temperature\. In a separate sample with twenty runs a direction at that temperature, the asymmetry was positive on both tasks, and on Task B it grew when the unfinished coding runs were counted \(§[4\.5](https://arxiv.org/html/2611.23375#S4.SS5)\)\. Survivor selection remains a possible contributor to the asymmetry at the coldest Hinton temperature, where the interval for the asymmetry included zero when all runs were included\.
### 2\.3 The cycle is a hysteresis loop
Every token spent on the cycle was lost, and most of them were heat\. A cycle that returns the state to its start at a single temperature stores nothing and delivers nothing\. Its classical counterpart is the hysteresis loop of a molecule that is pulled open and allowed to fold again\[[11](https://arxiv.org/html/2611.23375#bib.bib11),[4](https://arxiv.org/html/2611.23375#bib.bib4)\]: opening costs more work than folding returns, and the difference is lost as heat\. Figure[2](https://arxiv.org/html/2611.23375#S2.F2)sets such a molecule \(a\) beside our two directions, one line a run, for Task A at Hinton temperature 0\.5 from the runs of §[2\.5](https://arxiv.org/html/2611.23375#S2.SS5)\(b–e\)\. Supplementary Fig\.[1](https://arxiv.org/html/2611.23375#S6.F1)shows Task B at the same Hinton temperature\. On Task A a landed coding run cost about 2,300 tokens on average and a landed uncoding run about 1,700 \(Fig\.[2](https://arxiv.org/html/2611.23375#S2.F2)b,c\)\. On both tasks, 74 to 83 per cent of these tokens were generated in turns that left the state unchanged \(Fig\.[2](https://arxiv.org/html/2611.23375#S2.F2)e; §[4\.8](https://arxiv.org/html/2611.23375#S4.SS8)\)\. The mean work of coding exceeded the free energy of the change by 64 tokens on Task A and by 111 on Task B \(Fig\.[2](https://arxiv.org/html/2611.23375#S2.F2)d; Supplementary Fig\.[1](https://arxiv.org/html/2611.23375#S6.F1)c\)\.
The token record of a run carried a weak arrow of time\. We asked how well a run’s sequence of tokens per turn can be told from the same sequence read backwards, which measures the asymmetry of its time order\. In a physical system this asymmetry is a lower bound on the entropy produced\. Here we use it by analogy, and only on the runs that landed\. On runs kept out of the fit, the estimate was about 0\.3 nats a run for coding on Task A and 0\.4 for uncoding, and its interval included zero on Task B \(§[4\.7](https://arxiv.org/html/2611.23375#S4.SS7)\)\. On Task A the estimate, multiplied by the software temperature, was about 1 per cent of the cycle heat\. The estimate uses only the tokens of each turn, so the asymmetry of the full record can be larger\.
In the six conditions of Table[5](https://arxiv.org/html/2611.23375#S6.T5)\(§[6](https://arxiv.org/html/2611.23375#S6)\) the software temperature of the cycle rose with the Hinton temperature on Task A, and rose then levelled on Task B\. Over the landed runs of the twelve conditions \(VIVA\) it was 62 to 147 tokens per nat on Task A and 48 to 80 on Task B, higher at the higher Hinton temperatures \(Fig\.[4](https://arxiv.org/html/2611.23375#S2.F4); Supplementary Fig\.[3](https://arxiv.org/html/2611.23375#S6.F3)\)\. When the unfinished runs are counted, the cost varies far more from run to run, and the same formula gives 11,000 to 27,000 tokens per nat under CORTA and 210,000 to 370,000 under LOCA in the conditions belowTH=0\.5T\_\{\\rm H\}=0\.5\. A rise with the Hinton temperature is consistent with a temperature interpretation\. The run\-length null of Supplementary Note 1 also predicts this rise whenever run lengths vary more at a higher Hinton temperature\. The trend therefore cannot distinguish these explanations\.
Figure 4:The software temperature of the cycle,1/βcyc1/\\beta\_\{\\rm cyc\}, in tokens per nat, against the Hinton temperature,THT\_\{\\rm H\}, for Task A, counted in three ways: the VIVA approximation \(black circles, Eq\.[10](https://arxiv.org/html/2611.23375#S2.E10)\), the CORTA approximation \(rose squares, Eq\.[11](https://arxiv.org/html/2611.23375#S2.E11)\) and the LOCA approximation \(tan triangles, Eq\.[12](https://arxiv.org/html/2611.23375#S2.E12)\), as in Fig\.[3](https://arxiv.org/html/2611.23375#S2.F3)\. We measure the software temperature and set the Hinton temperature\. Both quantities are defined in §[1](https://arxiv.org/html/2611.23375#S1)and §[4\.3](https://arxiv.org/html/2611.23375#S4.SS3)\. The vertical axis is logarithmic\. Bars are 95 per cent bootstrap intervals over runs\. The six Hinton temperatures are 0\.01, 0\.1, 0\.25, 0\.5, 0\.75 and 1\. The six conditions of Task A hold 598 runs, of which 546 landed\. Supplementary Fig\.[3](https://arxiv.org/html/2611.23375#S6.F3)shows Task B\.The cycle involves one temperature, the model’s\. The gate has a temperature of its own when it errs\. We measure it in §[2\.7](https://arxiv.org/html/2611.23375#S2.SS7), on the same repository with a known error injected\.
A software temperature of about a hundred tokens per nat has a plain meaning\. Runs of the same task differ in cost and end on different code, and the software temperature ties those two facts together as temperature in physics ties energy to disorder\. The values measured on Task A, 128 to 153 tokens per nat \(§[2\.5](https://arxiv.org/html/2611.23375#S2.SS5)\), are about 100 tokens per bit, a nat being 1\.44 bits\. The number has two equivalent readings\. As a Boltzmann factor, it says that if one way of doing the task costs 100 tokens more than another, the agent takes it about half as often; we define the number this way, from the spread of work over attempts, and it measures the model’s willingness to spend\. Read as a price, by analogy with Landauer’s bound, it would say that settling one choice between two ways costs at least about 100 tokens\. We did not measure such a price\. We call a fork any place where the code could have gone more than one way: which file, which name, where the new line goes, whether to run the tests now\. A fork withkkbranches carrieslog2k\\log\_\{2\}kbits, so a fork between two ways carries one bit\. This price has the form of Landauer’s bound,kBTln2k\_\{B\}T\\ln 2for each bit, with tokens in place of energy\[[24](https://arxiv.org/html/2611.23375#bib.bib24)\]\. We use the bound by analogy, as we use the fluctuation relations\.
The two readings meet in the conditions above\. A landed run of Task A at Hinton temperature 0\.25 cost about 1,950 tokens at the median, which at this price would pay for at most about twenty choices between two ways\. The coding runs of Task A ended on 19 to 39 distinct trees across the five Hinton temperatures of Table[6](https://arxiv.org/html/2611.23375#S6.T6)\(§[6](https://arxiv.org/html/2611.23375#S6)\), four to five bits of spread; its uncoding runs ended on 2 to 10, one to three bits; and Task B ended on 2 to 4 a side\. On Task A, then, the runs left four to five bits open, at forks that the gate did not decide\. We did not count the forks that every run settled the same way\. What remains of the twenty bits would be an upper limit on them, because the cost of a run includes heat\. A count of distinct trees over a few dozen runs is a lower bound on the number of trees\. The software temperature is the exchange rate between those tokens and those bits\.
The forks show when the runs are followed one change at a time \(Fig\.[5](https://arxiv.org/html/2611.23375#S2.F5)\)\. We identified the tree after each code change\. For each task and direction, we drew all runs as a stream from their common starting tree\. The stream splits wherever two runs part, and each split is a fork\. The trees on which the stream ends are the ones the entropySSof Table[1](https://arxiv.org/html/2611.23375#S1.T1)counts: the entropy of a finished change is the logarithm of the number of distinct trees that count as done\. On Task A the landed coding runs ended on 125 different trees and the landed uncoding runs on 21\. Weighting each tree by its share of the runs gives the entropy of the ending: 4\.6 bits in coding and 0\.6 in uncoding on Task A, and 1\.1 and 0\.1 on Task B\. The count of trees is a lower bound, and the entropy reads low at a finite number of runs \(§[4\.10](https://arxiv.org/html/2611.23375#S4.SS10)\)\.
Figure 5:Where the runs go\. Each panel follows all the runs of one task in one direction, from the tree on which they start \(step 0\) through each change of the code\. A grey bar is a tree, and a band joins one tree to the next: the wider the band, the more runs took that step\. A run is coloured by the tree on which it ends\. In each panel the end trees are ordered by the number of runs that end on them: rose is the first, followed by blue, teal, ochre and black, and pale mauve gathers all the others\. The row beside each panel letter gives the number of runs of each colour\. The hollow square in that row gives how many of these runs did not land, and such a run ends on a hollow bar, whatever its colour\. \(a\) Task A, coding\. \(b\) Task B, coding\. \(c\) Task A, uncoding\. \(d\) Task B, uncoding\. The coding runs fan out: their stream splits at almost every step, and on Task A many runs end on a tree that few others reach\. The uncoding runs stay together, and nearly all of them end on one tree\. Making a change leaves many forks open, and undoing it leaves almost none\. The six Hinton temperatures are pooled, the vertical scale is the same in the four panels, and the counts of each panel are in §[4\.10](https://arxiv.org/html/2611.23375#S4.SS10)\.
### 2\.4 A run crosses three basins of the visit potential in order, and cold runs are lost to a loop
Ever since Alder and Wainwright ran the first molecular dynamics simulations\[[38](https://arxiv.org/html/2611.23375#bib.bib38),[39](https://arxiv.org/html/2611.23375#bib.bib39)\], computational chemists and physicists have used the computer as a computational microscope to understand the world\[[40](https://arxiv.org/html/2611.23375#bib.bib40)\]\. Visualizing, in the sense of statistical mechanics, where the runs spend their time is therefore a useful tool for humans to understand the dynamics of a system: its ensembles of trajectories, its kinetics, its states and its traps\. This section describes our attempt to do so in the context of agentic coding\.
We described every repository state that a run visited by a descriptor vector\. Like any representation\[[41](https://arxiv.org/html/2611.23375#bib.bib41)\], this one is arbitrary, and we hope that it is a set of descriptors that defines the system\. The descriptor vector that we chose is composed of the counts of the syntax elements, such as function definitions, calls and assignments, that the edits of the run had added, less the counts of those that they had removed \(§[4\.11](https://arxiv.org/html/2611.23375#S4.SS11)\)\. The first two principal components of these vectors, over all the states of a task, are the two axes of the map\. On these axes we drew the*visit potential*,Φ=−lnρ\\Phi=\-\\ln\\rho, whereρ\\rhois the density of the visited states \(Fig\.[6](https://arxiv.org/html/2611.23375#S2.F6)\)\. The visit potential is low where the runs spent many of their edits\. It is built from a density, as are the potential of mean force of a system at equilibrium\[[6](https://arxiv.org/html/2611.23375#bib.bib6)\]and the quasi\-potential of a system out of equilibrium\[[7](https://arxiv.org/html/2611.23375#bib.bib7),[8](https://arxiv.org/html/2611.23375#bib.bib8)\]\. It is a pure number, fixed up to a constant, and it depends on the description of a state and on the smoothing of the density\. The free energy of §[2\.5](https://arxiv.org/html/2611.23375#S2.SS5)is a different quantity, measured in tokens from the work\.
On both tasks the visited states gather around three minima of the visit potential\. We call the set of repository states around one minimum a*basin*, as the region around a minimum of a potential energy surface is called\[[9](https://arxiv.org/html/2611.23375#bib.bib9)\]\. In the kinetic networks of molecular simulation, a basin in which a system stays for a long time before it jumps to another is a metastable state\[[10](https://arxiv.org/html/2611.23375#bib.bib10)\]\. We number the three along the coding direction:ℳ1\\mathcal\{M\}\_\{1\},ℳ2\\mathcal\{M\}\_\{2\}andℳ3\\mathcal\{M\}\_\{3\}\. In the words of a chemist, a coding run starts in the reactant stateℳ1\\mathcal\{M\}\_\{1\}, passes through the intermediate stateℳ2\\mathcal\{M\}\_\{2\}and lands in the product stateℳ3\\mathcal\{M\}\_\{3\}\. An uncoding run crosses them in the opposite order, as a reverse reaction does\. Of the 384 runs of the map, 288 landed, and 281 of these crossed the three basins in the order of their direction and never went back to an earlier one \(§[4\.11](https://arxiv.org/html/2611.23375#S4.SS11)\)\. Only the first basin held a run for long\. A landed run stayed in it for 4 to 10 turns at the median, and then reached the second and the third in a single turn\. The first basin is therefore metastable in the sense above, and the second is a place of passage\. The run drawn in Fig\.[6](https://arxiv.org/html/2611.23375#S2.F6)was inℳ2\\mathcal\{M\}\_\{2\}after one edit, and spent its remaining edits inℳ3\\mathcal\{M\}\_\{3\}, where it landed\. Withinℳ3\\mathcal\{M\}\_\{3\}, coding runs visited 13 distinct states on Task A and 7 on Task B\.
Not every run reachedℳ3\\mathcal\{M\}\_\{3\}\. At Hinton temperatures of 0\.25 and below, 12 to 35 per cent of the coding runs ended in a loop: they repeated one command, with no edit between the repeats, until the limit of 300 turns stopped them \(Fig\.[7](https://arxiv.org/html/2611.23375#S2.F7)a; §[4\.4](https://arxiv.org/html/2611.23375#S4.SS4)\)\. We call such a run trapped\. From 0\.5 to 1 no run was trapped\. A trapped run continues to generate tokens after its last code change\. We therefore computed the landing rate, the number of landed runs divided by the tokens spent, in two ways: with all the tokens, and without the tokens that a trapped run spent after it entered its last loop \(Fig\.[7](https://arxiv.org/html/2611.23375#S2.F7)b,c\)\.
We read these loops turn by turn \(§[4\.4](https://arxiv.org/html/2611.23375#S4.SS4)\)\. Nearly all of the runs that the limit stopped repeated one or two search commands that read the repository and returned the same output each time\. A run in such a loop receives no new information, and at a low Hinton temperature the model is likely to return the same command for the same context\. We therefore assume in LOCA that a stopped run does not land\.
The tokens of the loop carry most of the fall of the landing rate at low Hinton temperature on Task A and all of it on Task B\. With all tokens counted, the landing rate of the coding runs was about 13 times lower at a Hinton temperature of 0\.01 than at 1 on Task A, and about 4 times lower on Task B\. With the tokens of the last loop left out, it was about 2 times lower on Task A, and on Task B it did not fall \(§[4\.4](https://arxiv.org/html/2611.23375#S4.SS4)\)\. Loops of this kind are known\. A language model that has repeated itself is more likely to repeat again\[[42](https://arxiv.org/html/2611.23375#bib.bib42),[43](https://arxiv.org/html/2611.23375#bib.bib43)\], coding agents repeat their actions in the runs that fail\[[3](https://arxiv.org/html/2611.23375#bib.bib3),[44](https://arxiv.org/html/2611.23375#bib.bib44)\], and some harnesses stop a run that repeats one action with the same result\[[45](https://arxiv.org/html/2611.23375#bib.bib45)\]\. Our harness has no such guard, and this comparison is an accounting of the stored runs\. A shorter limit on turns can be read from the same runs, because the agent is not told the limit\. A run cut at a given turn is therefore the run that a shorter limit would have produced\. No run at a Hinton temperature of 0\.25 or below landed after turn 29\. Cut at 40 turns, the stored runs keep every one of these landings\. The landing rate of the cold conditions is then 2\.6 times lower than that of the warm conditions on Task A and 1\.6 times lower on Task B \(§[4\.4](https://arxiv.org/html/2611.23375#S4.SS4)\)\.
Figure 6:A run crosses three basins of the visit potential, and the last one has structure of its own\. \(a\) Task A\. The shading is the visit potential,Φ\\Phi, of the repository states that the runs visited, drawn on the two main axes of those states \(PC1, PC2\)\. A lighter shade means that the runs spent more of their edits there\. The three light regions are the basinsℳ1\\mathcal\{M\}\_\{1\},ℳ2\\mathcal\{M\}\_\{2\}andℳ3\\mathcal\{M\}\_\{3\}\. The arrows follow one coding run that landed, and the numbers count its edits: the run starts inℳ1\\mathcal\{M\}\_\{1\}, is inℳ2\\mathcal\{M\}\_\{2\}after one edit, and spends the rest of its edits inℳ3\\mathcal\{M\}\_\{3\}, the region inside the square\. \(b\)ℳ3\\mathcal\{M\}\_\{3\}of panel a, enlarged and drawn on its own two axes\. The dots are the distinct states that the coding runs visited there, and the same run passes through several of them before it lands\. \(c, d\) The same for Task B\. A run therefore does not reach its goal in one step: it passes through an intermediate state, and it still has choices to make after it arrives in the last one\. The contours are 2 units ofΦ\\Phiapart in a and c and 1 unit apart in b and d, and the colour bars giveΦ\\Phi\. The runs, the counts of states and how the two runs were chosen are in §[4\.11](https://arxiv.org/html/2611.23375#S4.SS11)\.Figure 7:Cold runs end in a loop, and the landing rate falls less when the tokens of the loop are left out\. \(a\) The share of the coding runs that end trapped, against the Hinton temperature, for Task A \(black\) and Task B \(rose\)\. A run is trapped when it ends by repeating one command, with no edit between the repeats\. No run is trapped from a Hinton temperature of 0\.5 up\. \(b\) The landing ratekkof the coding runs of Task A, the number of runs that landed divided by the tokens spent, on a logarithmic axis\. The hollow points and the dashed line count every token of every run\. The filled points and the solid line leave out the tokens that a trapped run spent after it entered its last loop\. Where the two lines part, the tokens of the loops are what lowers the rate\. \(c\) The same for Task B\. Each point is one condition of 46 to 137 runs, 765 runs in all, and the bars are 90 per cent bootstrap intervals over runs\. A run is stopped at 300 turns\.
### 2\.5 Eighty per cent of the tokens of a landed run are heat, and the work that remains gives the free energy of the change
Figure 8:Where the tokens go\. \(a, c\) The cost of one coding landing against the Hinton temperature,THT\_\{\\rm H\}, for Task A \(a\) and Task B \(c\), under the VIVA approximation \(black circles, Eq\.[10](https://arxiv.org/html/2611.23375#S2.E10)\), the CORTA approximation \(rose squares, Eq\.[11](https://arxiv.org/html/2611.23375#S2.E11)\) and the LOCA approximation \(tan triangles, Eq\.[12](https://arxiv.org/html/2611.23375#S2.E12)\)\. The vertical axis is logarithmic\. Below a Hinton temperature of 0\.5 the three approximations stand one to two orders of magnitude apart, because that is where runs fail to land\. \(b, d\) The free energy of the change,ΔFJ\\Delta F\_\{J\}\(Eq\.[13](https://arxiv.org/html/2611.23375#S2.E13)\), for Task A \(b\) and Task B \(d\), on a linear axis\. Under VIVA it is read from the landed coding runs\. Under CORTA and LOCA it includes the term for the unfinished runs \(Eq\.[15](https://arxiv.org/html/2611.23375#S2.E15)\), which is the same in both\. The free energy hardly moves between the approximations: the unfinished runs multiply the cost of a landing and change the free energy by at most 13 per cent\. The bars are 95 per cent bootstrap intervals over runs in a and c and 90 per cent in b and d\. The values are not corrected for the bias of few runs, which lowers the estimates of Task B by 4 to 47 tokens \(Test 5 of §[2\.5\.1](https://arxiv.org/html/2611.23375#S2.SS5.SSS1)\)\. The six Hinton temperatures are 0\.01, 0\.1, 0\.25, 0\.5, 0\.75 and 1\. The twelve conditions hold 1,200 runs, of which 1,110 landed\.Ever since Joule measured how much mechanical work produces a given amount of heat\[[46](https://arxiv.org/html/2611.23375#bib.bib46)\], thermodynamics has divided the energy that a system exchanges with its surroundings into work and heat\. The division is useful because the two parts play different roles: the work of a process bounds the free energy difference between its two end states \(Eq\.[8](https://arxiv.org/html/2611.23375#S2.E8)\), and the heat does not enter that bound\. This section divides the tokens of a run in the same way, and then obtains the free energy of the change from the work\.
Most of what a landed run generates leaves the state unchanged\. Over the 1,110 landed runs of Table[8](https://arxiv.org/html/2611.23375#S6.T8)\(§[6](https://arxiv.org/html/2611.23375#S6)\), 80 per cent of the tokens were heat in the sense of Eq\.[6](https://arxiv.org/html/2611.23375#S2.E6): they were generated in turns that left the state where it was\. The share was between 73 and 85 per cent in every condition and in both directions\. A landed run took 9 to 17 turns on average, and about two of them moved the state\. Task A atTH=0\.5T\_\{\\rm H\}=0\.5illustrates the division between work and heat\. A landed coding run cost about 2,300 tokens on average, with about 400 tokens of work and 1,900 of heat \(§[4\.8](https://arxiv.org/html/2611.23375#S4.SS8)\)\.
The work itself varies from run to run, and its spread is what gives the free energy\. In thermodynamics the free energy difference between two states can be read from the work of many repetitions of one process that drives the system from the first state to the second, however far from equilibrium the process runs\. This is Jarzynski’s equality\[[12](https://arxiv.org/html/2611.23375#bib.bib12)\],
⟨e−βW⟩=e−βΔF,\\left\\langle e^\{\-\\beta W\}\\right\\rangle=e^\{\-\\beta\\,\\Delta F\},\(13\)whereWWis the work of one repetition, the average runs over repetitions,β\\betais the inverse temperature andΔF\\Delta Fis the free energy of the second state less that of the first\. The exponential average gives the most weight to the repetitions that cost the least work, so the equality returns aΔF\\Delta Fat or below the mean work, as Eq\.[8](https://arxiv.org/html/2611.23375#S2.E8)requires\. For work with a Gaussian distribution of varianceσ2\\sigma^\{2\}it reduces toΔF=⟨W⟩−βσ2/2\\Delta F=\\langle W\\rangle\-\\beta\\sigma^\{2\}/2\. The equality was first tested by pulling single RNA molecules open\[[11](https://arxiv.org/html/2611.23375#bib.bib11)\], and pulling the same molecule open and letting it close gives the free energy from both directions\[[4](https://arxiv.org/html/2611.23375#bib.bib4)\]\.
The equality is proved under assumptions that the runs do not meet, and we use it by analogy\. It holds for a system that starts in equilibrium with a bath at the temperature1/β1/\\betaand is then driven along a fixed protocol\. The runs of a given condition all start from one stored tree, the instruction to the agent stands in for the protocol, and no bath sets a temperature\. A further difference is in the sign of the work\. A molecule that closes returns work to the apparatus\. An agent that removes a block generates tokens as it does so, and Eq\.[6](https://arxiv.org/html/2611.23375#S2.E6)counts them as negative because the state moved back\. The work of an uncoding run,WRW\_\{R\}, is therefore negative, and the reverse form of the equality,⟨e−βWR⟩=e\+βΔF\\langle e^\{\-\\beta W\_\{R\}\}\\rangle=e^\{\+\\beta\\,\\Delta F\}, is applied to it \(§[4\.8](https://arxiv.org/html/2611.23375#S4.SS8)\)\.
No bath setsβ\\betain the coding experiment\. We estimate it from the work in both directions\. In the Gaussian form of Jarzynski’s equality each direction gives one equation for the same free energy,ΔF=⟨WF⟩−βσF2/2\\Delta F=\\langle W\_\{F\}\\rangle\-\\beta\\sigma\_\{F\}^\{2\}/2from the coding runs andΔF=−⟨WR⟩\+βσR2/2\\Delta F=\-\\langle W\_\{R\}\\rangle\+\\beta\\sigma\_\{R\}^\{2\}/2from the uncoding runs\. The two equations have two unknowns, and their solution for the temperature is
β=2\(⟨WF⟩\+⟨WR⟩\)σF2\+σR2\.\\beta=\\frac\{2\\left\(\\langle W\_\{F\}\\rangle\+\\langle W\_\{R\}\\rangle\\right\)\}\{\\sigma\_\{F\}^\{2\}\+\\sigma\_\{R\}^\{2\}\}\.\(14\)The sum in the numerator is the work left over after a cycle, and it is zero for a cycle run reversibly\. We call1/β1/\\betathe*software temperature*of the condition\. It was about 130 to 150 tokens per nat on Task A and about 50 to 90 on Task B \(§[4\.8](https://arxiv.org/html/2611.23375#S4.SS8)\)\. This is the relation of Eq\.[19](https://arxiv.org/html/2611.23375#S4.E19)applied to the work, where the software temperature of the cycle \(§[2\.3](https://arxiv.org/html/2611.23375#S2.SS3)\) applies it to the cost\. The Gaussian form is an approximation, and the comparisons at the end of this section test it with the full exponential averages\.
Withβ\\betafixed in this way, Eq\.[13](https://arxiv.org/html/2611.23375#S2.E13)applied to the coding runs gave a free energy of about 340 to 370 tokens for the change of Task A and about 270 to 340 tokens for that of Task B \(§[4\.8](https://arxiv.org/html/2611.23375#S4.SS8)\)\. This free energy is 14 to 22 per cent of the mean cost of a landed coding run\. In Task A atTH=0\.5T\_\{\\rm H\}=0\.5, of the 415 tokens of coding work, about 350 are the free energy of the change and about 65 are dissipated work\. On Task A the free energy did not move with the Hinton temperature beyond its intervals\. On Task B it rose from about 270 tokens atTH=0\.1T\_\{\\rm H\}=0\.1to about 340 atTH=1T\_\{\\rm H\}=1, and the uncoding runs gave a rise of the same size\. We cannot distinguish two explanations for Task B\. The change may require more work at a higher Hinton temperature, or the estimate may be biased low in the two colder conditions, where 80 per cent of the coding tokens were in unfinished runs\.
The unfinished runs can be counted in the free energy\. An unfinished run never completes the change, so it adds nothing to the average of Eq\.[13](https://arxiv.org/html/2611.23375#S2.E13), however long it is followed\. Only the share of runs that land enters\. WithuFu\_\{F\}anduRu\_\{R\}the unfinished shares of the coding and the uncoding runs, the free energy over all runs is\[[29](https://arxiv.org/html/2611.23375#bib.bib29)\]
ΔFJall=ΔFJlanded−1βln1−uF1−uR\.\\Delta F\_\{J\}^\{\\rm all\}=\\Delta F\_\{J\}^\{\\rm landed\}\-\\frac\{1\}\{\\beta\}\\,\\ln\\frac\{1\-u\_\{F\}\}\{1\-u\_\{R\}\}\.\(15\)The second term was at most 48 tokens, 13 per cent of the free energy, and it is the same under CORTA and under LOCA \(§[4\.8](https://arxiv.org/html/2611.23375#S4.SS8)\)\. With it, the rise on Task B remains\. In the two coldest conditions of Task A, the cost of a coding landing rose from about 2,400 tokens under VIVA to about 30,000 under CORTA and to about 240,000 and 330,000 under LOCA, while the free energy rose by less than 50 tokens\. The unfinished runs therefore add heat and almost no free energy\.
#### 2\.5\.1 Five tests of the free energy
As powerful as Jarzynski’s equality is, it has limitations\. First, it needs a temperature, and the software temperature is one that we fitted from the same runs\. Second, its exponential average is dominated by the few runs of lowest work, so it is sensitive to the shape of the work distribution\. Third, it overestimates the free energy when the runs are few\. These limitations, combined with the fact that we are extending thermodynamics to software, require that we test our estimate of the free energy with care\. In this section we therefore carry out five tests\. Each test explores one component of the estimate: the direction of the runs, the temperature, the Gaussian approximation for the work, or the number of runs\. We list the tests below and what we learn from each\.
##### Test 1\. Uncoding gives the same free energy as coding to within 40 tokens\.
Jarzynski’s equality can be applied to the uncoding runs as well as to the coding runs, and the two must give the same free energy\. In the Gaussian approximation they agree by construction, because Eq\.[14](https://arxiv.org/html/2611.23375#S2.E14)is the temperature that makes them equal\. We therefore compared the two exponential averages in full, with the sameβ\\betaand the same runs\. The two directions then differ only through the part of the work distribution that is not Gaussian\. In the retained conditions, the uncoding estimate differed from the coding one by less than 20 tokens on Task A, and it was 20 to 40 tokens higher on Task B \(§[4\.8](https://arxiv.org/html/2611.23375#S4.SS8)\)\. The part of the work that is not Gaussian therefore moves the free energy by less than 15 per cent\.
##### Test 2\. An estimate without a temperature agrees\.
The second test uses an estimate that requires no software temperature\. If the two directions have the same variance, the two Gaussian equations give
ΔFS=12\(⟨WF⟩−⟨WR⟩\),\\Delta F\_\{S\}=\\tfrac\{1\}\{2\}\\left\(\\langle W\_\{F\}\\rangle\-\\langle W\_\{R\}\\rangle\\right\),\(16\)the half difference of the mean works, in whichβ\\betadoes not appear\. It lay within 2 tokens ofΔFJ\\Delta F\_\{J\}on Task A and within 23 tokens on Task B in the nine conditions that we retain, although the variance of the coding work was up to 3 times that of the uncoding work\. The free energy therefore changes little when the fitted temperature is taken out of it\.
##### Test 3\. The crossing of the two work distributions agrees\.
The third test uses neither a temperature nor a Gaussian form\. Under Crooks’ relation the distribution of the coding work and that of the uncoding work, with its sign changed, cross at the free energy\[[13](https://arxiv.org/html/2611.23375#bib.bib13)\]\. Collin and co\-workers read the free energy of the hairpin of Fig\.[2](https://arxiv.org/html/2611.23375#S2.F2)a from this crossing\[[4](https://arxiv.org/html/2611.23375#bib.bib4)\], and Fig\.[2](https://arxiv.org/html/2611.23375#S2.F2)d shows the two distributions for one condition of Task A\. The crossing lay within about 20 tokens ofΔFJ\\Delta F\_\{J\}on Task A and within about 30 on Task B without its coldest condition, andΔFJ\\Delta F\_\{J\}lay inside the 90 per cent interval of the crossing in each of the twelve conditions\. On Task B the crossing rose with the Hinton temperature asΔFJ\\Delta F\_\{J\}did\. The rise of the free energy on Task B therefore appears in an estimate that shares neither the temperature nor the Gaussian form\.
##### Test 4\. Estimators built for work that is not Gaussian agree\.
The exponential average is dominated by the very few runs that carry the least work\[[47](https://arxiv.org/html/2611.23375#bib.bib47)\]\. Researchers have developed estimators for work distributions that are not Gaussian, and here we apply two of them\. The first estimator, by Procacci, fits a mixture of two Gaussians to the coding work and takes the exponential average of the fitted distribution\[[48](https://arxiv.org/html/2611.23375#bib.bib48)\]\. The second estimator, Bennett’s acceptance ratio, uses runs from both directions\[[49](https://arxiv.org/html/2611.23375#bib.bib49)\]\. The mixture of Gaussians lay within 8 tokens ofΔFJ\\Delta F\_\{J\}and the acceptance ratio within 12 tokens, both under 4 per cent\. The work of the landed coding runs has no long tail: its skewness was between−0\.3\-0\.3and\+0\.7\+0\.7\. The shape of the work distribution therefore changes the free energy by a few per cent at most\.
##### Test 5\. The number of runs biases Task B more than Task A\.
The last test asks how the number of runs affects the estimate\. The exponential average gives most of its weight to the runs of lowest work\. A small sample rarely contains them, so it overestimates the free energy, and the overestimate falls as runs are added\[[28](https://arxiv.org/html/2611.23375#bib.bib28)\]\. Palassini and Ritort showed what sets its size: the dissipated work, in units of the temperature, compared with the logarithm of the number of runs\[[50](https://arxiv.org/html/2611.23375#bib.bib50)\]\. When the dissipated work is well below that logarithm, the bias is small\. Each of the nine conditions that we retain holds 42 to 51 landed coding runs \(the three that we leave out hold 29, 32 and 36\), and the logarithm of that number is about 3\.8\. On Task A the dissipated work was 0\.3 to 0\.6 nats, and the bias was 1 to 5 tokens\. On Task B the dissipated work was larger, 0\.8 to 2\.4 nats, and the bias grew with it: about 5 to 10 tokens in the two warmest conditions and about 20 to 50 tokens in the two coldest\. We computed these biases for Gaussian work with the measured variance\. With the bias removed, the free energy of Task B rose from about 240 tokens atTH=0\.1T\_\{\\rm H\}=0\.1to about 330 atTH=1T\_\{\\rm H\}=1\. The crossing of Test 3, which does not use the exponential average, also lay up to 32 tokens belowΔFJ\\Delta F\_\{J\}on Task B\. The free energy of Task A therefore stands as measured, and that of Task B rises with the Hinton temperature more steeply than the uncorrected estimate shows\.
Table[3](https://arxiv.org/html/2611.23375#S2.T3)sets the estimates side by side\. All five tests use the same runs\. An independent test would need a temperature measured by another method, which we do not have\.
Table 3:The free energy of the change under each test, in tokens\. The number in bold is the difference fromΔFJ\\Delta F\_\{J\}of the coding runs\. The columns are one condition of Task A and the coldest and the warmest quoted conditions of Task B\. Test 5 gives two values, one for each of the two variances used for the bias \(§[4\.8](https://arxiv.org/html/2611.23375#S4.SS8)\)\. The estimates of the free energy therefore lie within 6 per cent ofΔFJ\\Delta F\_\{J\}for Task A and within 17 per cent for Task B\.For future measurements we recommend Bennett’s acceptance ratio\. It uses the runs of both directions at once, and Bennett showed that it has the least variance of the estimators built on the two work distributions\[[49](https://arxiv.org/html/2611.23375#bib.bib49)\]\. Here it lay within 4 per cent ofΔFJ\\Delta F\_\{J\}in every quoted condition\. We suggest reporting the crossing of the two work distributions beside it, because the crossing needs no temperature\. We also suggest enough runs that the logarithm of their number is well above the dissipated work in nats\.
#### 2\.5\.2 The ratio of the two landing rates does not give the free energy
There is a second place to look for a free energy, familiar from chemical kinetics: the rates\. For a transition and its own reverse, in a system held by one bath, the logarithm of the ratio of the two rates isβΔF\\beta\\,\\Delta F; this is local detailed balance\[[20](https://arxiv.org/html/2611.23375#bib.bib20)\]\. We therefore asked whether the rates of landing in coding and in uncoding give the free energy that the work gave\. They do not\. Coding landed more slowly than uncoding by 0\.1 to 1\.1 nats, in either of two ways of counting the rate, whileβΔF\\beta\\,\\Delta Fwas 2\.3 to 2\.9 nats on Task A and 3\.8 to 5\.6 on Task B \(§[4\.8](https://arxiv.org/html/2611.23375#S4.SS8)\)\. The two readings therefore stand about 2 nats apart on Task A and 3 to 5 nats apart on Task B\.
We think that the rates disagree with the work for the following reason\. Local detailed balance compares a transition with its own reverse: the same path, travelled backwards\. Uncoding is not coding travelled backwards\. An agent that undoes a change does not retrace the steps of the agent that made it\. It follows its own instruction and finds its own path\. The two are like a road up a mountain and a different road down: the times of the two journeys say little about the height of the mountain\. The ratio of the two landing rates therefore compares the costs of two different paths, and the free energy does not set it\.
#### 2\.5\.3 Uncoding from the ensemble of end trees
A thermodynamic state is an ensemble\. In the experiments above, each uncoding run started from a single tree\. In some sense, this mirrors the coding runs, which also started from a single tree\. A thermodynamic argument can be made that, to really show that coding and uncoding are different, uncoding should start from the ensemble of trees on which the coding runs ended \(§[4\.10](https://arxiv.org/html/2611.23375#S4.SS10)\)\. We made this second experiment on both tasks atTH=0\.5T\_\{H\}=0\.5\(§[4\.9](https://arxiv.org/html/2611.23375#S4.SS9)\), and we describe Task A first\.
If uncoding were the reverse of coding, the work of the two directions would obey Crooks’ relation\[[13](https://arxiv.org/html/2611.23375#bib.bib13)\],
lnPF\(W\)PR\(−W\)=β\(W−ΔF\),\\ln\\frac\{P\_\{F\}\(W\)\}\{P\_\{R\}\(\-W\)\}=\\beta\\,\(W\-\\Delta F\),\(17\)wherePFP\_\{F\}andPRP\_\{R\}are the distributions of the work of coding and of uncoding\. The logarithm would be a straight line inWWwith slopeβ\\beta, which is 0\.0065 per token on Task A\. The measured slope was 0\.0007 per token from the ensemble of end trees and 0\.0032 per token from the single tree \(Fig\.[9](https://arxiv.org/html/2611.23375#S2.F9)b\)\. On Task A, Crooks’ relation therefore does not hold between coding and uncoding, from either start\.
The cost of uncoding did not depend on its starting tree\. A landed uncoding run cost about 1,800 tokens from the ensemble and from the single tree, and a landed coding run cost about 2,300 tokens\. From the ensemble, the work of uncoding had nearly the same distribution as the work of coding \(Fig\.[9](https://arxiv.org/html/2611.23375#S2.F9)a\)\. The two directions therefore did nearly the same work, and the extra cost of coding was heat\.
Task B gave a different answer\. There the measured slope was 0\.019 per token from the ensemble and 0\.022 per token from the single tree, andβ\\betais 0\.018 per token\. Each line crossed zero within 13 tokens of the free energy \(§[6](https://arxiv.org/html/2611.23375#S6), Table[7](https://arxiv.org/html/2611.23375#S6.T7)\)\. On Task B the work of the two directions is therefore consistent with Crooks’ relation\. The cost is not: a landed coding run cost about 1,600 tokens and a landed uncoding run about 1,170 tokens, from either start\. The coding runs of Task B ended on two trees only, so its ensemble is close to a single tree\.
Figure 9:Uncoding from the ensemble of end trees, on Task A atTH=0\.5T\_\{H\}=0\.5\. \(a\) The distribution of the work of the 48 landed coding runs \(rose\), and of the work of uncoding with its sign changed: 100 runs from the single tree \(black\) and 100 runs from the ensemble of end trees \(dashed\)\. Each tick under the curves is one run\. The curves are kernel density estimates \(§[4\.9](https://arxiv.org/html/2611.23375#S4.SS9)\)\. \(b\) The logarithm of Eq\.[17](https://arxiv.org/html/2611.23375#S2.E17)from the single tree \(filled circles\) and from the ensemble \(open squares\), with the fitted lines\. The dotted line is Crooks’ relation, with slopeβ\\betaand its zero at the free energyΔF\\Delta F\.
#### 2\.5\.4 A landing passes through at least five states
The cost of a landing holds one more piece of information: how regular it is\. If a landing were one rare event, like the decay of a nucleus, the cost of a landed run would follow an exponential distribution, and its spread would equal its mean\. A landing that needs many steps in a row is more regular, in the way that the wait for ten buses varies less, in proportion, than the wait for one\. Aldous and Shepp made this precise\[[51](https://arxiv.org/html/2611.23375#bib.bib51)\]\. They considered a Markov chain that passes throughnnstates before it stops, and showed that the squared coefficient of variation of its stopping time, the variance over the squared mean, is at least1/n1/n\. Their bound allows loops and backward steps\.
We measured the squared coefficient of variation of the cost of a landed run, with cost in the place of time\. It was 0\.04 to 0\.19 in every condition and direction, where a single rare event gives 1\. This range leaves out one landed run of 74,298 tokens\. With it, the value of its condition is 7\.3 in place of 0\.08 \(§[4\.8](https://arxiv.org/html/2611.23375#S4.SS8)\)\. Under the model of Aldous and Shepp, the process that generates a landing therefore has at least 5 phases in the most variable condition and at least 24 in the most regular\. These are phases of the model, and a single run need not pass through all of them\.
The count is a lower bound, and it holds under a model\. A run keeps its whole history, so it is not a Markov chain, and the bound does not say what a state is \(§[4\.8](https://arxiv.org/html/2611.23375#S4.SS8)\)\. We take one thing from it: a landing is a sequence of many steps, as the three basins of §[2\.4](https://arxiv.org/html/2611.23375#S2.SS4)already suggested\.
#### 2\.5\.5 The extra cost of coding is real
In this section, we do the detective work of finding out whether the extra cost of coding over uncoding is a mirage or a reality\. For that, we need statistical tests\. We ask two questions\. The first is whether the difference between the mean costs is larger than chance would give with our number of runs\. The second is whether the extra cost sits in every coding run or in a few expensive ones\.
##### Test 1\. Coding costs more than uncoding in 11 of the 12 conditions\.
For the first question we used a permutation test \(§[4\.8](https://arxiv.org/html/2611.23375#S4.SS8)\)\. The test shuffles the labels coding and uncoding among the landed runs of a condition many times, and counts how often the shuffled difference of the mean costs is as large as the measured one\. We ran one test for each of the 12 conditions\. When twelve tests are run, one of them can pass the usual threshold of 0\.05 by chance alone\. We therefore also report each result after a correction for twelve tests, in which the threshold is divided by twelve\. The permutation test found that coding cost more than uncoding in 11 of the 12 conditions, with and without the correction\. The exception is Task A atTH=0\.1T\_\{\\rm H\}=0\.1, where the extra cost was the smallest, 12 per cent\.
##### Test 2\. The extra cost is spread over all the landed runs\.
For the second question, we compare the distributions of coding and uncoding costs with the Kolmogorov–Smirnov test, which measures their largest gap\. We first divided the cost of each landed run by the mean cost of its direction, so that only the spread of the costs around their mean is compared\. If every coding run costs more by the same factor, the two divided distributions are the same\. The Kolmogorov–Smirnov test found no difference in 10 of the 12 conditions, and in 11 of the 12 after the correction for twelve tests\. There were only two exceptions, both on Task A, atTH=0\.25T\_\{\\rm H\}=0\.25and atTH=0\.75T\_\{\\rm H\}=0\.75\. Our hypothesis is that they are statistical fluctuations: among twelve tests at a threshold of 0\.05, chance alone gives at least one exception in 46 per cent of cases, and one of the two disappears after the correction\. This test has little power against a difference of spread, so we also compared the quantiles of the landed costs directly\. The ratio of the cost of coding to that of uncoding was about the same at the 10th percentile, at the median and at the 90th percentile: 1\.1 to 1\.8, 1\.1 to 1\.5 and 1\.2 to 1\.5 over the conditions of Task A, and 1\.2 to 1\.5, 1\.2 to 1\.4 and 1\.2 to 1\.5 over those of Task B\. The most expensive tenth of the landed runs held 15 to 19 per cent of the cost of coding and 14 to 21 per cent of the cost of uncoding\.
Therefore, we conclude that the extra cost of coding over uncoding is statistically significant, and that it is spread over the landed runs and not carried by a few of them\. As our group and other groups start working on software thermodynamics and more measurements become available, this result can be tested on other code bases and in other scenarios\.
#### 2\.5\.6 At cold Hinton temperatures the tokens go to runs that never land
It is fitting that the authors of this article and Geoffrey Hinton live in the same cold city in Canada\. In this section, we explore the cold Hinton temperatures, the conditions in which the agents enter situations from which they never land\.
Every token that an agent spends belongs either to a run that landed or to a run that never did\. We look at the two parts in turn, from the warmest condition,TH=1T\_\{\\rm H\}=1, to the coldest,TH=0\.01T\_\{\\rm H\}=0\.01\.
The first part hardly depends on the temperature\. A coding run that landed cost about 2,000 to 2,500 tokens on Task A and about 1,500 to 1,700 on Task B, whether the agent was warm or cold\.
The second part depends strongly on the temperature \(Fig\.[8](https://arxiv.org/html/2611.23375#S2.F8)\)\. On Task A, the unfinished runs took at most 22 per cent of the tokens of the coding runs fromTH=0\.5T\_\{\\rm H\}=0\.5up, and 74 to 93 per cent below it\. On Task B, they took 26 to 59 per cent fromTH=0\.5T\_\{\\rm H\}=0\.5up, and 79 to 87 per cent below it\. Every uncoding run of Task B landed\.
The price of a landing is therefore the same in the cold as in the warmth\. What the cold adds is the runs that never land, which are the loops that we described in §[2\.4](https://arxiv.org/html/2611.23375#S2.SS4)\. Like a car that spins its wheels in the snow of a Toronto winter, a looping agent burns tokens and goes nowhere\. For this reason the VIVA, CORTA and LOCA approximations for the unfinished runs \(Eqs\.[10](https://arxiv.org/html/2611.23375#S2.E10)to[12](https://arxiv.org/html/2611.23375#S2.E12)\) differ most in the cold conditions\.
### 2\.6 A noisy test suite catches no more defects than a file’s own tests
Software defects are expensive\. In 2002, a study for the US National Institute of Standards and Technology put the cost of an inadequate infrastructure for software testing to the US economy at 59\.5 billion dollars a year\[[52](https://arxiv.org/html/2611.23375#bib.bib52)\]\. Twenty years later, the Consortium for Information and Software Quality estimated a broader quantity, the cost of poor software quality in the United States, at 2\.41 trillion dollars or more for 2022\[[53](https://arxiv.org/html/2611.23375#bib.bib53)\], about 9 per cent of the output of the country in that year\. If the rest of the world loses the same share of its output, the cost to the world is about 10 trillion dollars a year\. This is an estimate of the order of magnitude and no more\. To give it a scale, 10 trillion dollars a year is about what the world spent on health in 2021\[[54](https://arxiv.org/html/2611.23375#bib.bib54)\], nearly twice the sales of the chemical industry of the world, which were 5\.0 trillion euros in 2024\[[55](https://arxiv.org/html/2611.23375#bib.bib55)\], and more than twice the value that the farms, forests and fisheries of the world add in a year\[[56](https://arxiv.org/html/2611.23375#bib.bib56)\]\.
A single defect can be costly too\. In 2012 the trading firm Knight Capital lost more than 460 million dollars in about 45 minutes, after new code was deployed incorrectly\[[57](https://arxiv.org/html/2611.23375#bib.bib57)\]\. In July 2024 one faulty update, released by the company CrowdStrike, cost the Fortune 500 companies an estimated 5\.4 billion dollars in direct losses\[[58](https://arxiv.org/html/2611.23375#bib.bib58)\]\. The stakes are now rising, because the agents themselves have become capable attackers\. An academic study found in 2024 that a language model exploited 87 per cent of a set of 15 known vulnerabilities\[[59](https://arxiv.org/html/2611.23375#bib.bib59)\], and Anthropic reports that its model Claude Mythos Preview, when a user directs it to, finds and exploits unknown vulnerabilities in every major operating system and every major web browser, some of which had stayed hidden for more than twenty years\[[60](https://arxiv.org/html/2611.23375#bib.bib60)\]\.
The gate, the test suite that decides whether a change may land \(§[2\.1\.7](https://arxiv.org/html/2611.23375#S2.SS1.SSS7)\), is the last defence against a defect\. Therefore, having robust tests and understanding their thermodynamics is crucial\. In this section we measure how robust a gate is\. We first describe an experiment in which we plant defects and count how many of them the gate stops\. We then show three results: the whole test suite caught as many defects as the tests of the changed file alone, its threshold lay inside its own noise, and calibrating the threshold did not rescue it\.
##### The experiment\.
To measure how many defects a gate detects, we planted the defects ourselves\. No agent and no model took part\. In each of sixty trials, on three machines, we took the clean repository and, with a probability of 50 per cent, planted one defect in one of six files\. We then drew one of three gates at random: no gate at all, the tests of the changed file alone, or the whole test suite\. A tree landed when its gate passed it\.
The whole suite has a difficulty that the other two gates do not have\. It fails a few tests even on clean code, and the number of these failures,NN, changes from one run to the next\. Programmers call such tests flaky\[[61](https://arxiv.org/html/2611.23375#bib.bib61)\]\. A test can be flaky for many reasons\. Some tests wait on a network connection, which may be slow on a given day\. Some compete with other processes for the disk or the memory of the machine\. Others depend on the order in which the tests run, on the version of a library, or on permissions that differ from one machine to the next\. We did not trace the cause of each flaky test in our suite\. What matters here is their effect: a gate cannot ask for zero failures\. Our harness readNNonce, on clean code, and passed any tree with at most three times that many failures\.
##### The whole suite caught as many defects as the file’s own tests\.
One would expect the whole suite, which runs every test of the repository, to catch more defects than the few tests of one file\. It did not\. Each gate met eight planted defects \(§[6](https://arxiv.org/html/2611.23375#S6), Table[9](https://arxiv.org/html/2611.23375#S6.T9)\)\. The file’s own tests stopped three of the eight, and the whole suite also stopped three\. The trees that landed tell the same story: 40 per cent of them carried a defect when there was no gate, 29 per cent after the file’s own tests, and 31 per cent after the whole suite\. Sixty trials cannot tell the two gates apart \(§[4\.12](https://arxiv.org/html/2611.23375#S4.SS12)\), but the larger gate showed no advantage\.
##### The threshold was inside the noise\.
The reason is the threshold\. Take the machine whose clean run failed 11 tests\. Its gate passed any tree with up to 33 failures\. With a planted defect the suite failed 8 to 12 tests on that machine, so every defect passed\. A scale that wavers by 30 grams cannot weigh a pinch of salt, and this gate could not see one defect\. The noise also moved from day to day\. The three machines failed 17, 11 and 1 tests on one morning, and 2, 1 and 4 on the next, so one reading ofNNsays little about the next\.
##### Calibrating the threshold did not rescue the gate\.
An experimentalist would object that one reading is no calibration, and would be right\. We therefore measured the noise with more care\. We ran the clean suite twelve times in a row on each of two machines, and we set the threshold so that clean code is refused about 5 per cent of the time\. The new thresholds were 23 and 10 failed tests\. The gate did not improve\. Under the new thresholds the whole suite stopped two of its eight defects, and 35 per cent of the trees that it let land carried a defect, against 29 per cent for the file’s own tests\. We tried once more on the third machine, with a defect in every trial, and the gate stopped four of eleven\.
We conclude that a test suite with noise of its own is a weak gate\. With either threshold, the whole suite stopped no more defects than the tests of the changed file\. This suggests that the remedy lies in the tests themselves, in removing those that fail on clean code, more than in the threshold\.
Now that we have understood the flakiness of the gate as a complex system, in which the test suite interacts with itself and with other factors of the computer on which it runs, we have to remember that gates are code too\. Therefore, they can have errors of their own\. The next section explores the effect of the errors of the gates themselves\.
### 2\.7 A gate that errs lets broken changes land
Figure 10:The heavy cost of a mistake\. \(a\) The classical case: Szilard’s engine with a faulty measurement\. The work that the daemon extracts, in units ofkBTk\_\{B\}T, against the error probabilityPPof its measurement\. A hedged daemon, which acts only as far as its measurement can be trusted, never loses \(black\)\. A confident daemon, which acts as if it were certain, loses work once the error passes a threshold \(rose and plum, for two degrees of confidence,v=0\.9v=0\.9and0\.990\.99; the dots mark where the work crosses zero\)\. \(b\) Measured on the toy system with its hidden defect: the share of the landed changes that are broken,PfalseP\_\{\\rm false\}, against the error probability that we injected into the gate\. From an error of 0\.15 up the points lie above the dashed diagonal, on whichPfalse=PP\_\{\\rm false\}=P: broken changes landed more often than the gate erred\. The bars are Wilson 95 per cent intervals\. \(c\) The gain of Eq\.[23](https://arxiv.org/html/2611.23375#S4.E23)on the same system\. It falls as the error rises and stays positive over the measured range\. The dotted line is an extrapolation, and we do not use its values\. The counts are in §[4\.13](https://arxiv.org/html/2611.23375#S4.SS13)\.We ended the last section on the remark that gates are code, and that code has errors\. A gate can err in either direction\. It can show green for a broken change or red for a sound one\. In the language of §[1](https://arxiv.org/html/2611.23375#S1), it is a daemon whose measurement sometimes errs\[[18](https://arxiv.org/html/2611.23375#bib.bib18)\]\. One might think that a gate that errs once in ten lets one broken change in ten land\. Physicians know that this is wrong\. A test that errs once in ten, used on a ward where nine patients in ten are ill, declares healthy a group of which half are ill\. What a wrong verdict costs depends on how many of the attempts are truly broken\. In this section we give the gate an error that we control, and we measure three things: the tokens that the error wastes, the share of the landings that are broken, and the temperature that this share gives the gate\.
##### The experiment\.
We injected a known error probabilityPPinto the gate\. Before a verdict was shown to the agent, we flipped it with probabilityPP, from green to red or from red to green, and we kept the true verdict beside it\. The verdict that the agent sees is the served verdict \(§[2\.1\.7](https://arxiv.org/html/2611.23375#S2.SS1.SSS7)\)\. A false landing is a change that landed on a served green while its true verdict was red\. We tested three systems that differed in how often an attempt failed before we flipped its verdict\.
##### When every attempt is sound, the error wastes tokens\.
On the first system the agents finished green on every attempt, so a false landing was never possible\. The error could only turn a true green into a served red\. Of 96 true greens, 7, 12 and 29 were lost in this way at the three errors that we tested, the largest of which wasP=0\.30P=0\.30\. The agents had to try again, and the tokens spent for each true landing rose from about 1,700 with no error to about 2,400 atP=0\.30P=0\.30\(§[4\.13](https://arxiv.org/html/2611.23375#S4.SS13)\)\. An error of the gate therefore has a cost even when no broken change can land\.
##### When most attempts are broken, false landings exceed the error\.
The second system is a toy that we built with a hidden defect, so that more than half of the honest attempts end red\. It is the ward of our opening\. With no error, none of 21 landings was false\. AtP=0\.30P=0\.30, 14 of 27 were, which is 52 per cent\. FromP=0\.15P=0\.15on, the share of false landings was above the error itself \(Fig\.[10](https://arxiv.org/html/2611.23375#S2.F10)b\)\. Equation[22](https://arxiv.org/html/2611.23375#S4.E22)says why\. The share of false landings exceeds the error once more than half of the attempts are truly red, and on the toy 56 to 63 per cent were\. We built the toy for this regime\. The result is therefore the arithmetic of Eq\.[22](https://arxiv.org/html/2611.23375#S4.E22)met on a running agent, and it is no general property of agents \(Supplementary Note 2\)\.
##### On the repository, false landings follow the error\.
The third system is the repository of this letter\. We took the two tasks of §[2\.2](https://arxiv.org/html/2611.23375#S2.SS2)and planted a defect of one line in each, so that a true red existed\. We then injected seven errors, from 0\.01 to 0\.30\. Of 669 runs, 550 could be judged, which means that their true verdict could be read \(§[4\.13](https://arxiv.org/html/2611.23375#S4.SS13)\), and 269 of these landed\. Here 42 to 60 per cent of the attempts were truly red, on both sides of one half\. The share of false landings followed the error: it was 3, 0, 3, 11, 13, 26 and 28 per cent at errors of 1, 2, 5, 10, 15, 20 and 30 per cent \(§[6](https://arxiv.org/html/2611.23375#S6), Table[10](https://arxiv.org/html/2611.23375#S6.T10)\)\. For each unit of error added, the share rose by about one unit\. The slope was 1\.03, with a 90 per cent interval of 0\.70 to 1\.36\.
Equation[22](https://arxiv.org/html/2611.23375#S4.E22)therefore describes both systems\. The share of false landings is above the error on the toy, where more than half of the attempts are truly red, and close to the error on the repository, where about half are\.
##### The gate has a temperature, and it rises with the error\.
In a system held by a bath, a fluctuation that costs an energyΔ\\Deltahappens with a probability ofe−βΔe^\{\-\\beta\\Delta\}\. We read the gate in the same way\. A false landing is a fluctuation of the gate that lets a defect through, and the defect costsΔ\\Deltatokens to repair\. We takePfalseP\_\{\\rm false\}as the share of the landed changes that are broken, the number that a developer who trusts a landing needs \(§[4\.13](https://arxiv.org/html/2611.23375#S4.SS13)\)\. The temperature of the gate is the temperature at which such a fluctuation is as frequent as the false landings:
1βgate=Δ−lnPfalse\.\\frac\{1\}\{\\beta\_\{\\rm gate\}\}=\\frac\{\\Delta\}\{\-\\ln P\_\{\\rm false\}\}\.\(18\)A gate that almost never errs is cold, and a gate that errs often is hot\.
We measuredΔ\\Deltaon the repository\. All 36 repairs of the planted defect reached green, at a median of about 1,100 tokens \(§[4\.13](https://arxiv.org/html/2611.23375#S4.SS13)\)\. The temperature of the gate was then about 490, 510, 780 and 830 tokens a nat at errors of 0\.10, 0\.15, 0\.20 and 0\.30\. It rose with the error\. The model, on the same repository, had a temperature of 70 to 147 tokens a nat on Task A and of 51 to 80 on Task B, in the form that counts every token of a run \(§[2\.5](https://arxiv.org/html/2611.23375#S2.SS5)\)\. From an error of 0\.10 up, the gate was therefore 3 to 16 times hotter than the model, when the temperature of the model is taken from its landed runs\. The gate still removed defects at its hottest: at an error of 0\.30, 35 of the 84 judged runs were broken, against 14 of the 50 that landed\. The comparison is one of two scales in tokens, and we did not measure a flow of entropy\. In the two\-reservoir reading the gate should be the colder of the two, and by Clausius’s version of the second law \(§[1](https://arxiv.org/html/2611.23375#S1)\) a gate hotter than the model cannot extract disorder from what the model writes\.
##### What our sample can and cannot show\.
A cold gate errs rarely, and a rare event needs many trials to be seen\. Repairing a defect costs about a thousand tokens, seven times the highest temperature of the model\. A gate as cold as the model would therefore let a broken change through about once in a thousand attempts, and our conditions hold 34 to 50 landings each\. Withnnlandings, the lowest temperature that can be read isΔ/lnn\\Delta/\\ln n, which is 270 to 299 tokens a nat here, about twice the highest temperature of the model\. Our experiment can show a gate hotter than the model\. It cannot show one as cold\. At the three lowest errors, 0\.01, 0\.02 and 0\.05, there were 1, 0 and 1 false landings among 37, 34 and 39 landings\. One false landing sits on this bound, so these conditions cannot be told apart, and we report the condition at 0\.05 as an upper limit of 415 tokens a nat\.
We also did not measure the temperature of the gate with no error injected\. The experiment takes the verdict of the unperturbed suite as the truth, so it cannot see the errors of the suite itself\. What we measured is the direction: from an error of 0\.10 up, each increase of the error made the gate hotter\.
##### A verdict with an error is still worth having\.
We scored the gate with the gain of Eq\.[23](https://arxiv.org/html/2611.23375#S4.E23): what a true green is worth, less what a false landing destroys, each weighted by the error\. The gain was positive at every error that we tested \(Fig\.[10](https://arxiv.org/html/2611.23375#S2.F10)c\)\. It fell as the error rose, from about 800 tokens to about 250, and it had not reached zero at our largest error, 0\.30\. The dotted line of Fig\.[10](https://arxiv.org/html/2611.23375#S2.F10)c continues the trend beyond that error as a guide to the eye, and we do not rely on it \(§[4\.13](https://arxiv.org/html/2611.23375#S4.SS13)\)\.
Therefore, we conclude that an error in a gate costs more than its rate suggests\. Sound changes are refused, and their tokens are wasted\. Broken changes land\. The gate also runs hotter than the model\. As agents write and test more of the world’s code, we expect gate errors to deserve as much attention as model quality, if not more\.
## \\materiaDisplay3\\materiaDisplayDiscussion
The Results answered the question of our title\. Here we step back and ask what the answers mean, where they may fail, and what they suggest\. We do so through six questions that a reader may well put to us\.
##### Is this thermodynamics, or only an analogy?
Thermodynamics has been lent to many fields, and not always with profit\. Our answer is that this is an analogy that makes predictions, and that one of them could have failed\. We estimated the free energy of a change in five ways that rest on different assumptions, and the estimates agreed within 6 per cent on Task A and within 17 per cent on Task B \(Table[3](https://arxiv.org/html/2611.23375#S2.T3)\)\. An analogy with no content would have had no reason to agree with itself\.
Two things keep us from calling it more than an analogy\. First, the agent is not in equilibrium with anything\. The model proposes without waiting for the gate, a run keeps its whole history, and no detailed balance holds\. Our temperatures are therefore operational, and we use Jarzynski’s equality by analogy \(§[2\.5](https://arxiv.org/html/2611.23375#S2.SS5)\)\. Second, we have not shown that the free energy is a state function, a quantity fixed by the two end trees however the change is made\. The coding and the uncoding estimates lie within 17 tokens of each other on Task A and 21 to 39 tokens apart on Task B\. The estimate of Task B rises with the Hinton temperature, and the same task cost different tokens on different days\. Uncoding from the ensemble of end trees did not settle the question: the work of the two directions was consistent with Crooks’ relation on Task B and was not on Task A \(§[2\.5\.3](https://arxiv.org/html/2611.23375#S2.SS5.SSS3)\)\.
The title of this letter also promises entropy, and here it has a plain meaning: one change can be made in many ways\. The coding runs of Task A ended on 128 different trees, and the uncoding runs on 23 \(Fig\.[5](https://arxiv.org/html/2611.23375#S2.F5)\)\. A complete account would count these trees in the free energy\. We have not done so here, but we plan to investigate this issue further\.
##### How efficient is a coding agent?
Engineers ask of every engine how much of its fuel becomes useful work\. The same question can now be put to a harness\. The free energy of a change is our estimate of the least that the change can cost on average, and it was 14 to 22 per cent of the cost of a landed coding run\. We call this ratio the efficiency of the run\. It is a score and no bound of Carnot’s kind, and its unit, the token, is shared by every harness and every model\. Benchmarks of coding agents report how often an agent succeeds\[[62](https://arxiv.org/html/2611.23375#bib.bib62)\]\. The efficiency adds what a success cost, set against the least that it could have cost\. One could have agents that are efficient in the sense of this letter and inefficient in tokens per watt\[[63](https://arxiv.org/html/2611.23375#bib.bib63)\], or agents that are inefficient in the sense of this letter and very inexpensive in computation\. How the other measures of efficiency in the literature correlate with ours, and how this varies across combinations of agent and harness, is a question that future studies from us and others should settle\.
##### Is the heat wasted?
About 80 per cent of the tokens of a landed run left the repository unchanged, and it is tempting to call them waste\. We think that most of them are not\. In those turns the agent reads files, searches the repository and runs the tests\. It is finding out what to change\. Szilard and Landauer showed that information has a thermodynamic price\[[23](https://arxiv.org/html/2611.23375#bib.bib23),[24](https://arxiv.org/html/2611.23375#bib.bib24)\], and the heat of a coding run may be, for the most part, the price of the information that the agent needs before it can act\. An agent that knew the repository in advance would pay less\. Savings are therefore more likely to come from telling the agent what it would otherwise have to discover than from making it read less\. We did not measure how much of this heat provided useful information and how much was wasted\. We plan to distinguish the two in our next measurement\.
##### Is a colder agent a safer one?
One would expect a colder agent, which gives its most likely reply every time, to be the more reliable one\. Our agents were not\. BelowTH=0\.5T\_\{\\rm H\}=0\.5they paid the same price for a landing and lost most of their tokens to loops\. Counted over all runs, a coding landing cost 2 to 14 times more belowTH=0\.5T\_\{\\rm H\}=0\.5than from 0\.5 up\. We cannot name a best temperature from one model and two tasks, and a warmer agent may fail in ways that a renaming does not reveal\. The loops also point to a remedy other than heat\. An agent in a loop receives the same output at every call\. What it lacks is information, and we will report on this elsewhere\.
##### What will limit agentic coding, the model or the gate?
Most of the attention in this field goes to the model\. Our measurements say that the gate deserves a share of it\. Once the gate erred one time in ten, it was 3 to 16 times hotter than the model: the judge was noisier than the author\. We injected that error ourselves, and we did not measure the temperature of a test suite as it stands, so we cannot say how hot the gates in use are\. That measurement can be made, with an independent reference verdict and enough runs to see one false landing in a thousand, and we think that every harness should make it on its own tests\. Therefore, if models improve faster than tests do, test suites will decide the quality of what lands and, eventually, the quality of the software that serves a large part of the internet\. More attention to testing is probably deserved, both to the tests of single units and to harnesses built for testing alone\.
##### How far do two renamings reach?
We chose our two tasks because they can be undone exactly, as a molecule can be folded again\. Most changes to software cannot\. A new feature has no unique reverse, and for such a change the free energy would have to come from the coding runs alone, through the tests of Table[3](https://arxiv.org/html/2611.23375#S2.T3)that need one direction\. Our numbers also come from one model, one repository and one toy system\. The extra cost of coding was measured on the runs that landed\. Counting the runs that did not land made it larger at the middle Hinton temperature, and at the coldest the matter is open, because the unfinished runs hold most of the tokens\.
We therefore state what we expect to hold elsewhere, so that it can be tested\. Coding costs more than uncoding\. Most of the tokens of a landed run are heat\. Cold agents lose tokens to loops\. The share of false landings follows Eq\.[22](https://arxiv.org/html/2611.23375#S4.E22)\. The potential energy surfaces of molecules and materials have puzzled scientists for more than a century\. We believe that the non\-equilibrium kinetic networks of software, which we are only starting to understand through software thermodynamics, will be equally challenging to understand, and will hold as many surprises as their molecular counterparts have shown\.
## \\materiaDisplay4\\materiaDisplayMethods
### 4\.1 System
The agent was a language model editing a frozen repository toward a stated goal, one call at a time, through an instrumentation layer that recorded every call’s tokens, every edit and every verdict served\. A run was one attempt; a task was a goal with its reverse; a set of runs shared a model version and a Hinton temperature\. A tree’s reaction coordinateqq\(Eq\.[5](https://arxiv.org/html/2611.23375#S2.E5)\) was the share of the goal’s blocks it contained\. A block was the renaming of a file or one contiguous group of changed lines, which git calls a hunk\. Task A hadN=2N=2blocks, the renaming of the module’s file and one edit to a file that refers to it, soqqtook the values 0, 1/2 and 1\. Task B hadN=3N=3blocks, the renaming and two edits, andqqtook the values 0, 1/3, 2/3 and 1\. A coding run reached its goal atq=1q=1, an uncoding run atq=0q=0, and a run landed when the gate was green there\. The gate was the repository’s test suite or a stated subset, served after an edit and once more as the final grade\.
Task A and Task B each renamed one module of the repository’s own code \(Table[1](https://arxiv.org/html/2611.23375#S1.T1)\), and each was applied once by a script so that the reverse is the exact inverse of the forward\. In each task, a file with a single purpose was given a new name in the same folder and every reference to it was updated\. The tests that exercised the file served as the gate\. The coding \(forward\) run started from the tree before the renaming and was asked to make it; the uncoding \(reverse\) run started from the tree after and was asked to undo it\. Task A renamed a module that keeps the agent from stalling: when a check takes minutes, such as the full test suite, it sends the check to the background so that work goes on while it runs\. Task B renamed a module that guards a deployment: it reads back the software image a server is running and confirms that it is the one that was built\.
Each direction of a task was posed as a base tree, a target tree and a goal in words; each run ended in one of four recorded outcomes: landed; done with the goal unreached; censored at the limit on turns or the wall\-time limit; or ungraded, when the grader could not run the tests on the run’s last tree\. Every landing rate is a share of the runs started\. Of the 1,200 runs of Table[8](https://arxiv.org/html/2611.23375#S6.T8)\(§[6](https://arxiv.org/html/2611.23375#S6)\), 1,110 landed, 11 ended done with the goal unreached, 78 were censored at the limit on turns and 1 was ungraded\. The cost of a run counted the tokens the model generated, which the provider bills as output tokens; the tokens it read were recorded and are not part of the cost\. The repository was a Python codebase of several hundred modules with its test suite, maintained by the authors, frozen at a stated commit for each set\.
### 4\.2 Model, harness and machines
The model wasdeepseek\-v4\.1\-flash, reached through the commercial gateway Lyceum\. Each reply carried the version that the provider served, and on every reply of the seven sets of Table[8](https://arxiv.org/html/2611.23375#S6.T8)\(§[6](https://arxiv.org/html/2611.23375#S6)\) it wasdeepseek\-v4\.1\-flash\-1017\. Each request set the Hinton temperature and switched the model’s reasoning mode off\. We set no other decoding parameter and no sampling seed, so the provider’s defaults applied\. A reply could hold at most 65,536 tokens, and a run ended at 300 turns\. The system prompt was ‘You change the repository in the working tree with the bash and edit tools\. When the task is done, reply DONE with no tool call\.’ The model had two tools, a shell and a file editor\. When a reply called no tool and did not say DONE, the harness answered ‘If the task is done, reply DONE\. Otherwise continue with a tool call\.’
The provider ran the model and nothing else\. The harness, the working tree, the two tools, the test suite and the grader ran on rented cloud machines, up to eight runs at a time on each\. The runs of Fig\.[8](https://arxiv.org/html/2611.23375#S2.F8)used five machines of two cloud providers and two hardware plans, three in Finland and two in Canada\. For each set, we recorded the harness commit, the task hash and a seed\. The seed fixed the order of the runs and the choice of planted defects, and it did not reach the model\.
### 4\.3 Units and conventions
The Hinton temperatureTHT\_\{\\rm H\}is the provider’s decoding temperature, a dimensionless knob that we set\. The software temperatures,1/βcyc1/\\beta\_\{\\rm cyc\}of the cost around a cycle and1/β1/\\betaof the work, are measured, in tokens per nat\. No conversion between the two is assumed\. In Fig\.[4](https://arxiv.org/html/2611.23375#S2.F4)the vertical axis is the software temperature and the horizontal axis is the Hinton temperature\. Logarithms are natural: an entropy, or a free energy divided by a software temperature, is quoted in nats, the unit in which the exponents of the fluctuation relations carry no conversion factor; bits are kept for counted information, the bit that a verdict carries at most among them, and one bit isln2=0\.693\\ln 2=0\.693nats, so that erasing it costs at leastkBTln2k\_\{B\}T\\ln 2of heat \(Landauer\)\. Table[11](https://arxiv.org/html/2611.23375#S6.T11)\(§[6](https://arxiv.org/html/2611.23375#S6)\) gives the kind, the level and the resampled unit of every interval we report\. Each bootstrap resampled the runs of one condition and one direction; the repair cost resampled the planted defects first and then the runs of each defect\.
### 4\.4 Unfinished runs
Of the 1,200 runs, 90 were unfinished\. The limit of 300 turns stopped 78 of them, 11 ended by themselves before the tests passed, and one was ungraded: the grader could not run the tests on its last tree\. The 78 stopped runs generated 3,836,090 of the 5,846,729 tokens of the 1,200 runs, 65\.6 per cent\.
Of the 78 stopped runs, 75 repeated one or two search commands that read the repository and returned the same output each time\. All 75 were atTHT\_\{\\rm H\}below 0\.5, and none of them changed the repository at any turn\. The last new output of such a run came between its 5th and its 31st turn, at the 11th at the median\. One further run added a filter to its search at each turn\. Two runs atTH=0\.75T\_\{\\rm H\}=0\.75waited for a test job that never finished\. By comparison, a landed run needed 12 turns at the median and at most 50\. Among 215 landed runs, the longest streak of repeated commands was 0 in 211, 1 in 3 and 2 in 1\.
In the six conditions of the cycle, 25 of the 288 runs were unfinished, and 22 of the 25 were coding runs\. The limit stopped 19 of them, all atTH=0\.1T\_\{\\rm H\}=0\.1, and the other 6 ended by themselves before the tests passed\. Among the 765 coding runs of Fig\.[7](https://arxiv.org/html/2611.23375#S2.F7), the share that ended trapped was 35, 32 and 13 per cent on Task A and 25, 13 and 12 per cent on Task B atTHT\_\{\\rm H\}of 0\.01, 0\.1 and 0\.25, and it was zero from 0\.5 to 1\. With all tokens counted, the landing rate of the coding runs was 12\.6 times lower atTH=0\.01T\_\{\\rm H\}=0\.01than at 1 on Task A and 4\.4 times lower on Task B\. With the tokens of the last loop left out, it was 2\.3 times lower on Task A\. With every run cut at 40 turns, it was 2\.6 times lower on Task A and 1\.6 times lower on Task B\.
### 4\.5 Cost and the cycle temperature
The costCCof a run is its count of generated tokens, a quantity every call reports and a provider bills\. A task pairs a goal with its reverse; coding runs start from the base tree and add the goal’s blocks, uncoding runs start from the target tree and remove them\. This construction closes the goal\-block coordinate and leaves the byte\-exact tree open, since landed trees carry edits outside the goal’s blocks, and we define the cycle’s cost asQ=⟨CF⟩\+⟨CR⟩Q=\\langle C\_\{F\}\\rangle\+\\langle C\_\{R\}\\rangleover landed runs, assuming zero free\-energy change on that coordinate\. The asymmetry𝒜=⟨CF⟩−⟨CR⟩\\mathcal\{A\}=\\langle C\_\{F\}\\rangle\-\\langle C\_\{R\}\\rangleis the excess of coding over uncoding\. The cycle has one temperature, the model’s, and we define it, with no shape fitted, by the relation Gaussian work obeys under the fluctuation theorems\[[12](https://arxiv.org/html/2611.23375#bib.bib12),[13](https://arxiv.org/html/2611.23375#bib.bib13)\], dissipation equal toβσ2/2\\beta\\sigma^\{2\}/2: around the closed cycle, with the mean and the varianceσC2\\sigma\_\{C\}^\{2\}of each direction’s cost,
1βcyc=σC,F2\+σC,R22\(⟨CF⟩\+⟨CR⟩\)\(tokens per nat\)\.\\frac\{1\}\{\\beta\_\{\\rm cyc\}\}=\\frac\{\\sigma\_\{C,F\}^\{2\}\+\\sigma\_\{C,R\}^\{2\}\}\{2\\,\(\\langle C\_\{F\}\\rangle\+\\langle C\_\{R\}\\rangle\)\}\\qquad\\text\{\(tokens per nat\)\}\.\(19\)
For a process whose work distribution is Gaussian with mean⟨W⟩\\langle W\\rangleand varianceσ2\\sigma^\{2\}, the Jarzynski equality\[[12](https://arxiv.org/html/2611.23375#bib.bib12)\]⟨e−βW⟩=e−βΔF\\langle e^\{\-\\beta W\}\\rangle=e^\{\-\\beta\\Delta F\}evaluates to⟨W⟩−ΔF=βσ2/2\\langle W\\rangle\-\\Delta F=\\beta\\sigma^\{2\}/2: the dissipated work is fixed by the fluctuations\. Equation[19](https://arxiv.org/html/2611.23375#S4.E19)applies this relation to the cost of the cycle, taking the whole cost as dissipated andΔF=0\\Delta F=0around the closed cycle\. The cost is not Gaussian and the model is not a bath, so the relation is taken as the definition of the operational temperature\. In §[2\.5](https://arxiv.org/html/2611.23375#S2.SS5)we apply the same relation to the signed work of Eq\.[6](https://arxiv.org/html/2611.23375#S2.E6), one direction at a time \(Eq\.[14](https://arxiv.org/html/2611.23375#S2.E14)\)\. The two temperatures differ because the cost contains the heat and the work does not\.
The two tasks \(§[4\.1](https://arxiv.org/html/2611.23375#S4.SS1)\) were run in both directions, coding \(forward\) and uncoding \(reverse\), on four fully instrumented sets \(two at temperatures 0\.1 and 1\.0, two at 0\.5\), 24 runs launched a direction and condition, 14 to 24 landed, 263 landed runs in all\.QQand𝒜\\mathcal\{A\}were means over landed runs;𝒜\\mathcal\{A\}carried a 97\.5 per cent normal interval, on the standard error of a difference of two means with unequal variances, and a symmetry margin of a tenth of the mean cost\.1/βcyc1/\\beta\_\{\\rm cyc\}was Eq\.[19](https://arxiv.org/html/2611.23375#S4.E19)per condition\. In Fig\.[4](https://arxiv.org/html/2611.23375#S2.F4)it is computed under the three approximations on the twelve conditions, and its interval is a 95 per cent percentile bootstrap of 2,000 draws over runs, each direction resampled on its own\. Where all runs landed, on Task A atTH=0\.5T\_\{\\rm H\}=0\.5andTH=1T\_\{\\rm H\}=1, the cycle heat was 3,999 and 3,670 tokens under all three approximations\. On Task A atTH=0\.1T\_\{\\rm H\}=0\.1it was 4,158 tokens under VIVA, 60,598 under CORTA and 556,271 under LOCA, and on Task B at the same Hinton temperature it was 2,745, 17,091 and 254,492 tokens\.
To test for survivor selection, we ran a separate sample in the two cooler conditions of each task\. We pooled runs with and without the harness\. We computed the asymmetry first over landed runs and then over all runs, including the tokens spent by unfinished runs\. The sample holds twenty runs a direction at the middle Hinton temperature and nine to fourteen at the coldest\. At the middle Hinton temperature all runs of the Task A sample landed, and the asymmetry was\+371\+371\[\+27,\+715\]\[\+27,\+715\]tokens\. That of Task B was\+408\+408\[\+63,\+753\]\[\+63,\+753\]on landed runs and\+588\+588\[\+163,\+1013\]\[\+163,\+1013\]on all runs\. At the coldest Hinton temperature, 22 per cent of the runs reached the limit of 300 turns\. These ten runs cost 27,000 to 365,000 tokens, compared with a median near 1,800 among landed runs\.
### 4\.6 The force–extension curves of Fig\.[2](https://arxiv.org/html/2611.23375#S2.F2)a
We read the curves of Fig\.[2](https://arxiv.org/html/2611.23375#S2.F2)a from the pixels of Fig\. 1 of ref\.\[[4](https://arxiv.org/html/2611.23375#bib.bib4)\]\. The tick marks of its axes gave the scale, 24 pixels per pN and 8\.8 pixels per nm\. We assigned each coloured pixel to an unfolding or a refolding curve by its colour and left out the drawing of the hairpin\. The shaded area is the integral of the force over the extension under the refolding curve that bounds the shaded area of the original, from 355\.0 to 380\.3 nm and down to zero force\. It is 392 pN nm, or 95kBTk\_\{B\}Tat 298 K\. This area belongs to one curve between those two extensions\. The mean refolding work of 106\.6kBTk\_\{B\}Tin ref\.\[[4](https://arxiv.org/html/2611.23375#bib.bib4)\]is taken between the limits of that analysis\. As a control we drew a trapezoid of known area in the same colours and read it by the same procedure, which returned the area within 0\.2 per cent\.
### 4\.7 The arrow of time of a run
We read the arrow of time of a run from its output tokens per turn, following the estimates of entropy production from the irreversibility of a recorded series\[[36](https://arxiv.org/html/2611.23375#bib.bib36),[37](https://arxiv.org/html/2611.23375#bib.bib37)\]\. Each landed run gave two numbers that change sign when the run is read backwards: the mean change in tokens from one turn to the next, divided by the run’s mean tokens per turn, and the number of rises minus the number of falls, divided by the number of steps\. We fitted a logistic classifier without an intercept to tell the runs in recorded order from the same runs reversed, so that its scoreffchanges sign under reversal\. On runs kept out of the fit, the Donsker–Varadhan expression⟨f⟩−ln⟨e−f⟩\\langle f\\rangle\-\\ln\\langle e^\{\-f\}\\rangleestimates a lower bound on the relative entropy between the recorded and the reversed records, in nats a run\. The bound holds for the means over all runs\. On a finite sample the expression is an estimate, and it can fall below zero\.
We used the 633 landed runs of three of the seven sets of runs behind Table[8](https://arxiv.org/html/2611.23375#S6.T8)\(§[6](https://arxiv.org/html/2611.23375#S6)\), 326 for the fit and 307 for the estimate, divided by a hash of each run’s name\. The estimates of §[2\.3](https://arxiv.org/html/2611.23375#S2.SS3)are on 55 and 90 of these runs for coding and uncoding on Task A and on 82 and 80 for Task B\. They were 0\.28 nats a run\[0\.02,0\.55\]\[0\.02,0\.55\]for coding on Task A and 0\.39\[0\.17,0\.60\]\[0\.17,0\.60\]for uncoding\. On Task B they were 0\.03\[−0\.18,0\.24\]\[\-0\.18,0\.24\]and−0\.03\-0\.03\[−0\.28,0\.22\]\[\-0\.28,0\.22\]\. Intervals are 95 per cent bootstraps over the runs of the estimate and leave out the uncertainty of the fit\. With the turns of each run shuffled, the estimate was0\.000\.00\[−0\.03,0\.03\]\[\-0\.03,0\.03\]\. The fit did not see the runs of the six cycle conditions; their coding estimates were 0\.25 to 0\.30 nats on Task A and−0\.06\-0\.06to0\.040\.04on Task B, on 14 to 24 runs a condition\. In the three cycle conditions of Task A the coding estimate, multiplied by the software temperature of the condition, was 19 to 39 tokens, 0\.5 to 1\.1 per cent of the cycle heat\.
### 4\.8 The free energy from the work
##### The runs\.
The two tasks were run in both directions, coding \(forward\) and uncoding \(reverse\), by the plain agent at six Hinton temperatures, 0\.01, 0\.1, 0\.25, 0\.5, 0\.75 and 1, in seven sets on different days\. We combined every set and left out one run in which a reply reached the provider’s limit of 65,536 tokens\. This gave 1,200 runs, of which 1,110 landed \(§[6](https://arxiv.org/html/2611.23375#S6), Table[8](https://arxiv.org/html/2611.23375#S6.T8)\)\. The run that was left out landed, on Task A atTH=0\.25T\_\{\\rm H\}=0\.25in coding, after 74,298 tokens\. With it, the mean cost of a landed coding run in that condition is 3,904 tokens in place of 2,374 and its squared coefficient of variation is 7\.3 in place of 0\.08, while the free energy changes by 0\.1 token\.
##### Work and heat\.
The stateqqafter each turn was read from the saved tree, and the work and the heat of a landed run followed from Eq\.[6](https://arxiv.org/html/2611.23375#S2.E6)\. We included unfinished runs when computing the landed fraction and the unfinished share\. We computed mean work from landed runs alone\. The mean work of a landed uncoding run was−288\-288to−316\-316tokens on Task A and−194\-194to−261\-261on Task B\. The work left over after a cycle,⟨WF⟩\+⟨WR⟩\\langle W\_\{F\}\\rangle\+\\langle W\_\{R\}\\rangle, was 91 to 153 tokens on Task A and 150 to 201 on Task B\.
##### The software temperature\.
The software temperature of Eq\.[14](https://arxiv.org/html/2611.23375#S2.E14)ranged from 128 to 153 tokens per nat on Task A and from 49 to 90 on Task B \(§[6](https://arxiv.org/html/2611.23375#S6), Table[8](https://arxiv.org/html/2611.23375#S6.T8)\)\. On the same runs the cost form of Eq\.[19](https://arxiv.org/html/2611.23375#S4.E19)gives 70 to 147 tokens per nat on Task A and 51 to 80 on Task B\.
##### The free energy\.
The free energyΔFJ\\Delta F\_\{J\}of the coding runs was 342 to 368 tokens on Task A and 271 to 339 on Task B \(§[6](https://arxiv.org/html/2611.23375#S6), Table[8](https://arxiv.org/html/2611.23375#S6.T8)\)\. On Task B it was 275\[253,298\]\[253,298\]tokens atTH=0\.1T\_\{\\rm H\}=0\.1and 339\[318,362\]\[318,362\]atTH=1T\_\{\\rm H\}=1\. In Task A atTH=0\.5T\_\{\\rm H\}=0\.5, 351 of the 415 tokens of coding work were the free energy and 64 were dissipated work, about 0\.4 nats at the temperature of that condition\.
##### The free energy as a fraction of the cost\.
The free energy as a fraction of the cost of a landed run isΔFJ\\Delta F\_\{J\}of the coding runs over the mean of the two directions’ mean costs\. It is 17 to 19 per cent on Task A and 19 to 25 per cent on Task B in the conditions that are not left out\. Over the mean cost of a landed coding run alone it is 15 to 17 per cent on Task A and 17 to 22 per cent on Task B, and over that of a landed uncoding run it is 19 to 24 and 22 to 28 per cent\.
##### The heat of a landed run\.
AtTH=0\.5T\_\{\\rm H\}=0\.5a landed coding run of Task A cost 2,305 tokens on average and a landed uncoding run cost 1,710\. The turns that changed the state account for 415 and 288 of those tokens, and the other 1,890 and 1,422 tokens, 82 and 83 per cent, were heat\. On Task B the two directions cost 1,606 and 1,205 tokens, of which 410 and 227 were work and 74 and 81 per cent were heat \(Supplementary Fig\.[1](https://arxiv.org/html/2611.23375#S6.F1)d\)\.
##### The estimators\.
Per condition,β\\betawas Eq\.[14](https://arxiv.org/html/2611.23375#S2.E14)with the sample variances of the two directions; the free energy wasΔFJ=−\(1/β\)ln⟨e−βWF⟩\\Delta F\_\{J\}=\-\(1/\\beta\)\\ln\\langle e^\{\-\\beta W\_\{F\}\}\\rangleover the landed coding runs, its reverse form\(1/β\)ln⟨e−βWR⟩\(1/\\beta\)\\ln\\langle e^\{\-\\beta W\_\{R\}\}\\rangleover the landed uncoding runs, andΔFS\\Delta F\_\{S\}of Eq\.[16](https://arxiv.org/html/2611.23375#S2.E16)\. In the retained conditions, the uncoding estimate less the coding one was between−17\-17and\+15\+15tokens on Task A and between\+21\+21and\+39\+39on Task B\.ΔFS\\Delta F\_\{S\}lay within 1\.4 tokens ofΔFJ\\Delta F\_\{J\}in the conditions of Task A and within 23 tokens in the retained conditions of Task B\. In the cold condition of Task B that we leave out,TH=0\.01T\_\{\\rm H\}=0\.01, the two differ by 51 tokens \(§[6](https://arxiv.org/html/2611.23375#S6), Table[8](https://arxiv.org/html/2611.23375#S6.T8)\)\. The variance of the coding work was 1\.2 to 1\.9 times that of the uncoding work on Task A and 1\.1 to 3\.2 times on Task B\.
##### Intervals\.
Intervals are 90 per cent percentile bootstraps of 2,000 draws over runs, each direction resampled on its own andβ\\betafitted again in every draw\. The shift for few runs was the mean ofΔFJ\\Delta F\_\{J\}over 400 random subsets of 5, 10 and 20 landed coding runs, less its value on all of them, at the condition’sβ\\beta\.
##### The crossing\.
The crossing was the work, between the two mean works, at which Gaussian kernel density estimates ofWFW\_\{F\}and of−WR\-W\_\{R\}were equal, the middle one when there were several\. Its interval is the 90 per cent percentile bootstrap of 1,000 draws over runs, each direction resampled on its own\. The bandwidth of each density was set by Scott’s rule, and a crossing existed in all twelve conditions\. In 0\.4 to 24 per cent of the draws on Task A, and in at most 0\.5 per cent on Task B, the two estimates did not cross between the mean works, and the interval is over the draws that did\. The crossing lessΔFJ\\Delta F\_\{J\}was between−16\-16and\+22\+22tokens on Task A and between−32\-32and\+1\+1on Task B without its coldest condition, where the crossing was 49 tokens aboveΔFJ\\Delta F\_\{J\}\. On Task B the crossing was 243 tokens atTH=0\.1T\_\{\\rm H\}=0\.1and 333 atTH=1T\_\{\\rm H\}=1\.
##### Estimators for work that is not Gaussian\.
The mixture of two Gaussians was fitted to the landed coding work by expectation maximisation, and its free energy is the exponential average of the fitted density at theβ\\betaof the condition\. It lay within 5 tokens ofΔFJ\\Delta F\_\{J\}on Task A and within 8 on Task B\. Bennett’s acceptance ratio lessΔFJ\\Delta F\_\{J\}was between−7\-7and−2\-2tokens on Task A and between−12\-12and\+10\+10on Task B\. A single Gaussian was 9 to 19 tokens belowΔFJ\\Delta F\_\{J\}on Task A and 4 to 32 below on Task B\. The excess kurtosis of the landed coding work was between−1\.2\-1\.2and\+0\.2\+0\.2\.
##### The bias for few runs\.
The bias for few runs was simulated for Gaussian work, 40,000 samples of the condition’s number of landed coding runs, with the variance ofβW\\beta Wset in two ways: to the sample variance, and to the mean squared distance below the median of the runs below the median, which is the Gaussian tail of Palassini and Ritort\[[50](https://arxiv.org/html/2611.23375#bib.bib50)\]\. Their parameterλ\\lambda, the logarithm of the number of runs over the dissipated work of the tail, was 5 to 16 on Task A and 0\.8 to 2\.9 on Task B; their closed forms hold forλ\\lambdabelow 1, so we simulated\. AtTH=0\.1T\_\{\\rm H\}=0\.1, 0\.25, 0\.5, 0\.75 and 1 on Task B the bias was 23, 17, 12, 4 and 9 tokens with the first variance and 47, 32, 17, 8 and 12 with the second\. With the bias removed the free energy of Task B was 251 or 228 tokens atTH=0\.1T\_\{\\rm H\}=0\.1and 330 or 327 atTH=1T\_\{\\rm H\}=1\. On planted Gaussian work of 48 runs with a dissipated work ofln48\\ln 48nats the simulated bias was 0\.68 nats, againstln2\\ln 2in their scaling limit\. Subsets of 20 landed coding runs gave an estimate above that of all the runs by at most 3 tokens on Task A and 7 on Task B\.
##### The free energy and the cost of a landing\.
Over the twelve conditions,ΔFJ\\Delta F\_\{J\}was 14 to 22 per cent of the mean cost of a landed coding run\. With the tokens of the unfinished runs counted \(CORTA\), a coding landing cost 7,798 to 31,359 tokens in the conditions belowTH=0\.5T\_\{\\rm H\}=0\.5and 2,183 to 3,665 from 0\.5 up\.
##### The landed fraction\.
The term for the landed fraction was−\(1/β\)ln\(ϕF/ϕR\)\-\(1/\\beta\)\\ln\(\\phi\_\{F\}/\\phi\_\{R\}\)withϕ\\phithe landed fraction of each direction\[[29](https://arxiv.org/html/2611.23375#bib.bib29)\]\. It was between 0 and 48 tokens in the twelve conditions\. With it, the free energy of Task B was 281 tokens atTH=0\.1T\_\{\\rm H\}=0\.1and 347 atTH=1T\_\{\\rm H\}=1\. In the two coldest conditions of Task A, the cost of a coding landing under LOCA was 240,000 and 329,000 tokens, and the free energy rose from 354 to 401 tokens and from 368 to 414\. In the nine conditions of the quoted ranges the term was at most 0\.15 nats and at most 15 tokens, less than the half width of the 90 per cent interval of the free energy, which was 18 to 35 tokens\. In the two coldest conditions of Task A it was 0\.30 and 0\.40 nats, 46 and 48 tokens, about twice the half width of 22 tokens\. The derivation of the term assumes that each state is in equilibrium within itself\. An unfinished run here is one stopped by the limit of 300 turns, which a folding molecule does not have\.
##### The two rates\.
The ratio of costs was the mean cost of a landed coding run over that of a landed uncoding run\. We give the rate of landing in two ways\. The first is the reciprocal of the mean cost of a landed run\. A landed coding run cost 1\.12 to 1\.45 times a landed uncoding run over all twelve conditions, so this rate is lower in coding by 0\.11 to 0\.37 nats\. The second is the number of landed runs divided by all the tokens of the condition, the rate of Fig\.[7](https://arxiv.org/html/2611.23375#S2.F7), which also counts the tokens of the runs that did not land\. In the six conditions fromTH=0\.5T\_\{\\rm H\}=0\.5toTH=1T\_\{\\rm H\}=1, where no run was trapped, this second rate is lower in coding by 0\.30 to 0\.48 nats on Task A and by 0\.59 to 1\.12 nats on Task B\. With the first rate the two readings stand 2\.0 to 2\.5 nats apart on Task A and 3\.5 to 5\.2 on Task B\. With the second rate, in its six conditions, they stand 1\.9 to 2\.5 nats apart on Task A and 2\.6 to 4\.7 on Task B\.
##### The tests on the cost\.
The mean costs of the landed runs of the two directions were compared in each condition by a two\-sided permutation test of 20,000 relabellings on the difference of the means\. Theppvalue was below 0\.001 in 11 of the 12 conditions and 0\.053 on Task A atTH=0\.1T\_\{\\rm H\}=0\.1\. The shape of the two directions’ costs was compared by a permutation test of 2,000 relabellings on the Kolmogorov–Smirnov distance between the costs, each divided by its direction’s mean\. Each relabelling pooled the scaled costs of the two directions, dealt them into two groups of the original sizes and divided each group by its own mean again before the distance was taken, as was done for the data\. The correction for twelve tests was Bonferroni’s, a threshold of 0\.05/12\. We estimated what the test can detect by simulation with gamma\-distributed costs, 48 a direction, the means of the two directions a factor of 1\.3 apart, 400 pairs for each case and 500 relabellings a pair\. The test rejected at 0\.05 in 4 per cent of pairs of equal shape\. It rejected in 20 per cent of pairs with squared coefficients of variation of 0\.10 and 0\.05, in 32 per cent with 0\.10 and 0\.20, and in 56 per cent with 0\.10 and 0\.033\.
##### The regularity of the cost and the bound on the states\.
We calculated the squared coefficient of variation by dividing the sample variance of landed\-run costs by the square of their mean\. The bound on the number of states is that of Aldous and Shepp\[[51](https://arxiv.org/html/2611.23375#bib.bib51)\]for the time a continuous\-time Markov chain onnnstates takes to reach an absorbing state\. Tokens are counted in whole numbers and a run retains its history, so the chain is a model of the run and the bound is read under it\. The bound is reached only when the states are visited one after another at equal rates\. A state of the model is not a turn\. Relations between the regularity of a first\-passage time and the dissipation that pays for it are proved for continuous\-time Markov processes\[[30](https://arxiv.org/html/2611.23375#bib.bib30),[31](https://arxiv.org/html/2611.23375#bib.bib31),[32](https://arxiv.org/html/2611.23375#bib.bib32)\], and we did not apply them to the runs\.
##### Conditions left out\.
A condition was left out of the quoted ranges when more than 85 per cent of the tokens of either direction were in unfinished runs, because in such a condition the landed runs are the subset that stopped early, and the limit on turns shapes what is averaged\. The rule removed three conditions, which Table[8](https://arxiv.org/html/2611.23375#S6.T8)\(§[6](https://arxiv.org/html/2611.23375#S6)\) shows with the rest\. The mean cost of a landed coding run was 1,502 to 1,732 tokens on Task B and 1,986 to 2,510 on Task A\. In the three conditions that the rule removed, 63 to 75 per cent of the coding runs landed, and they hold 7 to 13 per cent of the coding tokens\. With every condition included, the free energy of Task A stays within 342 to 368 tokens and that of Task B spans 260 to 339\. The share of the tokens of the coding runs that the unfinished runs took was, from the coldest condition to the warmest, 91, 93, 74, 0, 22 and 0 per cent on Task A and 87, 79, 83, 26, 59 and 44 per cent on Task B\.
##### Checks on planted data\.
The estimators were checked on planted data: Gaussian work obeying the work relations with a known temperature and free energy, which they returned within 2 per cent and 1 token; costs of known regularity; two samples of one shape with means 1\.35 times apart, which the shape test called the same, and two of different shape, which it told apart; wide Gaussian work, on which the shift for few runs was positive and fell as runs were added; and Gaussian work of 48 runs a direction obeying Crooks’ relation with a free energy of 350 tokens, on which the crossing was 365\[334,389\]\[334,389\]tokens\.
### 4\.9 Uncoding from the ensemble of end trees
We repeated the uncoding of each task atTH=0\.5T\_\{H\}=0\.5from two starts, with the model, the harness, the instruction and the limits of the cycle \(§[4\.1](https://arxiv.org/html/2611.23375#S4.SS1), §[4\.2](https://arxiv.org/html/2611.23375#S4.SS2)\)\. One start was the single tree from which every uncoding run of the cycle started\. The other was the ensemble of trees on which the coding runs ended\.
##### Starts\.
On Task A the 48 landed coding runs ended on 27 distinct trees, identified as in §[4\.10](https://arxiv.org/html/2611.23375#S4.SS10)\. For each uncoding run of the ensemble, we drew one of the 48 runs with equal probability and with replacement, and rebuilt its end tree from the starting tree and the change that the run had stored\. Every rebuilt tree had the hash that the coding run had recorded\. The 100 draws gave 24 distinct trees, and the most frequent tree was drawn 39 times\. Outside the files of the change, these trees differed from the single tree in at most one file and four lines\. We made 100 further uncoding runs from the single tree\. The 200 runs were made together, in random order, and all of them landed\. On Task B the 45 landed coding runs ended on two distinct trees, which held 33 and 12 of the runs, and both were drawn\. These trees differed from the single tree in the files of the change only\. We again made 100 runs from each start, together and in random order, and all 200 landed\. In one run of Task B the provider was asked twice for one reply; the run is counted with the tokens that were metered\.
##### Cost and work\.
Table[7](https://arxiv.org/html/2611.23375#S6.T7)\(§[6](https://arxiv.org/html/2611.23375#S6)\) gives the cost and the work of a landed uncoding run from each start, with 90% bootstrap intervals over runs \(2,000 resamples\)\. The costs of the two starts differed by−27\-27tokens\[−194,127\]\[\-194,127\]on Task A and by−27\-27tokens\[−111,57\]\[\-111,57\]on Task B\. On both tasks the cost from the single tree agrees with the uncoding cost of the cycle \(§[6](https://arxiv.org/html/2611.23375#S6), Table[8](https://arxiv.org/html/2611.23375#S6.T8)\)\.
##### Crooks’ test\.
We estimated the density of the work of coding and of the work of uncoding with its sign changed, each with a Gaussian kernel whose width follows Scott’s rule\. We fitted a straight line to the logarithm of their ratio over the works at which both densities exceeded one tenth of their peaks\. Table[7](https://arxiv.org/html/2611.23375#S6.T7)\(§[6](https://arxiv.org/html/2611.23375#S6)\) gives the slope of the line and the work at which it crosses zero\. On simulated Gaussian works that obey Eq\.[17](https://arxiv.org/html/2611.23375#S2.E17), the same procedure returned 94% of the true slope\. We fixed this analysis before we read the runs\.
### 4\.10 Paths and the count of end trees
A run’s path is the sequence of trees it passed through\. We recorded the tree at the start of the run, after each code change and at the end of the run\. We identified each tree by a hash of its files, taken after comments and white space were removed from each file, so two trees that differ only in layout or in comments count as one\. The tree includes any files the run added\. We merged consecutive repeats of one tree\. Each step in the resulting path represents one change of the code\. The end tree of a run is the last tree of its path\. Figure[5](https://arxiv.org/html/2611.23375#S2.F5)pools the six Hinton temperatures and draws the runs of one task and one direction in one panel\.
Among landed runs, we counted distinct end trees and calculated the entropy of the end\-tree distribution,−∑ipilog2pi\-\\sum\_\{i\}p\_\{i\}\\log\_\{2\}p\_\{i\}, wherepip\_\{i\}is the fraction of landed runs ending on treeii\. The counts pool the six Hinton temperatures\. On Task A the 310 coding runs that landed ended on 125 trees, and the commonest of them held 45 per cent of the runs\. The 343 uncoding runs that landed ended on 21 trees, and one tree held 94 per cent\. On Task B the landed runs ended on 7 trees in coding and 4 in uncoding\. The count is a lower bound, since a tree that no run reached is not counted\. The entropy is the plug\-in estimate, which reads low on average at a finite number of runs\[[64](https://arxiv.org/html/2611.23375#bib.bib64)\]\. The first\-order correction,\(K−1\)/\(2Nln2\)\(K\-1\)/\(2N\\ln 2\)bits forKKtrees seen inNNruns, is 0\.29 bits for the coding runs of Task A and less than 0\.05 bits for each of the other three sets\. With 114 of 125 trees reached once, this correction is itself too small for the coding runs of Task A, and we report the uncorrected values\.
The figure draws every run, landed or not\. Its colours rank the end trees by the number of runs that end on them; trees with equal numbers are ranked in the order of the run table, which carries no meaning\. The figure holds more than 1,500 runs\. For 192 of them the intermediate trees had not been stored\. We rebuilt these trees by replaying each run’s stored commands on its starting tree, without calling the model\. The replay reproduced the recorded tree identifiers at every step in 190 of the 192 runs\. The two other runs ended unsolved and are drawn with the trees that could be read\. In seven unsolved runs some intermediate trees could not be read, and each such tree is drawn as a tree of its own\. The four hues of the figure were checked for separation under the common forms of colour blindness\.
The counts of the four panels are over all the runs of a panel, landed or not\. Panel a, the coding runs of Task A, holds 354 runs, of which 310 landed, on 151 different paths that end on 128 different trees; the five commonest end trees hold 138, 42, 16, 15 and 6 runs, and 137 runs end on other trees\. Panel b, the coding runs of Task B, holds 411 runs, of which 360 landed, on 55 paths that end on 14 trees, with 233, 139, 27, 2 and 1 runs on the five commonest and 9 on other trees; seven of its runs go on beyond step 6, to between 9 and 65 changes, and are drawn to step 6\. Panel c, the uncoding runs of Task A, holds 357 runs, of which 343 landed, on 29 paths that end on 23 trees, with 323, 13, 1, 1 and 1 runs on the five commonest and 18 on other trees\. Panel d, the uncoding runs of Task B, holds 410 runs, all of which landed, on 13 paths that end on 4 trees, with 407 runs on one tree and one run on each of the other three\. The colours are assigned within a panel and carry no meaning across panels\.
### 4\.11 The map of visited states
The map of Fig\.[6](https://arxiv.org/html/2611.23375#S2.F6)uses 192 runs of the plain agent for each task, 24 coding and 24 uncoding at each of the Hinton temperatures 0\.1, 0\.5, 1 and 1\.5\. At 0\.1, 0\.5 and 1 these are the runs of the six cycle conditions, which are also among the runs of Table[8](https://arxiv.org/html/2611.23375#S6.T8)\(§[6](https://arxiv.org/html/2611.23375#S6)\)\. The temperature 1\.5 is not among its conditions\. A state is the starting tree together with the edits the run had made so far\. We read the edits from the run’s edit commands and rebuilt a file renamed through the shell as an edit; other changes made through the shell are not read, so a run that changed the code only in that way shows no movement on the map\. We described each edit by the counts of the node types of the Python syntax tree of the text it added, less those of the text it removed, kept for each file and hashed into 4,096 bins\. The descriptor of a state is the sum over its edits, with the signed square root taken of each bin\. We shifted the states of the uncoding runs by the mean end state of the landed coding runs, so the two directions share one map\.
The principal components were fitted to all states of a task\. The density is a Gaussian kernel estimate on the first two components\. The kernel has one covariance for both tasks, the mean of the two tasks’ covariance matrices multiplied byn−1/3n^\{\-1/3\}, wherennis the mean number of states of a task\. Each run has a total weight of one, and the starting state is not counted\. The map is the visit potential,Φ=−ln\(ρ/ρmax\)\\Phi=\-\\ln\(\\rho/\\rho\_\{\\max\}\), withρmax\\rho\_\{\\max\}the highest density of the two tasks\.
We chose three basins after seeing the map and assigned each repository state to one of them bykk\-means clustering with three centres on the two components\.ℳ1\\mathcal\{M\}\_\{1\}is the one that holds the start of the coding runs andℳ3\\mathcal\{M\}\_\{3\}the one in which most landed coding runs ended\. A run crossed them in order if it visited all three, ended in the last one of its direction and never moved to one it had left\. Of the 64 landed coding runs on Task A, 62 crossed them in order, and 66 of 67 did on Task B\. Of the landed uncoding runs, 70 of 74 on Task A and 83 of 83 on Task B crossed the same three in the opposite order\. The seven other landed runs stayed in one basin on the map, which reads a run’s edit commands and its renames and no other change of a file\. One run that did not land, of the 384, went back to an earlier basin\. No barrier height is read from the map\. We measured how long a landed run stayed in each basin\. The median stay in the first was 10 turns in coding and 7 in uncoding on Task A, and 5 and 4 on Task B\. The second was reached in the same turn as the third in every landed run, because the edits of the change come in one reply of the model\. The stay of 4 to 5 turns in the third is set by the rule that ends a run shortly after it reaches its goal\. No landed run returned to a basin that it had left\. The map reads only edits, so the turns in which a run reads or tests do not move it, and we did not measure a rate of jumps\.
Panels b and d of Fig\.[6](https://arxiv.org/html/2611.23375#S2.F6)drawℳ3\\mathcal\{M\}\_\{3\}on its own two principal components, fitted to the states that the coding runs visited inside it: 114 visits to 13 distinct states on Task A, and 100 visits to 7 distinct states on Task B\. The run drawn in panels a and b was inℳ2\\mathcal\{M\}\_\{2\}after one edit, stayed inℳ3\\mathcal\{M\}\_\{3\}from edit 2 to edit 7 and passed through six states there\. The run drawn in panels c and d enteredℳ3\\mathcal\{M\}\_\{3\}at edit 2 and passed through three states there before it landed at edit 4\. Each of the two is the landed run of its task with the most distinct states among those that never returned to an earlier basin\. Panels a and c use the same density scale\. We calculated the principal components separately for each task\.
### 4\.12 The thermometer
The daemon reads a verdict on each change, green or red and at most one bit, from a test suite that on a clean tree failsNNtests by its own noise\. Our harness readNNonce and set the gate’s threshold at three times that reading\. One reading is a number\. The instrument is the distribution ofNN, and a threshold is a quantile of that distribution with a stated false\-alarm rate\. Among trials that land, a defect survives a gate of false\-green probabilityPPwith probabilityPPand a clean trial passes with probability1−α1\-\\alpha, so with defect rateddbefore the gate the defect rate among survivors is
d′=dPdP\+\(1−d\)\(1−α\),d^\{\\prime\}=\\frac\{dP\}\{dP\+\(1\-d\)\(1\-\\alpha\)\},\(20\)a selection on landing of Berkson’s kind\[[65](https://arxiv.org/html/2611.23375#bib.bib65)\]: it vanishes asP→0P\\to 0and equalsddatP=1P=1andα=0\\alpha=0\.
##### The trials\.
We ran sixty trials with no model, twenty on each of three machines\. Each trial drew, with probability one half, a planted single\-site defect in one of six files that the gate reaches\. It also drew a gate: none, unit \(the file’s own tests\) or whole\. The whole gate passed a tree whose failure count did not exceed3N13N\_\{1\}, withN1N\_\{1\}from one clean run\.
##### The calibrated threshold\.
The calibrated threshold was the 95th percentile of a negative binomial distribution fitted to the failure counts of twelve consecutive clean runs on each of two machines, 23 and 10 failed tests\. The third machine had no such runs, and its threshold, 20 failed tests, came from one fit to the counts of the two machines pooled\. The dispersion of a count is its variance over its mean\. It is 1 for a Poisson count, which is what failures that are independent and equally likely in every run would give\. A likelihood\-ratio test rejected the Poisson distribution on both machines \(p<0\.0001p<0\.0001on each\), and we therefore fitted the negative binomial\. A defect was caught when its count exceeded the threshold\.
##### The defects that survived\.
Of the trials that landed, the share carrying a defect was 0\.40 with no gate \(8 of 20\), 0\.29 with the file’s own tests \(5 of 17\) and 0\.31 with the whole suite \(5 of 16\)\. With the realisedd=0\.40d=0\.40and the measuredPPof 5 in 8, Eq\.[20](https://arxiv.org/html/2611.23375#S4.E20)gives 0\.29\. The counts of failures on clean code were overdispersed on both machines, with variance over mean of 3\.4 and 4\.9, and the set of spuriously failing tests was still growing at the twelfth run\. The calibrated thresholds had a false\-alarm rate near 0\.05\. Under them, 6 of the 17 landed trials of the whole suite carried a defect, a share of 0\.35\.
##### Twelve further trials\.
We ran twelve further trials on the third machine with a defect in every trial, under a threshold of three times the median of three clean readings \(17, 3 and 1 failures\), 9 failed tests\. One trial never ran and eleven produced a failure count\. The sixty trials were judged under both thresholds\. The association between defect and gate among the 53 trials that landed under the one\-reading threshold is the Pearson correlation of defect, 0 or 1, with the gate ranked none, unit, whole\. It was−0\.08\-0\.08, with a 90 per cent bootstrap interval over trials of−0\.31\-0\.31to0\.150\.15\. Running the test suites for these trials took about thirty host\-hours\.
### 4\.13 The daemon’s mistake and the injected error
Maxwell’s daemon, reading one bit and acting on it, extracts at mostkBTln2k\_\{B\}T\\ln 2of work\[[23](https://arxiv.org/html/2611.23375#bib.bib23),[24](https://arxiv.org/html/2611.23375#bib.bib24),[25](https://arxiv.org/html/2611.23375#bib.bib25)\]; one that misreads with probabilityPPand acts as if certain loses work on every cycle oncePPpasses a threshold set by how far it acts\[[18](https://arxiv.org/html/2611.23375#bib.bib18),[26](https://arxiv.org/html/2611.23375#bib.bib26)\]\. In Fig\.[10](https://arxiv.org/html/2611.23375#S2.F10)a the confident daemon expands the gas to a fractionv=0\.9v=0\.9or0\.990\.99of the box as if its measurement were certain, and its work crosses zero atP=0\.27P=0\.27and0\.150\.15; the hedged daemon stops at1−P1\-P\. Our daemon serving green on a red tree makes the same mistake\. Letssbe the share of attempts that are truly red\. The information that a served verdict carries about the true one is the mutual information of a binary channel that flips its input with probabilityPP,
I\(s,P\)=h\(s\(1−P\)\+\(1−s\)P\)−h\(P\),I\(s,P\)=h\\bigl\(s\(1\-P\)\+\(1\-s\)P\\bigr\)\-h\(P\),\(21\)in bits, withhhthe binary entropy\. It is largest ats=1/2s=1/2, where it equals1−h\(P\)1\-h\(P\), and it reaches one bit only when in additionP=0P=0\. In our experimentssswas 0\.56 to 0\.63 on the toy system and 0\.42 to 0\.60 on the repository, so a served verdict carried at least 93 per cent of1−h\(P\)1\-h\(P\)at every injected error\.
#### 4\.13\.1 Error injection
A small program placed between the test suite and the agent flipped each served verdict with probabilityPPby a seeded draw and recorded the true verdict beside it, about 5\.6 verdicts a run; a false landing was a final grade served green whose true verdict was red\. The first system was the repository’s own cycle panel, 96 runs at each ofP=0,0\.05,0\.15,0\.30P=0,0\.05,0\.15,0\.30\. The second was a toy with a hidden defect in a file the visible tests never touch, graded by a hidden test the agent never sees, 21, 17, 23 and 27 landings at the four rates, of which 0, 1, 6 and 14 were false\. We did not measure the cost of a repair on the toy, so we give its gate no temperature\. The third was the cycle panel again with a one\-line defect from a fixed list planted by seed, atP=0\.01,0\.02,0\.05,0\.10,0\.15,0\.20,0\.30P=0\.01,0\.02,0\.05,0\.10,0\.15,0\.20,0\.30, the full suite on the reduced repository as the gate\. Every served and true verdict was recorded\. Each condition held 48 runs with the defect planted in half and 72 further planted runs under a second seed, six to eight runs at a time on each machine\.
#### 4\.13\.2 Unjudgeable runs
We classified runs as unjudged when the limit on turns, a wall\-time limit, an undecodable tree or a provider error prevented us from reading the true verdict\. This happened in 119 of the 669 planted runs: 79 of the 477 in the five conditions from 0\.05 up, and 40 of the 192 in the two conditions at 0\.01 and 0\.02\. Each of the seven conditions was planned with 96 planted runs, 672 in all, and three of them are absent from our records, which leaves 669\. Refusals by the provider cut short 56 runs, and five more failed for local reasons\. We repeated all 61 under the same plan and seed and excluded the interrupted attempts\. An unjudged run counts among the planted runs and enters no false\-landing rate\. We flagged runs when the host logs showed that load exceeded the number of cores or that the memory limit had killed a process\. We analysed the results with and without the flagged runs\.
#### 4\.13\.3 False\-landing rates
A green is served either because a true green was left alone or because a true red was flipped, so the false\-landing rate among landings is
Pfalse=sP\(1−s\)\(1−P\)\+sP,P\_\{\\rm false\}=\\frac\{sP\}\{\(1\-s\)\(1\-P\)\+sP\},\(22\)which exceedsPPexactly whens\>1/2s\>1/2, in a model of one verdict per run\. A run of the experiment saw about 5\.6 verdicts, so we use the equation as a guide and set it beside the counts in Supplementary Note 2\. The false\-landing rate per condition is the false landings over the judged planted runs whose final grade was served green, the quantity of Eq\.[22](https://arxiv.org/html/2611.23375#S4.E22)\. Its slope againstPPis the least\-squares slope over the seven conditions\. The interval of the slope is a bootstrap of 4,000 draws that resamples the judged runs within each condition\. The slope estimates how much the broken share of the landed changes grows per unit of injected error\.
On the first system the tokens spent per true landing rose from 1,712 atP=0P=0to 2,355 atP=0\.30P=0\.30\. On the repository the false\-landing rate was 1 of 37, 0 of 34, 1 of 39, 4 of 35, 5 of 39, 9 of 35 and 14 of 50 landings, or 0\.03, 0, 0\.03, 0\.11, 0\.13, 0\.26 and 0\.28, at the seven errors\. The Wilson 90 per cent interval of each rate contains the error of its condition\. The slope of the rate against the error, which we take as the gate’s response, is 1\.03 false landings per unit error over the seven conditions \(90 per cent bootstrap interval\[0\.70,1\.36\]\[0\.70,1\.36\]over runs within conditions\), and 1\.04\[0\.56,1\.50\]\[0\.56,1\.50\]over the five conditions from 0\.05 up\. Setting aside the runs that carried a load or memory flag leaves 5 to 12 landings a condition and rates of 1 of 9, 0 of 8, 1 of 8, 0 of 8, 1 of 5, 5 of 12 and 5 of 10, rising overall, at sample sizes that fix no slope\.
#### 4\.13\.4 Gate temperature
##### Definition\.
In physics, a system at a temperatureTTmakes a fluctuation that costs an energyΔ\\Deltawith probabilitye−Δ/kBTe^\{\-\\Delta/k\_\{B\}T\}\. The hotter the system, the more often the fluctuation happens\. We read the gate in the same way\. Its fluctuation is a false landing: a broken change that the gate lets through\. The costΔ\\Deltais the number of tokens that it takes to repair that change\. We takePfalseP\_\{\\rm false\}to be the share of the landed changes that are broken, we setPfalse=e−βgateΔP\_\{\\rm false\}=e^\{\-\\beta\_\{\\rm gate\}\\Delta\}, and we call1/βgate1/\\beta\_\{\\rm gate\}the temperature of the gate\. A gate that rarely lets a broken change land is cold, and a gate that often does is hot\.
We chose this share because it answers the question of a developer who is about to trust a landed change: how likely is it to be broken? The answer depends on the gate, and also on how many of the attempts that reach the gate are broken\. One could ask instead what share of the broken changes land, which is a different number and gives a different temperature\. We use the first share everywhere in this article\. The cost of a repair,Δ\\Delta, is counted as the cost of a run is: every output token that the run generated up to the turn of the repair\.
##### Cost of a repair\.
We measuredΔ\\Deltaon the third system with 36 repair runs over ten planted defects, three runs on each of eight defects and six on each of the other two\. For each run, the experiment’s grader evaluated the saved trees in editing order until the first green verdict\. Two controls came first: an untouched planted tree read red, and a tree with the plant reverted read green at the first turn\.Δ\\Deltais the median of the output tokens spent up to the turn of the first green\. All 36 repairs reached green, at a median of 1,056 output tokens \(90 per cent interval 913 to 1,225\), and the first edit was the fix in 35 of them\. Runs on one defect are not independent, so the interval is a two\-stage bootstrap of 4,000 draws, which resamples the ten defects and then the runs of each drawn defect\.
##### Limits of the definition\.
A condition with no false landing has no temperature\. A condition ofnnlandings cannot show a temperature between zero andΔ/lnn\\Delta/\\ln n, the value that a single false landing gives\.
##### Temperatures and their intervals\.
The temperature of the gate was 487, 514, 778 and 830 tokens a nat at errors of 0\.10, 0\.15, 0\.20 and 0\.30, with 90 per cent intervals of 302 to 698, 335 to 731, 531 to 1,133 and 594 to 1,146\. With the other share of the Definition, the broken changes that land, the temperature at an error of 0\.30 would be about 1,150 tokens a nat \(14 of the 35 broken changes landed\) in place of 830 \(14 of the 50 landed changes were broken\)\. Each interval resamples the repair runs in the two stages above, together with the judged planted runs of the condition\. A draw with no false landing has no temperature, and we counted it as zero\. Such draws were under 2 per cent of the draws at the errors from 0\.10 up and 37 per cent at 0\.05, and for that condition we therefore give the 95th percentile of the draws as an upper limit\. At 0\.05 one false landing among 39 gives 288 tokens a nat, the lowest temperature that a condition of that size can show\. At 0\.01 one false landing among 37 gives 292 tokens a nat in the same way, and the condition at 0\.02 had no false landing and therefore no temperature\.
##### Comparison with the model\.
We compared the gate with the cost form of the model’s temperature and not with the work form, because we did not separate the tokens of a repair into work and heat\. By Clausius’s version of the second law \(§[1](https://arxiv.org/html/2611.23375#S1)\), a gate hotter than the model cannot serve as the cold side of the two\-reservoir reading\.
#### 4\.13\.5 Estimating the gain
##### Definition\.
The gain of serving a verdict at errorPPis the work a true green is worth less the work a false landing destroys, each weighted by the injected error,
G\(P\)=\(1−P\)Wtrue\(0\)−PD\(P\),G\(P\)=\(1\-P\)\\,W\_\{\\rm true\}\(0\)\-P\\,D\(P\),\(23\)withWtrue\(0\)W\_\{\\rm true\}\(0\)the mean number of output tokens per true landing atP=0P=0on the toy system, taken as the worth of a green, andD\(P\)D\(P\)what a false landing destroys: the mean cost of the runs that falsely landed atPP, plus the worth of the green that each of them stands in for\. Both are in tokens\. The error at whichGGcrosses zero is where the gate stops paying for itself\.
##### Gain at three errors\.
The gain was 798, 573 and 253 tokens at errors of 0\.05, 0\.15 and 0\.30\. A straight extrapolation puts a crossing of zero near 0\.42, a value we do not rely on\. Weighting byPPmakes the gain a score\. We did not measure the return directly\.
##### Weighting by the measured rate\.
Weighting by the measuredPfalseP\_\{\\rm false\}instead ofPPlowersGGwhereverPfalse\>PP\_\{\\rm false\}\>P\. Re\-weighting by the measuredPfalseP\_\{\\rm false\}in place ofPP, a sensitivity analysis on the same records \(90 per cent bootstrap over runs\), gives\+779\+779\[\+512,\+1136\]\[\+512,\+1136\],\+330\+330\[−20,\+714\]\[\-20,\+714\]and−221\-221\[−584,\+133\]\[\-584,\+133\]tokens at the three errors\. At 0\.30 the point estimate is negative, with 85 per cent of draws below zero and an interval that includes zero, so the second weighting does not establish a crossing either\.
### 4\.14 Symmetry rule and controls
We call a condition symmetric when the interval of its asymmetry lies inside the margin, and otherwise report whether the interval excludes zero\. Each experiment carried a model\-free positive control, a planted defect the gate had to catch or a planted mutant the set had to grade red, and the free\-energy script carried the planted controls described above\. The model calls of the experiments of this letter cost about 515 US dollars, over 2,880 priced runs\. This is a lower bound, because some stages recorded no cost for the runs that ended in an error\.
### 4\.15 Data and code availability
The analysis scripts, the figure scripts and the timed analysis records will be released with this article, once the text of the private repository that the records carry \(names of test files, labels of edits and names of hosts\) has been removed from them\. The records give one row per run, with its task, direction, Hinton temperature, set, outcome and number of turns, the tokens generated at each turn and the tokens read in the run\. They suffice to repeat the division into work and heat, the free energies, the dispersion of the costs, their quantiles and the test of time order\. They do not hold what the map, the loops, the paths, the rates of the gate and the cost of a repair require, which are the edits, the commands, the identifiers of the trees and the verdicts of the gate\. The code of the harness and the transcripts of the runs are not released, because the harness and the repository on which the agents worked belong to a private development repository\. No text from them appears in this article\. In follow\-up work we will repeat the measurements on a public benchmark\.
## \\materiaDisplay5\\materiaDisplayConclusions, outlook and practical recommendations for harness optimization
Table 4:Where the tokens go: five questions and the answers of this letter\. The last column gives the section of the Results that holds the evidence\.Table[4](https://arxiv.org/html/2611.23375#S5.T4)collects the conclusions of this letter as five questions and their answers\.
In this work, we showed that the token records of a coding agent can be read as an experimentalist reads the work records of a single molecule that is pulled open and let fold again\. A change to a repository has a free energy, the least that it can cost, and most of the tokens that a run spends above it are heat\. Coding costs more than uncoding, and most of what an agent spends is heat\. The test suite that judges a change is a measuring instrument, with noise and with errors that have a cost of their own\. Thermodynamics therefore gives agentic coding a common unit, the token, and a floor against which a harness can be compared\.
By building the simplest harness that we could, we allowed ourselves to explore the raw thermodynamic behaviour of agentic coding\. Our analysis therefore found a behaviour that we were not looking for originally: the cost of the runs had a long tail\. To treat that tail, we had to decide how to count the runs that never landed, which in turn led us to introduce the VIVA, CORTA and LOCA approximations\. By then inspecting the traces of those runs, we found that cold agents repeat themselves until the limit on turns stops them \(§[2\.4](https://arxiv.org/html/2611.23375#S2.SS4)\)\. Afterwards, by bibliographic search, we found that loops of this kind are known and that several production harnesses already guard against them\[[3](https://arxiv.org/html/2611.23375#bib.bib3),[44](https://arxiv.org/html/2611.23375#bib.bib44),[45](https://arxiv.org/html/2611.23375#bib.bib45)\]\. Our list of citations here is not exhaustive\. Very likely, those guards were found heuristically, by humans who inspected the trajectories, found the loops and developed heuristic algorithms to stop them\. The thermodynamic analysis led us to the same fault without previous knowledge of that work\. In addition, with the proper statistics we can state what this fault costs in heat, which identifies it as perhaps one of the biggest issues of agentic coding\. In our experiment, the limit of 300 turns stopped 78 of the 1,200 runs, and those 78 runs generated 66 per cent of all the tokens, most of it, if not all, heat \(§[4\.4](https://arxiv.org/html/2611.23375#S4.SS4)\)\.
### 5\.1 Practical recommendations
Our analysis suggests six practical recommendations, R1 to R6, for optimizing a harness:
##### R1\. Avoid sampling the model cold\.
A cold agent repeats itself, and a run caught in a loop spends tokens without changing the code\. Which temperature is best we cannot say from one model and two tasks \(§[2\.4](https://arxiv.org/html/2611.23375#S2.SS4), §[2\.5\.6](https://arxiv.org/html/2611.23375#S2.SS5.SSS6), §[4\.4](https://arxiv.org/html/2611.23375#S4.SS4)\)\.
What does thermodynamics say about this?A system that sits in a metastable state leaves it only by a fluctuation, and Arrhenius and Kramers showed that the rate of escape falls exponentially as the temperature falls\[[66](https://arxiv.org/html/2611.23375#bib.bib66),[67](https://arxiv.org/html/2611.23375#bib.bib67)\]\. The Hinton temperature sets the size of the fluctuations in what the model writes\. A cold model gives its most likely reply every time, so a reply that left the repository unchanged is followed by the same reply\. The agent then behaves like a liquid cooled into a glass: it has not reached its goal, and it no longer moves\. We measured no barrier and no rate of escape in the agent\. The analogy is with the role that temperature plays in an escape; the Hinton temperature is a setting of the sampler, and it is a different quantity from the software temperature\.
##### R2\. Get a stuck agent unstuck\.
Detect loops, and stop or restart the run\. In the theory of stochastic resetting, a restart lowers the mean time to completion when the standard deviation of that time exceeds its mean, for a process that begins afresh at each restart\[[68](https://arxiv.org/html/2611.23375#bib.bib68),[69](https://arxiv.org/html/2611.23375#bib.bib69),[70](https://arxiv.org/html/2611.23375#bib.bib70)\]\. Our stored runs show what a shorter limit on turns would have kept\. A restart or a hint changes what the agent does next, and each needs its own experiment\. Choose the limit on turns from the turn at which successful runs finish \(§[2\.4](https://arxiv.org/html/2611.23375#S2.SS4), §[2\.5\.6](https://arxiv.org/html/2611.23375#S2.SS5.SSS6), §[4\.4](https://arxiv.org/html/2611.23375#S4.SS4)\)\.
What does thermodynamics say about this?A run caught in a loop resembles a system held in a metastable state\. Its tokens keep flowing and the repository does not change, so by our definition all of them are heat\. Waiting for a fluctuation to free the run costs heat for as long as the wait lasts\. Statistical physics offers two cheaper remedies\. The first is to reset: when the time to completion varies by more than its mean, starting again shortens the mean time\[[69](https://arxiv.org/html/2611.23375#bib.bib69),[70](https://arxiv.org/html/2611.23375#bib.bib70)\]\. The second is information\. Szilard showed that one bit about the state of a system is worth work\[[23](https://arxiv.org/html/2611.23375#bib.bib23)\], and an agent in a loop receives the same output at every call, which brings it no new bit\.
##### R3\. Report the cost of every run as work and heat\.
Include the failed runs, which are the most expensive\. Heat is the largest part of the cost of a landed run, and a harness can lower it by telling the agent what it would otherwise have to discover \(§[2\.1\.3](https://arxiv.org/html/2611.23375#S2.SS1.SSS3), §[2\.2](https://arxiv.org/html/2611.23375#S2.SS2), §[3](https://arxiv.org/html/2611.23375#S3)\)\.
What does thermodynamics say about this?The first law divides the energy that a system receives into work and heat\. Our bookkeeping divides the tokens by what a turn does: the tokens of a turn that makes the requested edits are work, and all the others are heat\. The second law sets the least work that a change requires, which is its free energy, and everything spent above it is dissipated\. A single total of tokens hides this division, as the fuel bill of an engine hides its efficiency\. A run that fails leaves no change that is kept, so nearly all of its tokens are heat\.
##### R4\. Treat the test suite as an instrument\.
Measure its noise on clean code and repair the tests that fail there\. A larger suite is not necessarily a better gate \(§[2\.6](https://arxiv.org/html/2611.23375#S2.SS6), §[4\.12](https://arxiv.org/html/2611.23375#S4.SS12)\)\.
What does thermodynamics say about this?A thermometer whose reading jumps from one moment to the next tells a physician little about the patient\. The test suite is the instrument through which the daemon looks at each change, and Sagawa and Ueda showed that a daemon can gain no more work than its measurement gives it in information\[[18](https://arxiv.org/html/2611.23375#bib.bib18)\]\. We use their result as an analogy, since we measured no work that a gate extracts\. An experimentalist calibrates such an instrument before trusting it: she reads it many times on a sample whose answer she knows, and learns how much it fluctuates\. For a test suite, the sample with a known answer is clean code\.
##### R5\. Make the gate more reliable as the task gets harder\.
When most attempts fail, the broken changes that land outnumber what the gate’s error rate alone would suggest \(§[2\.7](https://arxiv.org/html/2611.23375#S2.SS7), §[4\.13](https://arxiv.org/html/2611.23375#S4.SS13)\)\.
What does thermodynamics say about this?Clausius’s version of the second law says that heat does not pass by itself from a colder body to a hotter one\[[15](https://arxiv.org/html/2611.23375#bib.bib15),[16](https://arxiv.org/html/2611.23375#bib.bib16)\]\. In our reading the gate is the cold side\. It takes out of the repository the disorder that the agent puts in, as a refrigerator takes heat out of what it holds\. A gate that errs is warmer, and a gate warmer than the agent works like a refrigerator that heats: it lets disorder in\. The harder the task, the more broken attempts arrive at the gate, and the colder the gate has to be to keep them out\. This is an analogy\. We compared two scales in tokens, and we did not measure a flow of entropy \(§[2\.7](https://arxiv.org/html/2611.23375#S2.SS7)\)\.
##### R6\. Benchmark a harness with a cycle of coding and uncoding\.
Its start and end states are known, and every token that it spends is lost \(§[2\.1\.4](https://arxiv.org/html/2611.23375#S2.SS1.SSS4), §[2\.2](https://arxiv.org/html/2611.23375#S2.SS2), §[2\.3](https://arxiv.org/html/2611.23375#S2.SS3)\)\.
What does thermodynamics say about this?A cycle returns the system to the state in which it began\. Energy and free energy are functions of the state, so their change over a cycle is zero, and everything that the cycle spent has been dissipated\[[71](https://arxiv.org/html/2611.23375#bib.bib71)\]\. When a molecule is pulled open and let fold again, the two curves of force against extension enclose a loop, and the area of that loop is the work that was lost\[[4](https://arxiv.org/html/2611.23375#bib.bib4)\]\. Our cycle has no such curve to draw, so we measure the same loss by subtraction: the work that coding costs, minus the work that uncoding gives back\. A benchmark that scores whether a task was solved records the end state and nothing about the path\. A cycle of coding and uncoding measures the dissipation of a harness directly, without an estimate of the free energy\.
### 5\.2 Outlook
##### One kind of change\.
These recommendations rest on one kind of change\. The software change that we employed is similar to the hairpin of the pulling experiments \(§[1](https://arxiv.org/html/2611.23375#S1)\) in the sense that the inherent structure of the code does not change very much\. What we did in each task was rename a module that stays in place within the large codebase\. Therefore, our system has two well\-defined states, and it also does not add anything new logically to the repository\.
##### Larger changes\.
In future work, we will explore more complex scenarios where coding and uncoding will lead to large transformations in the source code, and then the cycle will no longer be a comparison between two similar states\. We expect the free energy of such changes to be a larger share of their cost, and the faults that we will find will be harder for a test suite to detect\.
##### Memory and swarms\.
We are also extending this analysis to agents with memory systems and to swarms of agents that work on the same repository\. A memory acts as a second daemon, which selects what the agent reads before it acts, and a swarm shares one gate among many agents\. We expect the same bookkeeping of work, heat and error to apply to both\. Repeating the measurements with other models and harnesses will show how general these recommendations are\.
## Acknowledgements
During their adventures in vibe coding, A\.A\.\-G\. and V\.B\. started to discuss the thermodynamic implications of coding: in other words, how many tokens were lost\. A\.A\.\-G\. was inspired by talks of Christopher Jarzynski that he had heard as a graduate student at the University of California, Berkeley, and again recently as a professor at the University of Toronto\. A long period of research followed, with discussions between A\.A\.\-G\., V\.B\. and the swarm, about sixteen research and coding agents, each named after a famous Mexican wrestler\. The agents were a mix of Claude Code, Codex and ZCode coding agents\. A\.A\.\-G\. and V\.B\. thank Anders G\. Frøseth for his generous support\. The design of this paper is inspired by Latin American colours, in particular those of the architect Luis Barragán\. The Maxwell’s daemons in this article were drawn by Codex in dialogue with the authors and Claude, in a style inspired by the cartoons of Quino, the renowned Latin American cartoonist and creator of Mafalda\. The typefaces are by Latin American designers: Chivo and Archivo by Héctor Gatti, Faustina by Alfonso García and Bitter by Sol Matas, released under the SIL Open Font License\.
## Funding
This work was supported by the Defense Advanced Research Projects Agency \(DARPA\) under Agreement No\. HR0011262E022\. This work was also supported by the AI2050 program of Schmidt Sciences\. A\.A\.\-G\. and V\.B\. acknowledge the generous support of the University of Toronto’s Acceleration Consortium, which receives funding from the CFREF\-2022\-00042 Canada First Research Excellence Fund\.
## References
- \[1\]DORA\.2025 DORA state of AI\-assisted software development report\.Technical report, Google Cloud, 2025\.Version 2025\.2\.
- \[2\]Stack Overflow\.2025 developer survey\.[https://survey\.stackoverflow\.co/2025/](https://survey.stackoverflow.co/2025/), 2025\.Accessed 14 November 2026\.
- \[3\]John Yang, Carlos E\. Jimenez, Alexander Wettig, Kilian Lieret, Shunyu Yao, Karthik Narasimhan, and Ofir Press\.SWE\-agent: Agent\-computer interfaces enable automated software engineering\.InAdvances in Neural Information Processing Systems 37 \(NeurIPS 2024\), pages 50528–50652, 2024\.arXiv:2405\.15793, v3 of 11 November 2024\.
- \[4\]D\. Collin, F\. Ritort, C\. Jarzynski, S\. B\. Smith, I\. Tinoco, Jr\., and C\. Bustamante\.Verification of the Crooks fluctuation theorem and recovery of RNA folding free energies\.Nature, 437:231–234, 2005\.
- \[5\]David H\. Ackley, Geoffrey E\. Hinton, and Terrence J\. Sejnowski\.A learning algorithm for Boltzmann machines\.Cognitive Science, 9\(1\):147–169, 1985\.
- \[6\]John G\. Kirkwood\.Statistical mechanics of fluid mixtures\.The Journal of Chemical Physics, 3:300–313, 1935\.
- \[7\]Mark I\. Freidlin and Alexander D\. Wentzell\.Random Perturbations of Dynamical Systems\.Grundlehren der mathematischen Wissenschaften\. Springer, 1984\.
- \[8\]Jin Wang, Li Xu, and Erkang Wang\.Potential landscape and flux framework of nonequilibrium networks: Robustness, dissipation, and coherence of biochemical oscillations\.Proceedings of the National Academy of Sciences, 105:12271–12276, 2008\.
- \[9\]Frank H\. Stillinger and Thomas A\. Weber\.Hidden structure in liquids\.Physical Review A, 25\(2\):978–989, 1982\.
- \[10\]Jan\-Hendrik Prinz, Hao Wu, Marco Sarich, Bettina Keller, Martin Senne, Martin Held, John D\. Chodera, Christof Schütte, and Frank Noé\.Markov models of molecular kinetics: Generation and validation\.The Journal of Chemical Physics, 134\(17\):174105, 2011\.
- \[11\]Jan Liphardt, Sophie Dumont, Steven B\. Smith, Ignacio Tinoco, Jr\., and Carlos Bustamante\.Equilibrium information from nonequilibrium measurements in an experimental test of Jarzynski’s equality\.Science, 296:1832–1835, 2002\.
- \[12\]C\. Jarzynski\.Nonequilibrium equality for free energy differences\.Physical Review Letters, 78\(14\):2690–2693, 1997\.
- \[13\]Gavin E\. Crooks\.Entropy production fluctuation theorem and the nonequilibrium work relation for free energy differences\.Physical Review E, 60\(3\):2721–2726, 1999\.
- \[14\]Roald Hoffmann\.How chemistry and physics meet in the solid state\.Angewandte Chemie International Edition in English, 26\(9\):846–878, 1987\.
- \[15\]R\. Clausius\.Ueber eine veränderte form des zweiten hauptsatzes der mechanischen wärmetheorie\.Annalen der Physik und Chemie, 93:481–506, 1854\.
- \[16\]R\. Clausius\.On a modified form of the second fundamental theorem in the mechanical theory of heat\.Philosophical Magazine, Series 4, 12:81–98, 1856\.
- \[17\]J\. M\. R\. Parrondo and P\. Español\.Criticism of Feynman’s analysis of the ratchet as an engine\.American Journal of Physics, 1996\.
- \[18\]Takahiro Sagawa and Masahito Ueda\.Generalized jarzynski equality under nonequilibrium feedback control\.Physical Review Letters, 104\(9\):090602, 2010\.
- \[19\]Ken Sekimoto\.Langevin equation and thermodynamics\.Progress of Theoretical Physics Supplement, 1998\.
- \[20\]Udo Seifert\.Stochastic thermodynamics, fluctuation theorems and molecular machines\.Reports on Progress in Physics, 75:126001, 2012\.
- \[21\]James Clerk Maxwell\.Theory of Heat\.Longmans, Green, and Co\., London, 1871\.Chapter XXII, “Limitation of the second law of thermodynamics”\.
- \[22\]Jimena Canales\.Bedeviled: A Shadow History of Demons in Science\.Princeton University Press, 2020\.
- \[23\]Leo Szilard\.Über die entropieverminderung in einem thermodynamischen system bei eingriffen intelligenter wesen\.Zeitschrift für Physik, 53:840–856, 1929\.
- \[24\]R\. Landauer\.Irreversibility and heat generation in the computing process\.IBM Journal of Research and Development, 5\(3\):183–191, 1961\.
- \[25\]Charles H\. Bennett\.The thermodynamics of computation—a review\.International Journal of Theoretical Physics, 21\(12\):905–940, 1982\.
- \[26\]Jordan M\. Horowitz and Juan M\. R\. Parrondo\.Thermodynamic reversibility in feedback processes\.EPL \(Europhysics Letters\), 95\(1\):10005, June 2011\.
- \[27\]Juan M\. R\. Parrondo, Jordan M\. Horowitz, and Takahiro Sagawa\.Thermodynamics of information\.Nature Physics, 11\(2\):131–139, 2015\.
- \[28\]J\. Gore, F\. Ritort, and C\. Bustamante\.Bias and error in estimates of equilibrium free\-energy differences from nonequilibrium measurements\.Proceedings of the National Academy of Sciences, 100:12564–12569, 2003\.
- \[29\]A\. Alemany, A\. Mossa, I\. Junier, and F\. Ritort\.Experimental free\-energy measurements of kinetic molecular states using fluctuation theorems\.Nature Physics, 8:688–694, 2012\.
- \[30\]Andre C\. Barato and Udo Seifert\.Thermodynamic uncertainty relation for biomolecular processes\.Physical Review Letters, 114\(15\):158101, April 2015\.
- \[31\]T\. R\. Gingrich and J\. M\. Horowitz\.Fundamental bounds on first passage time fluctuations for currents\.Physical Review Letters, 119:170601, 2017\.
- \[32\]A\. Pal, S\. Reuveni, and S\. Rahav\.Thermodynamic uncertainty relation for first\-passage times on Markov chains\.Physical Review Research, 3:L032034, 2021\.
- \[33\]Ahmed E\. Hassan\.Predicting faults using the complexity of code changes\.In2009 IEEE 31st International Conference on Software Engineering, pages 78–88\. IEEE, 2009\.
- \[34\]Jerónimo Fotinós and Juan B\. Cabral\.Software entropy: A statistical mechanics framework for software testing, 2026\.arXiv:2603\.20528, 2026\-03\-20\.
- \[35\]Ilya Prigogine\.Time, structure, and fluctuations\.Science, 201\(4358\):777–785, 1978\.Nobel lecture, 8 December 1977\.
- \[36\]J\. M\. R\. Parrondo, C\. Van den Broeck, and R\. Kawai\.Entropy production and the arrow of time\.New Journal of Physics, 2009\.
- \[37\]É\. Roldán and J\. M\. R\. Parrondo\.Entropy production and Kullback\-Leibler divergence between stationary trajectories of discrete systems\.Physical Review E, 85:031129, 2012\.
- \[38\]B\. J\. Alder and T\. E\. Wainwright\.Phase transition for a hard sphere system\.The Journal of Chemical Physics, 27\(5\):1208–1209, 1957\.
- \[39\]B\. J\. Alder and T\. E\. Wainwright\.Studies in molecular dynamics\. I\. general method\.The Journal of Chemical Physics, 31\(2\):459–466, 1959\.
- \[40\]Mario Krenn, Robert Pollice, Si Yue Guo, Matteo Aldeghi, Alba Cervera\-Lierta, Pascal Friederich, Gabriel dos Passos Gomes, Florian Häse, Adrian Jinich, AkshatKumar Nigam, Zhenpeng Yao, and Alán Aspuru\-Guzik\.On scientific understanding with artificial intelligence\.Nature Reviews Physics, 4\(12\):761–769, 2022\.
- \[41\]Zijian Zhang, Jiaru Bai, Yuma Nakamura, Andrew Wang, Shi Xuan Leong, Sam Zhang, Pan Chen, Alston Lo, Marcel Müller, Gary Tom, Marko Huang, Luis Mantilla, Yeonghun Kang, Varinia Bernales, and Alán Aspuru\-Guzik\.Molecular knowledge representations in the era of artificial intelligence\.ChemRxiv, 2026\.
- \[42\]Ari Holtzman, Jan Buys, Li Du, Maxwell Forbes, and Yejin Choi\.The curious case of neural text degeneration\.InInternational Conference on Learning Representations, 2020\.
- \[43\]Jin Xu, Xiaojiang Liu, Jianhao Yan, Deng Cai, Huayang Li, and Jian Li\.Learning to break the loop: Analyzing and mitigating repetitions for neural text generation\.InAdvances in Neural Information Processing Systems, 2022\.
- \[44\]John Yang, Kilian Lieret, Carlos E\. Jimenez, Alexander Wettig, Kabir Khandpur, Yanzhe Zhang, Binyuan Hui, Ofir Press, Ludwig Schmidt, and Diyi Yang\.SWE\-smith: Scaling data for software engineering agents, 2025\.
- \[45\]OpenHands\.Stuck detector\.Software documentation, 2026\.Accessed 16 November 2026\.
- \[46\]James Prescott Joule\.On the mechanical equivalent of heat\.Philosophical Transactions of the Royal Society of London, 140:61–82, 1850\.
- \[47\]C\. Jarzynski\.Rare events and the convergence of exponentially averaged work values\.Physical Review E, 2006\.
- \[48\]Piero Procacci\.Unbiased free energy estimates in fast nonequilibrium transformations using Gaussian mixtures\.The Journal of Chemical Physics, 142:154117, 2015\.
- \[49\]Charles H\. Bennett\.Efficient estimation of free energy differences from Monte Carlo data\.Journal of Computational Physics, 22\(2\):245–268, 1976\.
- \[50\]Matteo Palassini and Felix Ritort\.Improving Free\-Energy Estimates from Unidirectional Work Measurements: Theory and Experiment\.Physical Review Letters, 107:060601, 2011\.
- \[51\]David Aldous and Larry Shepp\.The least variable phase type distribution is Erlang\.Communications in Statistics\. Stochastic Models, 3\(3\):467–473, 1987\.
- \[52\]RTI\.The economic impacts of inadequate infrastructure for software testing\.Technical Report Planning Report 02\-3, National Institute of Standards and Technology, 2002\.
- \[53\]Herb Krasner\.The cost of poor software quality in the US: A 2022 report\.Technical report, Consortium for Information and Software Quality, 2022\.
- \[54\]World Health Organization\.Global Spending on Health: Coping with the Pandemic\.World Health Organization, Geneva, 2023\.
- \[55\]Cefic\.Facts and figures of the European chemical industry\.European Chemical Industry Council, 2025\.Accessed 16 November 2026\.
- \[56\]World Bank\.World development indicators: GDP and agriculture, forestry, and fishing, value added \(current US$\)\.Data series NY\.GDP\.MKTP\.CD and NV\.AGR\.TOTL\.CD, 2026\.Accessed 16 November 2026\.
- \[57\]US Securities and Exchange Commission\.In the matter of Knight Capital Americas LLC: Order instituting administrative and cease\-and\-desist proceedings\.Securities Exchange Act of 1934 Release No\. 70694, 2013\.
- \[58\]Parametrix\.CrowdStrike to cost Fortune 500 $5\.4b; insured loss range of $0\.54b–$1\.08b\.Press release, 24 July, 2024\.Accessed 16 November 2026\.
- \[59\]Richard Fang, Rohan Bindu, Akul Gupta, and Daniel Kang\.LLM agents can autonomously exploit one\-day vulnerabilities, 2024\.
- \[60\]Nicholas Carlini, Newton Cheng, Keane Lucas, Michael Moore, Milad Nasr, Vinay Prabhushankar, Winnie Xiao, et al\.Assessing Claude Mythos Preview’s cybersecurity capabilities\.Anthropic Frontier Red Team, 2026\.
- \[61\]Qingzhou Luo, Farah Hariri, Lamyaa Eloussi, and Darko Marinov\.An empirical analysis of flaky tests\.InProceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering, pages 643–653, 2014\.
- \[62\]Carlos E\. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, and Karthik Narasimhan\.SWE\-bench: Can language models resolve real\-world GitHub issues?, 2023\.
- \[63\]Siddharth Samsi, Dan Zhao, Joseph McDonald, Baolin Li, Adam Michaleas, Michael Jones, William Bergeron, Jeremy Kepner, Devesh Tiwari, and Vijay Gadepally\.From words to watts: Benchmarking the energy costs of large language model inference, 2023\.
- \[64\]Liam Paninski\.Estimation of entropy and mutual information\.Neural Computation, 15\(6\):1191–1253, 2003\.
- \[65\]Joseph Berkson\.Limitations of the application of fourfold table analysis to hospital data\.Biometrics Bulletin, 2\(3\):47–53, June 1946\.
- \[66\]Svante Arrhenius\.Über die reaktionsgeschwindigkeit bei der inversion von rohrzucker durch säuren\.Zeitschrift für Physikalische Chemie, 4:226–248, 1889\.
- \[67\]H\. A\. Kramers\.Brownian motion in a field of force and the diffusion model of chemical reactions\.Physica, 1940\.
- \[68\]Michael Luby, Alistair Sinclair, and David Zuckerman\.Optimal speedup of Las Vegas algorithms\.Information Processing Letters, 47:173–180, 1993\.
- \[69\]Martin R\. Evans and Satya N\. Majumdar\.Diffusion with stochastic resetting\.Physical Review Letters, 106:160601, 2011\.
- \[70\]Shlomi Reuveni\.Optimal stochastic restart renders fluctuations in first passage times universal\.Physical Review Letters, 116:170601, 2016\.
- \[71\]R\. Clausius\.Ueber verschiedene für die anwendung bequeme formen der hauptgleichungen der mechanischen wärmetheorie\.Annalen der Physik, 1865\.
## \\materiaDisplay6\\materiaDisplaySupplementary Information and Extended Data
### Supplementary Note 1: the run\-length null for the cycle temperature
The cycle temperature has a null under which it reads only how the lengths of runs scatter\. Let a run takennturns, and let each turn costmmtokens on average, with varianceσm2\\sigma\_\{m\}^\{2\}, independently of the other turns and ofnn\. The costCCof the run is then a sum of a random number of terms, with meanm⟨n⟩m\\langle n\\rangleand variance⟨n⟩σm2\+m2var\(n\)\\langle n\\rangle\\sigma\_\{m\}^\{2\}\+m^\{2\}\\,\\mathrm\{var\}\(n\)\. For one direction the variance of the cost over twice its mean is
σC22⟨C⟩=mFn2\+σm22m,Fn=var\(n\)⟨n⟩\.\\frac\{\\sigma\_\{C\}^\{2\}\}\{2\\langle C\\rangle\}=\\frac\{mF\_\{n\}\}\{2\}\+\\frac\{\\sigma\_\{m\}^\{2\}\}\{2m\},\\qquad F\_\{n\}=\\frac\{\\mathrm\{var\}\(n\)\}\{\\langle n\\rangle\}\.The dispersionFnF\_\{n\}of the turn count is its variance divided by its mean, the Fano factor, which is one for a Poisson count\. Equation[19](https://arxiv.org/html/2611.23375#S4.E19)adds the variances of the two directions and adds their means\. The cycle temperature is therefore the average of the two directions’ ratios, each weighted by its direction’s share of the summed mean cost:
1βcyc=wFσC,F22⟨CF⟩\+wRσC,R22⟨CR⟩,\\frac\{1\}\{\\beta\_\{\\rm cyc\}\}=w\_\{F\}\\,\\frac\{\\sigma\_\{C,F\}^\{2\}\}\{2\\langle C\_\{F\}\\rangle\}\+w\_\{R\}\\,\\frac\{\\sigma\_\{C,R\}^\{2\}\}\{2\\langle C\_\{R\}\\rangle\},withwF=⟨CF⟩/\(⟨CF⟩\+⟨CR⟩\)w\_\{F\}=\\langle C\_\{F\}\\rangle/\(\\langle C\_\{F\}\\rangle\+\\langle C\_\{R\}\\rangle\)andwR=1−wFw\_\{R\}=1\-w\_\{F\}\. When the turns of a run cost about the same,σm2≪m2Fn\\sigma\_\{m\}^\{2\}\\ll m^\{2\}F\_\{n\}, each ratio ismFn/2mF\_\{n\}/2, and the temperature reads how run lengths scatter in units of a turn\.
### Supplementary Note 2: the survivor rate and the false\-landing rate
Equation[20](https://arxiv.org/html/2611.23375#S4.E20): with defect rateddbefore the gate, a defective trial lands with probabilityPPand a clean one with probability near one, so the landed set carriesdPdPdefective trials perdP\+\(1−d\)dP\+\(1\-d\)landed\. With the threshold based on one clean run, the measuredPPwas 5 of 8 under either gate\. With the observedd=0\.40d=0\.40andα=0\\alpha=0, the equation givesd′=0\.29d^\{\\prime\}=0\.29\. The observed survivor defect rates were 0\.29 and 0\.31\. Under the calibrated thresholds the whole suite passed 6 of its 8 defects, for which the equation gives 0\.33 against the observed 0\.35\. Equation[22](https://arxiv.org/html/2611.23375#S4.E22)follows from the two ways a green can be served; with each error probability’sssit predicts 0\.08, 0\.21 and 0\.38 atP=0\.05,0\.15,0\.30P=0\.05,0\.15,0\.30against the observed 0\.06, 0\.26 and 0\.52\. Each prediction lies inside the Wilson 95 per cent interval of the observed proportion:\[0\.010,0\.270\]\[0\.010,0\.270\],\[0\.125,0\.465\]\[0\.125,0\.465\]and\[0\.340,0\.693\]\[0\.340,0\.693\]\. On the repository, with each condition’sss, it predicts 0\.04, 0\.14, 0\.17, 0\.23 and 0\.23 at the five errors against the observed 0\.03, 0\.11, 0\.13, 0\.26 and 0\.28\. Each prediction again lies inside the Wilson 95 per cent interval of the observed proportion:\[0\.005,0\.132\]\[0\.005,0\.132\],\[0\.045,0\.260\]\[0\.045,0\.260\],\[0\.056,0\.267\]\[0\.056,0\.267\],\[0\.142,0\.421\]\[0\.142,0\.421\]and\[0\.175,0\.417\]\[0\.175,0\.417\]\. The agent received about 5\.6 verdicts per run, so flips in both directions compound, which a per\-run model would carry\.
Supplementary Fig\. 1:A change made and undone on Task B at Hinton temperature 0\.5, drawn as panels b to e of Fig\.[2](https://arxiv.org/html/2611.23375#S2.F2)are for Task A\. \(a\) The 45 landed coding runs \(rose\), in which the agent made the change \(forward\)\. The other three of the 48 coding runs stopped at the limit of 300 turns and are not drawn\. Each thin line is one run: the output tokens it had spent after each turn, ending in a dot at the turn where it landed\. A turn that changed the stateqqis drawn dark, and its tokens are work\. A turn that leftqqunchanged is drawn pale, and its tokens are heat\. The thick line is the mean over the runs, each run held at its final cost after it landed\. \(b\) The 48 landed uncoding runs \(black\), in which it undid the change \(reverse\), on the same axes\. \(c\) The work of the runs of a and b, in bins of 50 tokens:WWfor coding \(filled\) and−W\-Wfor uncoding \(outline\)\. The dashed line is the free energy of the change,ΔFJ\\Delta F\_\{J\}, 299 tokens\. \(d\) The mean output tokens of a run in each direction, divided into work \(dark\) and heat \(pale\)\. The dashed line isΔFJ\\Delta F\_\{J\}\.Supplementary Fig\. 2:The heat and the asymmetry of the cycle of Task B, counted in three ways, drawn as Fig\.[3](https://arxiv.org/html/2611.23375#S2.F3)is for Task A\. \(a\) The heat of the cycle,QQ, against the Hinton temperature,THT\_\{\\rm H\}, at 0\.1, 0\.5 and 1\. \(b\) The asymmetry of the cycle,𝒜\\mathcal\{A\}\. Black circles employ the VIVA approximation \(Eq\.[10](https://arxiv.org/html/2611.23375#S2.E10)\), rose squares the CORTA approximation \(Eq\.[11](https://arxiv.org/html/2611.23375#S2.E11)\) and tan triangles the LOCA approximation \(Eq\.[12](https://arxiv.org/html/2611.23375#S2.E12)\)\. The vertical axes are logarithmic\. Bars are 95 per cent bootstrap intervals over runs, and a bar that reaches the bottom of an axis extends below it\. The three conditions of Task B hold 144 runs, of which 132 landed\.Supplementary Fig\. 3:The software temperature of the cycle,1/βcyc1/\\beta\_\{\\rm cyc\}, in tokens per nat, against the Hinton temperature,THT\_\{\\rm H\}, for Task B, drawn as Fig\.[4](https://arxiv.org/html/2611.23375#S2.F4)is for Task A: the VIVA approximation \(black circles\), the CORTA approximation \(rose squares\) and the LOCA approximation \(tan triangles\)\. The vertical axis is logarithmic\. Bars are 95 per cent bootstrap intervals over runs\. The six conditions of Task B hold 602 runs, of which 564 landed\.Table 5:The cycle in each of its six conditions: two tasks at three Hinton temperatures, with 24 runs started in each direction\.QQis the heat of the cycle and𝒜\\mathcal\{A\}its asymmetry, both in tokens and over the landed runs\. The asymmetry is given with its 97\.5 per cent normal interval, and the next column says whether zero lies inside or outside that interval\.1/βcyc1/\\beta\_\{\\rm cyc\}is the software temperature of the cycle, in tokens a nat, computed on the 288 runs of these six conditions; Fig\.[4](https://arxiv.org/html/2611.23375#S2.F4)computes it on the 1,200 runs of the twelve conditions, which include them, and its values differ accordingly\. The last column gives the number of coding \(forward\) and of uncoding \(reverse\) runs that landed\. A condition is marked h, for incomplete, when more than five per cent of the runs of a direction did not land\.Table 6:Counts of distinct end trees among landed runs of Task A, by direction, at five Hinton temperatures\. On Task B the counts are 2 to 4 in each direction at every temperature\.Table 7:Uncoding from the ensemble of end trees, on both tasks atTH=0\.5T\_\{H\}=0\.5\(§[2\.5\.3](https://arxiv.org/html/2611.23375#S2.SS5.SSS3)\): the cost and the work of a landed uncoding run, and the slope and the zero crossing of Crooks’ test, for the two starts\. Intervals are 90% bootstrap intervals\. On Task A the 48 landed coding runs cost 2,305 tokens and did 415 tokens of work,β\\betais 0\.0065 per token and the free energy is 351 tokens\. On Task B the 45 landed coding runs cost 1,606 tokens and did 410 tokens of work,β\\betais 0\.0178 per token and the free energy is 299 tokens\.Table 8:The twelve conditions of the free\-energy measurement: two tasks at six Hinton temperaturesTHT\_\{\\rm H\}, 1,200 runs of the plain agent, of which 1,110 landed\. The coding \(forward\) and uncoding \(reverse\) columns each give landed runs over runs started\. The unfinished share is the percentage of a direction’s tokens spent in runs that did not land\. Cost is the mean cost of a landed run, in tokens, and the heat share is the percentage of the landed runs’ tokens spent in turns that did not move the state\.1/β1/\\betais the temperature of the work in tokens per nat \(Eq\.[14](https://arxiv.org/html/2611.23375#S2.E14)\),ΔFJ\\Delta F\_\{J\}the free energy from the coding runs \(Eq\.[13](https://arxiv.org/html/2611.23375#S2.E13)\) andΔFS\\Delta F\_\{S\}the half difference of the mean works \(Eq\.[16](https://arxiv.org/html/2611.23375#S2.E16)\), in tokens; brackets are 90 per cent bootstrap intervals over runs\. The last column gives the mean cost of a landed coding run divided by the mean cost of a landed uncoding run\. A condition marked∘\\circhas more than 85 per cent of a direction’s tokens in unfinished runs and is left out of the ranges quoted in the text\.Table 9:The sixty gate trials by gate\. Planted is the number of trials that carried a planted defect, caught the number of those the gate refused, and clean passed the trials without a defect that the gate let land\. The share is the landed trials that carried a defect over all landed trials\. The whole suite is judged twice on the same 19 trials: under a threshold of three times one clean reading, and under the calibrated threshold \(§[4\.12](https://arxiv.org/html/2611.23375#S4.SS12)\)\.Table 10:True and served final verdicts of the judged planted runs on the repository, at each injected error probabilityPP\. A false landing is a run whose final grade was served green while its true verdict was red\.ssis the share of judged runs that were truly red, and the false\-landing rate is the false landings over all runs served green\.Table 11:The intervals of this article: the quantity, where it is reported, the kind of interval, its level and the unit that was resampled\. A bootstrap is a percentile bootstrap, and its draws are in the last column\. Counts and shares without bars \(Figs\.[2](https://arxiv.org/html/2611.23375#S2.F2),[5](https://arxiv.org/html/2611.23375#S2.F5)and[6](https://arxiv.org/html/2611.23375#S2.F6); Tables[6](https://arxiv.org/html/2611.23375#S6.T6),[9](https://arxiv.org/html/2611.23375#S6.T9)and[10](https://arxiv.org/html/2611.23375#S6.T10)\) carry no interval\.相似文章
编程代理是否变得昂贵,还是我们对成本的衡量方式有误?
本文质疑编程代理的真实成本是否包含隐藏的人力监督和调试,认为真正的价值应以可信输出来衡量,而非原始 token 消耗。
你的智能体编码会话是一笔宝藏
一篇博客文章指出,编码智能体的会话记录与轨迹是极具价值的资料,可用于调试故障、理解成本开销以及复用修复方案——同时警告 Claude Code 的 30 天清理机制会将这些记录永久删除。文章拆解了一个会话归档中包含的内容,并引用了一次 RTK 基准测试的尝试:该测试在经历连续 339 次错误、成本约为基线 9 倍之后才最终通过。
代理式编程是一个陷阱
本文认为,代理式编程(即 AI 生成代码,人类充当编排者)是一个陷阱,原因包括系统复杂性增加、技能退化以及供应商锁定。文章强调了这种做法对开发者学习和批判性思维的负面影响,并将这一新的抽象层与历史上的编程范式转变进行了对比。
TokenEconomizer:面向编码智能体的经验驱动型黑盒成本控制方法
本文提出 TokenEconomizer,一个经验驱动的外部控制器,通过注入微技能、裁剪无关工具以及中断失败循环来降低编码智能体的 token 成本。在 Claude Code、Codex 和 GitHub Copilot CLI 上,该方法在任务成功率相当的情况下实现了 18.4%–30.9% 的成本节省。
智能体编程的天启四骑士
一篇观点文章,认为智能体编程正在引发四大问题——令人望而却步的“slop”代码、工程师对自己手艺的疏离感、代码库质量的退化,以及团队所有权的削弱——而目前几乎看不到任何解决方案的曙光。