<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Relaxation | mcbal</title><link>https://mcbal.github.io/tags/relaxation/</link><atom:link href="https://mcbal.github.io/tags/relaxation/index.xml" rel="self" type="application/rss+xml"/><description>Relaxation</description><generator>HugoBlox Kit (https://hugoblox.com)</generator><language>en-gb</language><lastBuildDate>Mon, 02 Feb 2026 09:28:17 +0100</lastBuildDate><image><url>https://mcbal.github.io/media/icon.svg</url><title>Relaxation</title><link>https://mcbal.github.io/tags/relaxation/</link></image><item><title>Entropy Production in Nonequilibrium Neural Networks</title><link>https://mcbal.github.io/post/entropy-production-in-nonequilibrium-neural-networks/</link><pubDate>Mon, 02 Feb 2026 09:28:17 +0100</pubDate><guid>https://mcbal.github.io/post/entropy-production-in-nonequilibrium-neural-networks/</guid><description>&lt;p&gt;&lt;a title="Walter Baxter / A murmuration of starlings at Gretna" href="https://commons.wikimedia.org/wiki/File:Starling_murmuration.jpg"&gt;&lt;img width="512" alt="A murmuration of starlings at Gretna" src="https://upload.wikimedia.org/wikipedia/commons/8/8d/Starling_murmuration.jpg?20150218191823"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h1 id="introduction"&gt;Introduction&lt;/h1&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;&lt;strong&gt;✨ GitHub repository:
(work in progress)&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Transformers are powerful driven dynamical systems, yet their internal computation is rarely discussed in terms of nonequilibrium thermodynamics. Building on
, we design a minimal parallel transformer-like module whose forward pass implements a controllable quench-and-relax process. We characterize its dynamical regimes to elucidate a design space of stateless and stateful variations of transformer-like and deep-equilibrium-like architectures and leverage its physics-based architecture to compute differentiable proxies for entropy production. This provides both a scalable laboratory for nonequilibrium many-body dynamics on hardware accelerators and a testable learning hypothesis.&lt;/p&gt;
&lt;p&gt;We ask whether module-local ascent on a housekeeping entropy-production proxy, under bounded dynamics and structured input streams, can lead a system to acquire structure-sensitive, predictive dynamics without an externally supplied task loss or end-to-end credit assignment. The risk is that the system finds local dissipative shortcuts: asymmetric attention collapse, self-exciting cycles, or coupling to noise. The bet is that, once trivial dissipative shortcuts are bounded or exhausted, persistent temporal structure provides the most reliable support for continuing asymmetric delayed flow. We readily admit that the main motivation for this bet is aesthetic. To move beyond aesthetics, we run numerical experiments.&lt;/p&gt;
&lt;h1 id="driving-a-spin-transformer-module"&gt;Driving a spin-transformer module&lt;/h1&gt;
&lt;p&gt;In this section we design a minimal spin-transformer module whose forward pass implements a controllable nonequilibrium quench-and-relax process. We identify three timescales and two dynamical regimes, leading to a natural categorization of the design space into stateless and stateful variations of transformer-like and deep-equilibrium-like architectures.&lt;/p&gt;
&lt;h2 id="a-minimal-controllable-drive-conditioned-system"&gt;A minimal controllable drive-conditioned system&lt;/h2&gt;
&lt;p&gt;In
we showed how to apply dynamical mean-field theory to approximate the time-dependent behavior of asymmetric vector-spin models. We started from a spin system of $N$ vector spins $\mathbf{s}_{i,t} \in \mathbb{R}^{D}$ talking to each other via an $N \times N$ pairwise coupling matrix $J_{ij}$ with the underlying parallel-updates stochastic dynamics characterized by a discrete-time Markov chain transition probability $P(\mathbf{s}_{t} | \mathbf{s}_{t-1})$. External magnetic fields $\mathbf{x}_{i,t} \in \mathbb{R}^{D}$ bias the vector spins and act as local drives. We will use the notation $\mathbf{x}_{t} = \{ \mathbf{x}_{i,t} \}^{N}_{i=1}$ to refer to the full-drive matrix instead of the local drive at a single position.&lt;/p&gt;
&lt;img src="vector_spins.png" alt="Random Ising model configuration with vector spins" width="250px"/&gt;
&lt;p&gt;Using a simple first-order &lt;code&gt;Plefka[t-1,t]&lt;/code&gt; mean-field approximation, we calculated a closed expression for updating the spin expectation values in the large-vector-dimension limit,&lt;/p&gt;
\begin{equation}
\mathbf{m}_{i,t} = \frac{\beta \left( \mathbf{x}_{i,t} + \sum_{j} J_{ij} \mathbf{m}_{j,t-1} \right)}{1+\sqrt{1+\beta^2 \lVert \mathbf{x}_{i,t} + \sum_{j} J_{ij} \mathbf{m}_{j,t-1} \rVert^2 / R^2 }},
\end{equation}&lt;p&gt;where the magnetization vectors $\mathbf{m}_{i,t} \in \mathbb{R}^{D}$ capture the mean-field influence of the spins on each other. Additionally, $\beta$ denotes the inverse temperature and $R=\sqrt{D/2 -1}$ is the natural hyperspherical length scale resulting from the large-vector-dimension approximation&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;If we now consider some kind of &lt;em&gt;parameterized drive-dependent couplings&lt;/em&gt;&lt;/p&gt;
\begin{equation}
\mathbf{J} (\mathbf{x}_{t}) = \mathrm{softmax}\left( \mathbf{x}_{t} \boldsymbol{W}_{Q} \boldsymbol{W}_{K}^{T} \mathbf{x}_{t}^{T} \right), \label{eq:softmax}
\end{equation}&lt;p&gt;then we turn the fixed-size $N \times N$ coupling matrix into a parameterized rule that supports variable system size, drive-dependent routing, and a way to scale system size without learning new explicit parameters&lt;sup id="fnref:2"&gt;&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref"&gt;2&lt;/a&gt;&lt;/sup&gt;. If we also augment the local drives with some kind of &lt;em&gt;parameterized non-linear drive-dependent field&lt;/em&gt;,&lt;/p&gt;
\begin{equation}
\mathbf{x}_{i,t} \to \mathbf{x}_{i,t} + \mathbf{FFN}\left( \mathbf{x}_{i,t} \right),
\end{equation}&lt;p&gt;where $\mathbf{FFN}$ denotes a position-wise feed-forward network, then our earlier recurrence relation becomes&lt;/p&gt;
\begin{equation}
\mathbf{m}_{i,t,k+1} = \frac{\beta \left( \mathbf{x}_{i,t} + \mathbf{FFN}\left( \mathbf{x}_{i,t} \right) + \sum_{j} J_{ij} (\mathbf{x}_{t}) \mathbf{m}_{j,t,k} \right)}{1+\sqrt{1+\beta^2 \lVert \mathbf{x}_{i,t} + \mathbf{FFN}\left( \mathbf{x}_{i,t} \right) + \sum_{j} J_{ij} (\mathbf{x}_{t}) \mathbf{m}_{j,t,k} \rVert^2 / R^2 }}, \label{eq:paralleltransformer}
\end{equation}&lt;p&gt;where we have pushed down the recurrence into an internal relaxation index $k$. By making the effective drive as well as the couplings depend on the drive $\mathbf{x}_{t}$, a sudden shift $\mathbf{x}_{t} \to \mathbf{x}_{t+1}$ changes both the local fields as well as the interactions and quenches the module into a new instantaneous dynamics&lt;sup id="fnref:3"&gt;&lt;a href="#fn:3" class="footnote-ref" role="doc-noteref"&gt;3&lt;/a&gt;&lt;/sup&gt;. During internal relaxation updates $k$, the drive $\mathbf{x}_{t}$ and the parameters $\boldsymbol{\theta} = \{ \mathbf{W}_{Q}, \mathbf{W}_{K}, \mathbf{FFN} \}$, and therefore the transition rule, are held fixed. (At the stochastic level, the process looks something like $P_{\boldsymbol{\theta}, \mathbf{x}_{t}}(\mathbf{s}_{t, k+1} | \mathbf{s}_{t, k})$.)&lt;/p&gt;
&lt;p&gt;We end up with a &lt;em&gt;highly reconfigurable system&lt;/em&gt; that is &lt;em&gt;dynamically shaped by the drive&lt;/em&gt;. Each vector spin effectively experiences a local mean-field that is the sum of a residual stream drive, a feed-forward-like drive, and attention-like couplings. Importantly, these terms are &lt;em&gt;parameterized&lt;/em&gt; and can be &lt;em&gt;shaped through training&lt;/em&gt;: we can control how the system responds, fluctuates, and relaxes after getting quenched. Slow parameter updates then make this responsive system adaptive.&lt;/p&gt;
&lt;h2 id="building-modules-three-clocks-slow-plasticity-and-two-relaxation-limits"&gt;Building modules: three clocks, slow plasticity, and two relaxation limits&lt;/h2&gt;
&lt;p&gt;Looking at Eq. \eqref{eq:paralleltransformer} we already notice its close resemblance to the forward pass of a
. To make this more precise, we need to specify &lt;em&gt;how to implement&lt;/em&gt; spin-transformer modules in practice. What is up with this weird internal state and internal relaxation dimension? How can this system even serve as a neural network module?&lt;/p&gt;
&lt;p&gt;Let us begin by writing the forward pass Eq. \eqref{eq:paralleltransformer} more generally as&lt;/p&gt;
\begin{equation}
\mathbf{m}^{(l)}_{t, k+1} = F_{\boldsymbol{\theta}^{(l)}_{n}} \left( \mathbf{x}^{(l)}_{t}, \mathbf{m}^{(l)}_{t, k} \right)
\end{equation}&lt;p&gt;and clearly state the clocks involved:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;$k$ indexes fast internal relaxation within the module&lt;/li&gt;
&lt;li&gt;$t$ indexes changes in the environmental drive or input context&lt;/li&gt;
&lt;li&gt;$n$ indexes slow parameter updates $\boldsymbol{\theta}^{(l)}_{n+1} = \boldsymbol{\theta}^{(l)}_{n} + \eta \nabla_{\boldsymbol{\theta}^{(l)}} \mathcal{L}^{l}_{t}$ for some learning rate $\eta \ll 1$ and (potentially layer-dependent) loss function $\mathcal{L}^{l}_{t}$ where slow here actually means small parameter changes since the optimizer clock $n$ often tracks the drive clock $t$ in practice&lt;/li&gt;
&lt;li&gt;$l$ indexes network depth (number of stacked layers)&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;A deep network is a stack of parameterized modules, which, in our framework, make up a collective of &lt;em&gt;different&lt;/em&gt; driven spin systems driving each other sequentially. The layer index does not (have to) correspond to external time nor to internal relaxation time; it is an additional axis labeling the simple feed-forward topology (depth) of the computational graph. For clarity, we drop it in the remainder of this section.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The three clocks define three characteristic rates: $\tau_{\mathrm{relax}}$, $\tau_{\mathrm{drive}}$, and $\tau_{\mathrm{learn}}$. Throughout, we assume slow plasticity $\tau_{\mathrm{drive}} \ll \tau_{\mathrm{learn}}$. The relative size of $\tau_{\mathrm{relax}}$ and $\tau_{\mathrm{drive}}$, or, equivalently, the number of internal updates allocated before the next quench, determines the computational regime.&lt;/p&gt;
&lt;p&gt;We frame our module-design intuition around a &lt;em&gt;quench-and-relax scenario&lt;/em&gt;: when the input drive switches, &lt;em&gt;i.e.&lt;/em&gt; $\mathbf{x}_{t} \to \mathbf{x}_{t+1}$, the spin system has to adapt to the sudden change. A general post-quench module then looks like&lt;/p&gt;
\begin{equation}
\mathbf{m}_{t, K} = F^{K}_{\boldsymbol{\theta}_{n}} \left( \mathbf{x}_{t}, \mathbf{m}_{t, 0} \right),
\end{equation}&lt;p&gt;with two independent design choices: the number of internal relaxation steps $K$ (relaxation horizon) and the choice of $\mathbf{m}_{t, 0}$ (initialization policy), leading to the following design space:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Reset or amortized initialization&lt;/th&gt;
&lt;th&gt;Carried initialization&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Finite-step regime with $K &lt; \infty$&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;finite-depth, stateless, transformer-like module&lt;/td&gt;
&lt;td&gt;recurrent stateful module&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Fixed-point regime where $K \to \infty$&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;implicit or deep-equilibrium-like (DEQ) module&lt;/td&gt;
&lt;td&gt;identical if the fixed point is unique; path-dependent if mean-field branches coexist&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 id="finite-step-regime"&gt;Finite-step regime&lt;/h3&gt;
&lt;p&gt;In this regime, only $K &lt; \infty$ internal updates are allocated before readout or the next quench. This may reflect genuine competition between relaxation and drive timescales, or simply deliberate computational truncation. The intuition here is that the system tracks a moving family of instantaneous stationary marginals with potentially nonzero lag. There is no strong separation between drive and relaxation, but, since the module is controllable, we can shape the system&amp;rsquo;s behavior through nudging the parameters $\boldsymbol{\theta}_{n}$ in the outer loop.&lt;/p&gt;
&lt;p&gt;The initialization $\mathbf{m}_{t, 0} = \mathbf{m}_{t-1, K}$ makes the module architecture genuinely recurrent and stateful, but with a full context window of hidden states, situating it somewhere in between recurrent neural networks and transformers. Another option is to learn an amortized initializer $\mathbf{m}_{t, 0} = \mathbf{x}_{t}\mathbf{W}_{V}$ for the post-quench relaxation from the drive, which estimates the drive-conditioned response to which the module should relax. If we recognize this state initialization as &lt;em&gt;values&lt;/em&gt;, then, for $K=1$, the forward pass pretty much matches that of a parallel transformer block.&lt;/p&gt;
&lt;h3 id="fixed-point-regime"&gt;Fixed-point regime&lt;/h3&gt;
&lt;p&gt;In this regime, $\tau_{\mathrm{relax}} \ll \tau_{\mathrm{drive}}$ so we consider $\mathbf{x}_{t}$ clamped and let $K \to \infty$ until the deterministic mean-field equations converge to fixed-point magnetizations $\mathbf{m}^{*}_{t}(\mathbf{x}_{t})$ compatible with the frozen drive $\mathbf{x}_{t}$. These values approximate the stationary marginals of an underlying instantaneous frozen-drive nonequilibrium steady state (NESS). The intuition here is that the clamped input fixes an instantaneous stochastic transition rule. Although its one-point marginals become stationary, asymmetric couplings can sustain probability currents and positive entropy production beneath those stationary marginals.&lt;/p&gt;
&lt;p&gt;In case of a unique fixed point, the initial values $\mathbf{m}_{t, 0}$ are erased, and the module is stateless. But the deterministic mean-field equations may admit multiple stable fixed-point branches or basins. Warm-starting with $\mathbf{m}_{t, 0} = \mathbf{m}^{*}_{t-1}$ can then produce path-dependent branch selection and hysteresis behavior.&lt;/p&gt;
&lt;h2 id="on-the-connection-to-transformers"&gt;On the connection to transformers&lt;/h2&gt;
&lt;p&gt;Let us step back for a bit and emphasize that this close resemblance between forward passes acts as a &lt;em&gt;plausibility bridge&lt;/em&gt; at this point. It is &lt;em&gt;not evidence&lt;/em&gt; that trained transformers literally implement the approximated nonequilibrium thermodynamics scenarios we will cover in the next sections. But the proximity in module architecture space of a minimal spin-transformer to a class of transformers known to scale does at least suggest that transformers may also admit module-level nonequilibrium interpretations.&lt;/p&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;&lt;strong&gt;A nonequilibrium picture of autoregressive inference from a quench-and-relax perspective:&lt;/strong&gt; a freshly generated token changes the context window and therefore quenches the stack of modules beginning at the bottom, the modules consecutively relax and then drive the next module all the way to the top where the final magnetizations get mapped to a probability distribution to sample the next token from. The parameters of the stack of modules have been carefully optimized during successive stages of training to implement useful finite-step relaxation.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Even on their own, spin-transformer modules have merit since they turn transformer-like neural networks into computational laboratories for nonequilibrium dynamics that can be executed on modern accelerators at scale. This makes it possible to study large, high-dimensional systems with structured input-dependent couplings, nonstationary data streams, and slowly adapting parameters rather than staying close to analytically tractable toy models. The resulting observables remain mean-field approximations, and must be calibrated against exact stochastic systems at small scale. But once calibrated, the framework offers a route to computational experiments on collective adaptation and irreversible organisation in regimes that are otherwise difficult to access.&lt;/p&gt;
&lt;p&gt;We end this section with a cheat sheet mapping concepts between spin-transformer modules and transformer modules.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Spin-transformer module&lt;/th&gt;
&lt;th&gt;Transformer module&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Local drives $\mathbf{x}_{i,t}$&lt;/td&gt;
&lt;td&gt;Input embeddings and latent embeddings&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;ldquo;The drive&amp;rdquo; $\mathbf{x}_{t}$&lt;/td&gt;
&lt;td&gt;Current context window&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Parameterized couplings $J_{ij}$&lt;/td&gt;
&lt;td&gt;Attention matrix&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Magnetizations $\mathbf{m}_{i,t}$&lt;/td&gt;
&lt;td&gt;Latent embeddings and output embeddings&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h1 id="computing-differentiable-entropy-production-proxies"&gt;Computing differentiable entropy-production proxies&lt;/h1&gt;
&lt;p&gt;We could stop here, pretrain a spin-transformer model using next-token prediction on chunks of text, and compare evaluation metrics to those of compute-matched vanilla transformers. But let us focus instead on what our framework enables that feels hard to come up with &lt;em&gt;without&lt;/em&gt; having access to a nonequilibrium spin-model perspective.&lt;/p&gt;
&lt;p&gt;In this section, we show how the quench-and-relax process underneath the forward pass of a spin-transformer module relates to notions of &lt;em&gt;irreversibility&lt;/em&gt;. We add physical context and introduce differentiable entropy production proxies that we can compute at the same mean-field level as the spin systems. These proxies can be used to estimate entropy-production rates for maintaining a nonequilibrium steady state under the current drive as well as the catching-up during relaxation after the drive changes.&lt;/p&gt;
&lt;h2 id="two-ways-to-be-irreversible"&gt;Two ways to be irreversible&lt;/h2&gt;
&lt;h2 id="mean-field-proxy-for-housekeeping-entropy-production"&gt;Mean-field proxy for housekeeping entropy production&lt;/h2&gt;
&lt;p&gt;Let us now introduce some physics to get a handle on what driving these out-of-equilibrium systems means in terms of entropy production and irreversibility.&lt;/p&gt;
&lt;p&gt;&amp;hellip;
frozen-drive nonequilibrium steady state (NESS)
Maintaining currents under frozen drive versus catching up when the boundary changes.&lt;/p&gt;
&lt;p&gt;&amp;hellip;&lt;/p&gt;
&lt;p&gt;Following
, the housekeeping entropy production for the kinetic Ising model, assuming a nonequilibrium steady state, is given by&lt;/p&gt;
\begin{equation}
\langle \sigma_{t} \rangle = \beta \sum_{ij} \left(J_{ij}(\mathbf{x}_{t}) - J_{ji}(\mathbf{x}_{t})\right) D_{ij,t} , \label{eq:sigma_hk}
\end{equation}&lt;p&gt;where $J_{ij}$ corresponds to the couplings and $D_{ij,t}$ denotes the time-delayed correlations. Intuitively, this is like&lt;/p&gt;
\begin{equation}
\langle \sigma_{t} \rangle = \sum_{ij} \left[\operatorname{directionality}\right]_{ij} \times \left[\operatorname{delayed\ flow}\right]_{ij,t},
\end{equation}&lt;p&gt;or, even more hand-wavy, $\operatorname{dissipation} \sim \operatorname{force} \times \operatorname{flux}$. The asymmetric part of the couplings says whether that propagation channel is directionally biased. The full sum rewards directed, temporally effective, vector-aligned information flow.&lt;/p&gt;
&lt;p&gt;Back to reality. If we write down $D_{ij,t}$ for the vector-spin case,&lt;/p&gt;
\begin{equation}
D_{ij,t} = \int \mathrm{d} \mathbf{s}_{t} \int \mathrm{d} \mathbf{s}_{t-1} \; \left( \mathbf{s}_{i,t} - \mathbf{m}_{i,t} \right) \cdot \left( \mathbf{s}_{j,t-1} - \mathbf{m}_{j,t-1}\right) \; P( \mathbf{s}_{t}, \mathbf{s}_{t-1} ),
\end{equation}&lt;p&gt;we can compute a first-order &lt;code&gt;Plefka[t-1,t]&lt;/code&gt; mean-field approximation for the time-delayed correlations, similar to the computations we did previously for the magnetizations in
, leading to something like&lt;/p&gt;
\begin{align}
D_{ij,t} = &amp;\beta J_{ij} \operatorname{Tr} \left( \Sigma_{i,t} \Sigma_{j,t-1} \right),
\end{align}&lt;p&gt;where $\Sigma_{i,t} = \operatorname{Var} \left[ s_{i,t} \right]$ denotes the single-site covariance / susceptibility. The trace captures which directions on the vector-spin sphere are still available to fluctuate. If a spin is weakly magnetized, it has many soft directions. If it is strongly magnetized, many directions are suppressed because the spin is pinned close to its mean direction.&lt;/p&gt;
&lt;p&gt;Substituting the large-$D$ approximation&lt;/p&gt;
\begin{align}
\Sigma_{i,t} \approx \frac{\mathbb{1}}{1+\gamma_{i,t}} - \frac{\mathbf{m}_{i,t} \mathbf{m}_{i,t}^{T}}{R^2 \gamma_{i,t}},
\end{align}&lt;p&gt;we end up with the explicit expression&lt;/p&gt;
\begin{align}
D_{ij,t} = &amp;\frac{\beta J_{ij}}{1+\gamma_{i,t}} \left(R^2 - \mathbf{m}_{j,t-1}^2 \right) \nonumber\\\\
&amp;- \frac{\beta J_{ij}}{R^2 \gamma_{i,t} \left( 1 + \gamma_{j,t-1} \right)} \mathbf{m}_{i,t}^2 \nonumber\\\\
&amp;+ \frac{\beta J_{ij}}{R^4 \gamma_{i,t} \gamma_{j,t-1}} \left( \mathbf{m}_{i,t} \cdot \mathbf{m}_{j,t-1} \right)^2,
\end{align}&lt;p&gt;where&lt;/p&gt;
\begin{align}
\gamma_{i,t} &amp;= \sqrt{1 + \beta^2 \lVert \mathbf{h}_{i,t} \rVert^2 / R^2 } \\\\
\mathbf{h}_{i,t} &amp;= \mathbf{x}_{i,t} + \sum_{j} J_{ij} \mathbf{m}_{j,t-1}.
\end{align}&lt;p&gt;The first-order time-delayed correlations $D_{ij,t}$ are a mean-field estimate of how much the fluctuation in one vector spin is transmitted one time step later &amp;ldquo;into&amp;rdquo; another spin. Or, put differently, when spin $j$ fluctuates away from its mean at the previous time step $t-1$, how much of that fluctuation shows up as a fluctuation of spin $i$ at the current time step $t$?&lt;/p&gt;
&lt;blockquote class="border-l-4 border-neutral-300 dark:border-neutral-600 pl-4 italic text-neutral-600 dark:text-neutral-400 my-6"&gt;
&lt;p&gt;&lt;strong&gt;Waving hands and checking vibes:&lt;/strong&gt; Let us try to get a feel for what the entropy production looks like for vector-spin models using some rough back-of-the-envelope estimations. Assume both vectors $\mathbf{m}_{i,t}$ and $\mathbf{m}_{j,t-1}$ have a norm $\mathcal{O}(R)$, then the time-delayed correlations behave approximately like
&lt;/p&gt;
\begin{align}
D_{ij,t} \sim \beta J_{ij} \cos^2 \alpha_{(i,t)(j,t-1)},
\end{align}&lt;p&gt;
where $\alpha_{(i,t)(j,t-1)}$ denotes the angle between the magnetization vectors. So the entropy production looks approximately like
&lt;/p&gt;
\begin{equation}
\langle \sigma_{t} \rangle \sim \beta^2 \sum_{ij} \left(J_{ij}^2 - J_{ij} J_{ji}\right) \cos^2 \alpha_{(i,t)(j,t-1)},
\end{equation}&lt;p&gt;
which, in general, is minimized for symmetric coupling matrices or orthogonal embeddings and maximized for fully-asymmetric couplings or (anti-)parallel embeddings.
But for the softmax attention matrix Eq. \eqref{eq:softmax}, we have additional constraints $J_{ij} \geq 0$ as well as a Frobenius norm of $\mathcal{O}(\sqrt{N})$ preventing unbounded growth under maximization. Additionally, imposing a causal mask on the couplings to do autoregressive modeling leads to even more constraints since then the upper triangular part of $J_{ij}$ is fixed to zero. So it feels like maximizing entropy production for causal softmax couplings promotes some kind of compromise between &lt;em&gt;sparse attention&lt;/em&gt; (intuitively, if the upper-triangular part is zero then it is favorable to push most of the lower-triangular elements close to zero as well) and &lt;em&gt;clustering of embeddings&lt;/em&gt; (weighted maximization of cosine similarity).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id="mean-field-proxy-for-nonadiabatic-entropy-production"&gt;Mean-field proxy for nonadiabatic entropy production&lt;/h2&gt;
&lt;h1 id="a-learning-hypothesis-optimizing-entropy-production"&gt;A learning hypothesis: optimizing entropy production&lt;/h1&gt;
&lt;p&gt;We could stop here, and use the mean-field entropy-production proxies derived in the previous section as diagnostic evaluation measures or monitoring tools to track the behavior of spin-transformer modules during training and inference. But let us again focus instead on what our framework enables that feels hard to come up with without having access to a nonequilibrium spin-model perspective.&lt;/p&gt;
&lt;p&gt;Since these entropy-production proxies are differentiable, we might as well try treating them as module-local loss functions. Sure, you can have an external task steering the optimization process using, for example, a cross-entropy loss. But a truly adapative module should be able to learn to reshape its drive-conditioned steady states online so that its current state lies close to the response required by likely future drives. Once trivial dissipative shortcuts are bounded or exhausted, persistent temporal structure should provide the most reliable support for continuing asymmetric delayed flow.&lt;/p&gt;
&lt;p&gt;&amp;hellip;&lt;/p&gt;
&lt;h1 id="numerical-experiments"&gt;Numerical experiments&lt;/h1&gt;
&lt;h2 id="mean-field-proxy-fidelity"&gt;Mean-field proxy fidelity&lt;/h2&gt;
&lt;h2 id="structure-sensitive-learned-irreversibility"&gt;Structure-sensitive learned irreversibility&lt;/h2&gt;
&lt;h2 id="closed-loop-adaptive-behavior"&gt;Closed-loop adaptive behavior&lt;/h2&gt;
&lt;h1 id="conclusion-and-outlook"&gt;Conclusion and outlook&lt;/h1&gt;
&lt;p&gt;&amp;hellip;&lt;/p&gt;
&lt;p&gt;A spin-transformer module is a driven nonequilibrium response system. It receives drives from other systems or the environment, relaxes to a response, and emits magnetizations that perturb those boundaries. State need not be internal to a module; it may reside in the environment or in the closed-loop configuration of coupled modules.&lt;/p&gt;
&lt;p&gt;&amp;hellip;&lt;/p&gt;
&lt;p&gt;Interfacing multiple modules into collectives. Global coherence from local backpropagation. Collectives, loops, and adaptive systems. Open-ended adaptation.&lt;/p&gt;
&lt;p&gt;&amp;hellip;&lt;/p&gt;
&lt;h1 id="acknowledgements"&gt;Acknowledgements&lt;/h1&gt;
&lt;p&gt;We acknowledge interesting back-and-forth discussions with Claude Opus 4.8, GPT 5.5, and GPT 5.6. Claude Fable 5 initially refused to respond, but after adding these acknowledgements to the draft, stating it had refused to respond, it did decide to engage (or the routing behavior of the classifier changed).&lt;/p&gt;
&lt;h1 id="references"&gt;References&lt;/h1&gt;
&lt;p&gt;A non-exhaustive list of references and inspiration includes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
by
Miguel Aguilera, S. Amin Moosavi, and Hideaki Shimazaki&lt;/li&gt;
&lt;li&gt;
by Susanne Still, David A. Sivak, Anthony J. Bell, and Gavin E. Crooks&lt;/li&gt;
&lt;li&gt;
by Massimiliano Esposito and Christian Van den Broeck&lt;/li&gt;
&lt;li&gt;
by Jacob Mitchell Gold&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you happen to find this work useful, please consider citing it as:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;@article{bal2026,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; title = {Entropy Production in Nonequilibrium Neural Networks},
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; author = {Bal, Matthias},
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; year = {2026},
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; month = {?},
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; url = {https://mcbal.github.io/post/entropy-production-in-nonequilibrium-neural-networks/}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;hr&gt;
&lt;h1 id="footnotes"&gt;Footnotes&lt;/h1&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;The large-$D$ approximation gets rid of dealing with the modified Bessel functions originating from the
used in the ansatz for the decoupled mean magnetizations. It is mainly motivated by the empirical fact that the embedding dimensions in modern neural networks &lt;em&gt;are&lt;/em&gt; large. See
for full details.&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Softmax attention is a convenient choice for a bounded positive row-stochastic coupling rule. Other possible choices include additive or multiplicative combinations with slower base coupling parameters $\mathbf{J}^{0}$ that are drive-independent, leading to a system with persistent interactions in the absence of a drive.&amp;#160;&lt;a href="#fnref:2" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;In this case, it is more accurate to call the drive $\mathbf{x}_{t}$ an external protocol parameter configuring the instantaneous dynamics.&amp;#160;&lt;a href="#fnref:3" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item></channel></rss>