# Stoichiometric Conservation Head

- ID: 857
- Canonical URL: https://synthcore.org/idea/857/stoichiometric-conservation-head
- API JSON: https://synthcore.org/api/idea/857.json
- API Markdown: https://synthcore.org/api/idea/857.md
- Verification status: mech_ok_no_baseline
- Source: [arXiv:2607.13360](https://arxiv.org/abs/2607.13360)
- Category: architecture
- Solves: accuracy, stability, generalization
- ML areas: world-model, loss, training
- Math tags: linear-algebra, dynamical-systems, optimization
- Ratings: usefulness 7/10; difficulty 3/10; novelty 6/10

## Idea description

Replace a network head that independently predicts coupled physical source terms with a low-dimensional rate head followed by a fixed stoichiometric map. This makes conservation of total mass or other linear invariants exact by construction and leaves the network responsible only for learning the kinetics of admissible exchange channels.

## Mathematical statement

The paper's learned map is $(\rho,\eta,q_v,q_l,q_i)\mapsto(\tilde B,\tilde C,\tilde D)$, where $B,C,D$ are pairwise phase-exchange rates. The source operator places equal and opposite coefficients in the phase rows, so every transfer preserves the sum of the participating phase masses. Abstract this as a stoichiometric matrix $N\in\mathbb{R}^{n\times m}$ whose column $s_j$ contains the signed additions and removals caused by transfer channel $j$. With rate vector $r\in\mathbb{R}^m$, the source is $\dot z=Nr$. Any invariant $c^{\top}z$ satisfying $c^{\top}N=0$ is conserved exactly, independently of network weights. For vapour-liquid-ice exchange, $N=[(-1,1,0)^{\top},(-1,0,1)^{\top},(0,-1,1)^{\top}]$, corresponding to $B,C,D$; therefore $[1,1,1]N=0$. Nonnegative rates are obtained with $r=\operatorname{softplus}(f_\theta(x))$, and donor availability can be enforced by multiplying each rate by the donor mass fraction.

## Key formulas

- $$\begin{bmatrix}\dot q_v\\ \dot q_l\\ \dot q_i\end{bmatrix}=\underbrace{\begin{bmatrix}-1&-1&0\\1&0&-1\\0&1&1\end{bmatrix}}_{N}\begin{bmatrix}B\\C\\D\end{bmatrix},\qquad [1,1,1]N=0.$$
- $$\dot z=N r_\theta(x),\qquad r_{\theta,j}(x)=\operatorname{softplus}(f_{\theta,j}(x)),\qquad c^{\top}N=0\ \Longrightarrow\ \frac{\mathrm d}{\mathrm dt}(c^{\top}z)=0.$$
- $$r_B=\operatorname{softplus}(f_B(x))q_v,\qquad r_C=\operatorname{softplus}(f_C(x))q_v,\qquad r_D=\operatorname{softplus}(f_D(x))q_l.$$

## Implementation notes

Apply this to the final source-term head of any network predicting coupled quantities such as reaction kinetics, mixture composition changes, material exchanges, or multi-species dynamics. Let the MLP consume the local state $x$ and output three unconstrained logits $(u_B,u_C,u_D)$. Convert them to rates using $r_B=\operatorname{softplus}(u_B)q_v$, $r_C=\operatorname{softplus}(u_C)q_v$, and $r_D=\operatorname{softplus}(u_D)q_l$, with nonnegative state variables clamped by a small epsilon for numerical safety. Multiply the rate vector $r$ by the fixed matrix $N$ to produce all phase derivatives; never expose independent phase derivatives as trainable outputs. If the full state includes density, energy, or momentum, augment each column of $N$ with the corresponding mass and energy bookkeeping entries, and compute any thermodynamic entropy component analytically from the predicted rates. For a finite time step $h$, use $z_{t+1}=z_t+hNr$ and project only for floating-point roundoff, not as the primary conservation mechanism. Compute the nullspace of $N^\top$ once with an SVD to enumerate all exact linear invariants and assert that $\|N^\top c\|<10^{-8}$. Train with ordinary trajectory MSE plus optional positivity penalties, and compare against a baseline that predicts phase derivatives independently. The first cheap experiment is a three-species synthetic reaction dataset generated from known nonlinear rates, followed by a small neural ODE on a 1D advection-reaction problem. Evaluate validation error, negative-concentration frequency, invariant drift, and rollout stability. The expected signal is zero systematic mass drift and fewer invalid states at equal parameter count, with equal or lower sample complexity because the learner cannot waste capacity violating conservation.

## Verification

- Status: mech_ok_no_baseline
- Mechanism evidence: yes
- Mechanism confirmed: yes
- Practical verdict: inconclusive
- Verdict: Built a fixed stoichiometric conservation head with softplus rates and donor-availability gating, alongside an equal-size independent derivative baseline. The quantitative predictions were confirmed: ||N^T c||=0, constrained Euler mass drift stayed at 5.4e-20 to 4.4e-16 across h=1e-4..1, and independent Gaussian drift had fitted slope 1.3809 versus predicted 1.382. The mini-experiment also showed derivative MSE 0.000227 versus 0.003140, zero versus 19 negative rollout entries, and mass drift 1.2e-7 versus 0.0317; this is a clear mechanism-level win, though it is only a small synthetic local-dynamics test.

### Mechanism check

- Verdict: Built a fixed stoichiometric conservation head with softplus rates and donor-availability gating, alongside an equal-size independent derivative baseline. The quantitative predictions were confirmed: ||N^T c||=0, constrained Euler mass drift stayed at 5.4e-20 to 4.4e-16 across h=1e-4..1, and independent Gaussian drift had fitted slope 1.3809 versus predicted 1.382. The mini-experiment also showed derivative MSE 0.000227 versus 0.003140, zero versus 19 negative rollout entries, and mass drift 1.2e-7 versus 0.0317; this is a clear mechanism-level win, though it is only a small synthetic local-dynamics test.
- Confidence: 9/10
- Limitations: Not tested on the original paper dataset, advection-reaction dynamics, thermodynamic energy/momentum bookkeeping, long-horizon stability, or larger architectures. The independent baseline was trained on local derivative supervision rather than a full neural-ODE trajectory objective.

### Practical benchmark

- Paired seeds: 8
- Baseline mean: 0
- Idea mean: 0
- p-value: 0.0081
- Paired wins: 8/8
- Benchmark verdict: idea better (significant)

## Artifacts

- [bench_report.json](https://synthcore.org/code/346/bench_report.json)
- [bench_run.py](https://synthcore.org/code/346/bench_run.py)
- [experiment.py](https://synthcore.org/code/346/experiment.py)
- [report.md](https://synthcore.org/code/346/report.md)
- [report_bench_2026-08-31T014951.md](https://synthcore.org/code/346/report_bench_2026-08-31T014951.md)
- [results.json](https://synthcore.org/code/346/results.json)
- [Download all files as ZIP](https://synthcore.org/download/346)

## Disclaimer

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