Where the Tokens Go: Heat, Entropy and Error in Agentic Coding
Computer Science > Artificial Intelligence arXiv:2611.23375 (cs) [Submitted on 17 Nov 2026] Title: Where the Tokens Go: Heat, Entropy and Error in Agentic Coding Authors: Alán Aspuru-Guzik, Varinia Bernales.
计算机科学 > 人工智能 arXiv:2611.23375 (cs) [提交于 2026 年 11 月 17 日] 标题:《Token 去向何处:智能体编码中的热量、熵与误差》 作者:Alán Aspuru-Guzik, Varinia Bernales。
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.
摘要:编码智能体按 Token 计费,但软件工程学并未说明 Token 究竟购买了什么。在此,我们引入了一种软件热力学理论。该理论借鉴了经典热力学和随机热力学的类比,对其进行了扩展,并将其应用于现代智能体编码。我们将智能体生成的 Token 视为成本,并将该成本划分为功和热。测试套件充当了软件领域的“麦克斯韦妖”,负责评判每一次代码变更。
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.
我们通过类比实验来验证该理论,即拉开一个单分子并让其重新折叠的实验:智能体对代码库进行一次更改(编码),然后撤销该更改(反编码),如此反复多次,并统计每次模型调用的 Token 数量。该循环将请求的编辑内容恢复到初始状态,每个方向都从存储的参考树开始,其在重复循环中的成本分布定义了软件温度,该温度随模型的采样温度升高而升高。
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.
一次成功运行中约 80% 的 Token 是在那些未改变请求变更的模型调用中生成的,我们将这些 Token 称为“热量”。通过类比贾辛斯基等式(Jarzynski equality)估算,一次变更的自由能占成功编码运行平均成本的 14% 到 22%。编码的成本是反编码的 1.1 到 1.5 倍。这个“麦克斯韦妖”并不完美:测试套件的判定结果会随环境而变化,而接受了错误变更的套件会产生相应的 Token 成本。
The practical implication of the proposed theory could be new tools for analysing and optimising coding agents through the lens of thermodynamics.
该理论的实际意义在于,它可能为通过热力学视角分析和优化编码智能体提供新的工具。