Where Do Coding-Agent Tokens Go? Software Thermodynamics Finds 80% 'Heat'
Summary:An arXiv preprint reframes coding-agent economics as a form of software thermodynamics. The authors repeatedly ask an agent to modify and then revert a repository from a stored reference tree, using the test suite as a software Maxwell's demon and generated tokens as the cost metric. They report that roughly 80% of the tokens in a successful run are generated by calls that leave the requested change in place; these are labeled heat. A Jarzynski-inspired estimator places the free energy of a chan
The paper does not claim that tokens are physical energy. Instead, it builds a state-dependent accounting system for coding-agent costs that can be calculated from trajectory logs. Classical and stochastic thermodynamics provide the vocabulary for explaining why agents can spend many model calls without advancing the repository toward the requested outcome. In the proposed analogy, the test suite acts as a software Maxwell's demon: it observes a patch and determines whether the change is acceptable.
A token bill is not the same as delivered software value
Under the paper's operational definition, agent cost can be written as C = W + Q. All generated tokens form the total cost C; tokens that advance the requested change and pass validation constitute useful work W; tokens generated by calls that leave the requested state unchanged constitute heat Q. The central reported result is that approximately 80% of the tokens in a successful run are produced by calls that do not alter the requested change.
Heat is therefore a state-transition measure of inefficiency, not a verdict on text quality. Reasoning, repository search, tool selection, explanation generation, failed retries, and test execution may all occur without leaving a repository diff. Some of those steps may still be necessary context for a later successful patch. Conversely, a call that emits many tokens but produces only a small final diff may be classified as inefficient at a coarse level.
The attribution also depends on when repository state is sampled. If one call combines exploration, tool use, and patch generation, all output tokens from that call may be assigned to heat according to its ending state. The 80% headline must therefore be interpreted together with its measurement granularity.
Coding and uncoding cycles on a fixed reference tree
The experiment resembles pulling a molecule open and letting it fold again. An agent first modifies a repository and then reverts that modification. Both directions start from a stored reference tree, fixing the cycle boundaries and making the costs of alternative paths comparable. Tokens from every model call are accumulated, and the distribution of costs across repeated cycles defines an operational software temperature.
The authors report that software temperature rises as the model's sampling temperature increases. These two temperatures should not be conflated. Sampling temperature controls the stochastic behavior of generation, while software temperature is a proxy for dispersion in cost across repeated cycles. Their correlation does not establish equivalence, nor does it show that lower-temperature decoding is always better. Design tasks, ambiguous bug-fixing prompts, and other exploratory workloads may benefit from the diversity generated by higher sampling temperatures.
The stored reference tree is an important control. It prevents residual state from one cycle from contaminating the next and makes coding and uncoding paths easier to compare. It also limits the immediate generalization: reversible modifications with automated validation are not equivalent to one-way migrations, broad refactors, or long-horizon tasks without dependable rollback points.
From work and heat to free energy
The paper invokes the Jarzynski equality to estimate the free energy of a change from the statistical distribution of dissipated cost across repeated cycles. A common form is ΔF = −k_B T ln⟨exp(−ΔE/k_BT)⟩; in the software analogy, generated tokens act as discretized units of work. The authors estimate that the free energy of a change is 14%–22% of the mean cost of a successful coding run.
That figure should not be added directly to the 80% heat estimate. They come from different operational definitions: heat is based on whether a call changes the requested state, whereas free energy is inferred through a Jarzynski-inspired estimator. Free energy is also not equivalent to business value. A patch can pass tests while still containing redundant code, maintenance costs, or uncovered edge cases.
More importantly, tokens are not joules and software temperature is not measured in kelvin. The framework's value lies in providing a common language for trajectory analysis, not in replacing software behavior with a new physical law. The abstract does not disclose the exact free-energy estimator, sampling depth per state, convergence criteria, or uncertainty intervals, so the 14%–22% result remains an empirical observation under the paper's setup.
The test suite is both judge and error source
The test suite plays the role of Maxwell's demon, but it is not a perfect observer. Results can change with the operating system, dependency versions, environment variables, concurrency state, and test-isolation strategy. The same patch may pass in one environment and fail in another. The paper consequently treats environment-dependent verdicts as measurement noise rather than ordinary test instability.
The more dangerous path is a suite that accepts a broken change. The defect then survives as hidden state, enters later generation and review cycles, and may consume tokens for the rest of the workflow. In production, the test oracle should be separated as far as possible from the model that generates the implementation, so the same agent does not effectively write both the code and the definition of correctness.
The paper also reports that coding costs 1.1–1.5 times as much as undoing the change. This asymmetry is plausible because constructing a constrained patch is generally harder than deleting or restoring existing code. However, the lower reversal cost may partly reflect a more explicit objective and stronger priors for the reverse task; it does not imply that undo operations are universally easier across repositories.
What is still missing from the evaluation
The abstract does not identify the evaluated models, repositories, task difficulty, test-suite size, sampling-temperature settings, number of repeated cycles, tokenizer differences, or confidence intervals. The paper counts only tokens generated by the agent, while production billing may also include input tokens, cache reads and writes, tool execution, and orchestration overhead. The 80% figure therefore cannot be read as an immediately realizable 80% billing reduction.
A Jarzynski-style estimator also requires enough independent cycles and demonstrable convergence. Rare but expensive repair paths and long-tail tool failures can materially affect the bias. If every cycle shares the same model, repository, or test environment, the effective sample size may be lower than the raw number of calls suggests.
Weak test coverage creates another failure mode: an agent can pass incorrect patches and receive credit for apparent useful work, effectively overfitting the test oracle. The title's references to entropy and error are not broken into independent quantitative metrics in the abstract. The work is therefore best understood as a promising analytical framework rather than a validated compression, routing, or training algorithm.
A practical deployment playbook
- Instrument every call. Capture input and output tokens, sampling temperature, tool use, latency, repository-tree hashes before and after the call, diff size, and test outcomes. Heat cannot be measured from the aggregate token bill alone.
- Define auditable work. Combine diff semantics, test outcomes, static analysis, human review, and rollback state. Do not treat one binary test-suite verdict as complete business value.
- Track focused metrics. Monitor useful-token ratio, heat ratio, cost per accepted patch, coding-to-uncoding cost ratio, variance across repeated runs, and state-no-change rate under a fixed prompt.
- Run controlled replays first. Repeat coding and uncoding cycles with the model, prompt, sampling parameters, and containerized environment fixed. Check whether software temperature is stable, then reproduce the result across repositories, models, and test suites.
- Tune randomness by task. Use lower sampling temperatures and deterministic decoding for mechanical edits and format migrations. Preserve multiple candidate paths for architectural design and difficult diagnosis, where reducing tokens could reduce solution quality.
- Harden the acceptance environment. Pin dependencies and seeds, use containers or VMs, isolate test data, and deploy independent oracles. Add property tests, mutation testing, and human review for high-risk changes so latent errors are not hidden by the heat metric.
Research significance
The most useful contribution is a shift from asking how many tokens an agent consumed to identifying which calls actually changed verifiable software state. That framework could support comparisons among models, sampling policies, prompt designs, and validation toolchains. Turning it into a reliable optimization target, however, requires fuller model and task coverage, exact estimator details, cross-environment replication, and controlled online comparisons.
— END —Source: ArXiv AI (cs.AI) (2026-11-19)
Tags: #Agentic Coding #Software Thermodynamics #Token Economics #Agent Evaluation
Editorial & Fact-Checking Note: This article is compiled from primary research, official release documentation, and source papers by the ZICQ Newsroom pipeline with automated entity verification and human editorial review. If you notice any technical inaccuracy, please submit a correction via our corrections policy or email our editorial desk directly.
Community Comments