Do Learned Thermodynamic Models Get the Chaos Right?

Neural networks are now used to learn the dynamics of physical systems that lose energy to heat, such as a double pendulum whose joints warm as they flex. One family of these models, called metriplectic networks, builds the laws of thermodynamics into the architecture. The dynamics are split into a reversible part that conserves entropy and a dissipative part that conserves total energy while entropy rises. These models predict trajectories well. Nobody has checked whether they reproduce how sensitive the real system is to small perturbations: how fast nearby trajectories separate (chaos) and how fast phase-space volume shrinks (dissipation). Both are measured by Lyapunov exponents, the average exponential rates at which infinitesimally close trajectories diverge or converge along each direction of state space.

This proposal makes two claims. First, the thermodynamic split gives the Lyapunov spectrum a structure that generic learned models lack. The rate of volume contraction can be read off from the dissipative part alone, and energy conservation pins one exponent to exactly zero. Second, this structure gives a cheap, short-horizon way to measure and regularize a learned model's contraction rate. It avoids backpropagating through long unrolled Jacobians, which is known to blow up. The practical question is whether a model with low trajectory error can still have the wrong spectrum, and whether the structure lets us fix that more cheaply than generic Lyapunov regularizers can.

Background and the gap

In the geometric picture of thermodynamics developed by Barbaresco (Symplectic Foliation Structures of Non-Equilibrium Thermodynamics as Dissipation Model, Souriau's Symplectic Foliation Model of Carnot's Thermodynamics), state space is sliced into "leaves" on which entropy is constant. In the language of that work, entropy is a Casimir: a quantity that every reversible motion leaves unchanged. Reversible motion stays on a leaf, and dissipation pushes the state across leaves. That work is analytical and never connects the cross-leaf motion to Lyapunov exponents. It motivates the decomposition used here but supplies no numerics.

Efficiently Parameterized Neural Metriplectic Systems (NMS) turns this picture into a trainable model. It learns

$$\dot{x} = L(x)\nabla H(x) + M(x)\nabla S(x),$$

where $x$ is the state, $H$ is energy, and $S$ is entropy. $L$ is a learned antisymmetric matrix (the reversible part), and $M$ is a learned positive semidefinite matrix (the dissipative part). NMS enforces $L\nabla S = 0$ and $M\nabla H = 0$ by projection at $O(n^2)$ cost. NMS supplies the model class this proposal analyzes. It evaluates only trajectory error and thermodynamic consistency, and never examines sensitivity to initial conditions.

On the stability side, three papers each measure or regularize Lyapunov quantities with no physical priors:

  • Fadini et al. differentiate the signed sum of exponents $L_a=\sum_i\lambda_i$ through SVDs of state-transition Jacobians in a differentiable simulator. They report exploding gradients over long horizons.
  • Young and Pugeault lower the maximal exponent of world-model-based controllers with trajectory-variance penalties. They note that world-model error limits the result, and residual chaos remains on Walker Run.
  • Ziyin et al. show for SGD that the sign of a Lyapunov exponent, not moment bounds, predicts convergence.

These three papers motivate using the spectrum as the target quantity. They also constrain the method: any approach that needs long unrolls inherits Fadini's instability.

Core Claim

The claim rests on a standard identity plus the metriplectic structure. For any flow $\dot x = f(x)$, the sum of exponents equals the long-run average of the divergence $\nabla\!\cdot f$ along the trajectory. This is Liouville's formula for how a small volume evolves. In a metriplectic model where the reversible part preserves volume, meaning $\nabla\!\cdot(L\nabla H)=0$, this identity becomes

$$L_a = \lim_{T\to\infty}\frac{1}{T}\int_0^T \nabla\!\cdot\big(M\nabla S\big)(x(t))\,dt,$$

and the volume-preservation condition can be imposed on the learned $L$ by construction. The reversible part is then responsible for rearranging perturbations along leaves, which is where chaotic stretching lives. The dissipative part is solely responsible for net contraction.

Energy conservation adds a second constraint. A perturbation that changes $H$ is neither amplified nor damped, so the spectrum contains an exact zero tied to $\nabla H$. This holds on top of the usual zero along the flow direction.

Many physical benchmarks, such as the damped thermoelastic pendulum, eventually settle to an equilibrium, so their asymptotic exponents are uninteresting. We therefore work with finite-time Lyapunov exponents (FTLEs), computed over windows during the chaotic transient.

The new element is not the Liouville identity itself, which holds for any vector field. It is the attribution of contraction to a specific, separately parameterized dissipative term. That attribution lets us diagnose which part of a learned model is wrong, and regularize contraction by acting only on $M$ with one-step, local computations.

Research Program

Analysis. We will state and prove the spectrum properties above for metriplectic flows: the exact zero from energy conservation, the dissipative-only formula for $L_a$ when $L$ preserves volume, and bounds on the local contraction rate in terms of the spectrum of $M$ and the curvature of $S$. We will also identify when a learned $L(x)$ breaks volume preservation, and add a parameterization that fixes it. One option is to build $L$ from the curl-like forms NMS already uses and restrict it to have zero divergence.

Diagnostics. For each learned model and its ground-truth simulator, we will compute the full FTLE spectrum by standard QR-reorthonormalized tangent propagation. We will also split the tangent space at each point into the component along $\nabla S$ (cross-leaf) and its complement (on-leaf), using the projections NMS computes anyway. This gives on-leaf and cross-leaf growth rates separately.

Regularizer. We will add a contraction-matching loss. It penalizes the mismatch between the model's local divergence $\nabla\!\cdot(M\nabla S)$ and a target contraction rate. The target is estimated from short windows of data, or supplied as a design target for control. This loss needs only one-step Jacobian traces, computed with Hutchinson trace estimators in high dimension, so it never backpropagates through long rollouts. For the maximal exponent, we will regularize only the on-leaf block using short-window FTLEs.

Baselines

Naive reference. The simplest reference point is an unconstrained neural ODE trained on the same trajectories, together with GNODE and GFINN as used in NMS. These are "do nothing about structure or stability" models. They tell us whether low trajectory error alone brings a correct spectrum.

Strongest thermodynamic model. The strongest existing thermodynamic model is NMS itself, trained with its published recipe. On Two Gas Containers, NMS reports an MSE of 0.01, against 0.07 for GFINN and 0.16 for GNODE (Gruber et al.). For the thermoelastic double pendulum and the damped thermoelastic rod, no reported result was found on Lacuna. We will retrain all models ourselves under an identical data split, parameter count, optimizer, and hyperparameter search budget.

Strongest stability competitors. The strongest stability competitors are two generic Lyapunov regularizers applied to an unconstrained neural ODE:

  • a Fadini-style unrolled-SVD penalty on $L_a$ (Fadini et al.), whose best reported effect is a change in $L_a$ from −0.56 to −0.61 on the crawling quadruped;
  • a Young–Pugeault trajectory-variance penalty with sample size 3 (Young and Pugeault).

Each gets the same tuning budget, and each is also applied on top of NMS.

Ablation. The key ablation applies the same one-step divergence loss to the whole vector field of an unconstrained neural ODE, with no dissipative/reversible split. This isolates whether the metriplectic attribution matters, or whether generic Liouville regularization is enough.

What counts as beating a baseline. Our model must lower spectrum error, meaning $L_a$ error and on-leaf maximal-exponent error against ground truth. It must do so without raising trajectory MSE above NMS, and with lower wall-clock time and no gradient blowups relative to the unrolled-SVD penalty.

Why not just…?

Why not just compute the divergence of any neural ODE and regularize that? For the sum of exponents alone, this is a real threat. The Liouville identity holds for any vector field. The ablation in the Baselines section tests it directly. We expect it to match on $L_a$. We expect it to lose on two things the split provides:

  • The generic loss can reach the right contraction by damping energy. Energy conservation is exactly what GNODE-type models violate in NMS's experiments. We will check energy drift under the ablation to see whether this happens.
  • The generic loss gives no separate handle on on-leaf chaos.

If the ablation matches our model on all metrics, we will report that the structure contributes only through energy conservation.

Why not just penalize trajectory variance, as Young and Pugeault do? That method is limited by world-model error, and it left Walker Run chaotic (Young and Pugeault). It also has no mechanism to tell physical chaos, which should be preserved, from spurious chaos, which should be removed. The diagnostics experiment tests this: variance penalties should push the model's spectrum below the true one on the chaotic transient of the double pendulum.

Why not just use a stable port-Hamiltonian network? The stable port-Hamiltonian networks of Roth et al. guarantee convergence by making energy decrease toward a single equilibrium. The thermoelastic benchmarks conserve total energy while converting it to heat. They settle onto a family of equilibria, one per energy level, so the zero exponent is structural. We will include this network and expect it to fit the transients but misplace that zero.

Why not just train on longer multi-step rollouts? Longer multi-step training might repair the spectrum as a side effect. We will train all baselines with multi-step losses at matched compute. If long-horizon training alone closes the spectrum gap, the regularizer is unnecessary, and we will report that.

Proposed Experiments

Benchmarks. We use the three benchmarks from NMS: Two Gas Containers, the thermoelastic double pendulum, and the damped thermoelastic rod. Each has a ground-truth simulator, so exact FTLE spectra can be computed. The double pendulum is the main test because its transient is chaotic before dissipation takes over. The rod tests scaling of the Hutchinson-estimated divergence loss with dimension.

Metrics.

  • trajectory MSE;
  • energy drift and entropy monotonicity;
  • FTLE spectrum error, reported separately for $L_a$, the on-leaf maximal exponent, and the exponent tied to energy conservation;
  • training cost and gradient-norm statistics.

Decisive checks.

  1. Measure the spectrum error of NMS, GFINN, GNODE, and the neural ODE against ground truth. If trajectory-accurate models already have correct spectra, the diagnostic motivation fails.
  2. Check whether the dissipative-only divergence formula predicts ground-truth $L_a$ once volume preservation is imposed on $L$. If it does not, the attribution claim fails.
  3. Check whether the one-step contraction loss matches or beats the unrolled-SVD penalty on spectrum error at a fraction of the cost, and without exploding gradients.
  4. Check whether the ablation without the split does as well. If it does, the thermodynamic structure is not doing the work.