# Metriplectic Neural Source Layer

- ID: 856
- Canonical URL: https://synthcore.org/idea/856/metriplectic-neural-source-layer
- API JSON: https://synthcore.org/api/idea/856.json
- API Markdown: https://synthcore.org/api/idea/856.md
- Verification status: failed_benchmark
- Source: [arXiv:2607.13360](https://arxiv.org/abs/2607.13360)
- Category: dynamics
- Solves: stability, accuracy, generalization
- ML areas: world-model, training, dynamics, loss
- Math tags: hamiltonian, dynamical-systems, thermodynamics, linear-algebra
- Ratings: usefulness 8/10; difficulty 6/10; novelty 7/10

## Idea description

Use a neural network to predict only constitutive exchange coefficients, while a fixed skew-symmetric operator generates the conservative part of the update and a structured thermodynamic operator generates the irreversible source. The resulting layer preserves a chosen energy exactly in continuous time and can enforce nonnegative entropy production through a constrained parameterization of exchange rates.

## Mathematical statement

The paper writes an energy-conserving Hamiltonian system as $\partial_t y=\boldsymbol{\mathsf{A}}\,\delta\mathcal{H}/\delta y$, where $y$ is the state, $\mathcal{H}(y)$ is energy, and $\boldsymbol{\mathsf{A}}=-\boldsymbol{\mathsf{A}}^{\top}$ is skew-symmetric. The identity $\mathrm{d}\mathcal{H}/\mathrm{d}t=(\delta\mathcal{H}/\delta y)^{\top}\boldsymbol{\mathsf{A}}(\delta\mathcal{H}/\delta y)=0$ is the conservation mechanism. In the moist model, $B$, $C$, and $D$ are exchange rates for vapour-to-liquid, vapour-to-ice, and liquid-to-ice transfers, while $A$ is the entropy change induced by these exchanges; the extracted formula is $A=-T^{-2}((\mu_v-\mu_l)^2B+(\mu_v-\mu_i)^2C+(\mu_l-\mu_i)^2D)$, where $T$ is temperature and $\mu_v,\mu_l,\mu_i$ are phase chemical potentials. For a generic state $x$, energy gradient $g=\nabla_xH(x)$, skew matrix $K=-K^{\top}$, transfer vectors $s_j$, affinities $a_j=s_j^{\top}\nabla_xS(x)$, and nonnegative rates $r_j\ge0$, use $\dot{x}=Kg+\sum_jr_js_j$ and $\dot{S}=\sum_jr_ja_j$; orient channels or gate rates so that $a_j\ge0$.

## Key formulas

- $$\frac{\partial y}{\partial t}=\boldsymbol{\mathsf{A}}\frac{\delta\mathcal{H}}{\delta y},\qquad \boldsymbol{\mathsf{A}}=-\boldsymbol{\mathsf{A}}^{\top}.$$
- $$\frac{\mathrm{d}\mathcal{H}}{\mathrm{d}t}=\Bigg(\frac{\delta\mathcal{H}}{\delta y}\Bigg)^{\top}\frac{\partial y}{\partial t}=\Bigg(\frac{\delta\mathcal{H}}{\delta y}\Bigg)^{\top}\boldsymbol{\mathsf{A}}\frac{\delta\mathcal{H}}{\delta y}=0.$$
- $$A=-\frac{1}{T^{2}}\Big((\mu_{v}-\mu_{l})^{2}{B}+({\mu}_{v}-\mu_{i})^{2}{C}+({\mu}_{l}-\mu_{i})^{2}{D}\Big).$$
- $$\dot{x}=K\nabla H(x)+\sum_{j=1}^{m}r_j(x)s_j,\qquad r_j(x)=\operatorname{softplus}(f_{\theta,j}(x)),\qquad \dot{S}=\sum_{j=1}^{m}r_j(x)s_j^{\top}\nabla S(x)\ge0.$$

## Implementation notes

Integrate this at the residual-update or latent-dynamics stage of a neural simulator, rather than inside an ordinary unconstrained MLP output head. Represent each sample state as $x$ and provide differentiable scalar functions $H(x)$ and, if available, $S(x)$. Compute $g=\nabla_xH(x)$ with automatic differentiation. Define a fixed skew matrix $K$ or a sparse block operator matching the state variables, and calculate the conservative derivative $v_c=Kg$. Have an MLP $f_\theta(x)$ output one scalar per admissible transfer channel; convert these values to rates with $r=\operatorname{softplus}(f_\theta(x))$. Store fixed transfer vectors $s_j$ whose entries add and remove the appropriate conserved quantities. Compute $v_d=\sum_jr_js_j$ and use $\dot{x}=v_c+v_d$. If the model has chemical potentials, set each affinity to $a_j=s_j^\top\nabla S(x)$ and orient or gate channels so $a_j\ge0$; alternatively use $r_j=\operatorname{softplus}(f_j)\operatorname{softplus}(a_j)$ and include the signed entropy contribution explicitly. For a discrete residual block use $x_{k+1}=x_k+h(v_c+v_d)$, and compare it with a midpoint or symplectic integrator for the $Kg$ term. The paper supplies the algebraic conservation identity; estimate unknown $H$, $S$, or affinities from analytic simulator formulas or automatic differentiation, not a separately trained network. First test on a 2D damped Hamiltonian toy system and then a 1D reaction benchmark, using an unconstrained neural source baseline with the same parameter count. Track one-step error, cumulative relative energy drift $|H_T-H_0|/|H_0|$, entropy violations, and long-horizon rollout error. Success means comparable validation error with orders-of-magnitude smaller energy drift and fewer unstable rollouts at the same step size.

## Verification

- Status: failed_benchmark
- Mechanism evidence: yes
- Mechanism confirmed: no
- Practical verdict: inconclusive
- Verdict: Built and numerically verified a metriplectic toy layer with a fixed skew conservative operator and affinity-gated nonnegative source rates. The skew identity was exact to floating point (max |gᵀKg|=0), explicit-Euler energy drift matched the predicted (1+h²)^(T/h)-1 law with maximum ratio error 1.9e-13, and entropy production had zero violations across 15,000 gated samples while scaling linearly with source strength. The mechanism manifested clearly, although this MVP does not establish a neural-network training or accuracy win.

### Mechanism check

- Verdict: Built and numerically verified a metriplectic toy layer with a fixed skew conservative operator and affinity-gated nonnegative source rates. The skew identity was exact to floating point (max |gᵀKg|=0), explicit-Euler energy drift matched the predicted (1+h²)^(T/h)-1 law with maximum ratio error 1.9e-13, and entropy production had zero violations across 15,000 gated samples while scaling linearly with source strength. The mechanism manifested clearly, although this MVP does not establish a neural-network training or accuracy win.
- Confidence: 8/10
- Limitations: Only a 2D analytic toy system was tested. No learned MLP, dataset, parameter-matched training experiment, midpoint or symplectic integrator, long-horizon accuracy benchmark, or higher-dimensional thermodynamic simulator was evaluated; the dissipative source is not energy-conserving in this toy construction.

### Practical benchmark

- Paired seeds: 8
- Baseline mean: 0
- Idea mean: 0
- p-value: 0.078
- Paired wins: 3/8
- Benchmark verdict: no significant win

## Artifacts

- [bench_report.json](https://synthcore.org/code/158/bench_report.json)
- [report.md](https://synthcore.org/code/158/report.md)
- [report_bench_2026-08-30T182223.md](https://synthcore.org/code/158/report_bench_2026-08-30T182223.md)
- [results.json](https://synthcore.org/code/158/results.json)
- [stage2_metriplectic_bench.py](https://synthcore.org/code/158/stage2_metriplectic_bench.py)
- [verify_metriplectic.py](https://synthcore.org/code/158/verify_metriplectic.py)
- [Download all files as ZIP](https://synthcore.org/download/158)

## Disclaimer

AI-generated research hypothesis, automatically tested. Not peer-reviewed.
