Stoichiometric Message Passing for Conservation-Exact Metabolic Dynamics

Neural models of cellular metabolism predict how metabolite concentrations and reaction rates change when enzymes are perturbed, genes are knocked out, or nutrients shift. Like learned simulators in fluid dynamics, these models can fit training data well and still break basic physical laws. They can create carbon from nothing, drive concentrations negative, or slowly drift away from conserved totals when run forward step by step. Physics has a structural fix for this. In graph networks whose edge messages are antisymmetric (whatever leaves node $i$ enters node $j$) and whose node updates are linear in those messages, conservation holds exactly by construction. Metabolism also has a known conservation structure, the stoichiometric matrix, which lists how many molecules of each metabolite each reaction consumes or produces. That matrix comes from curated biological reconstructions. To our knowledge, nobody has used it to build a learned graph model that is exactly conservative.

We propose stoichiometric message passing, a graph architecture with two node types, metabolites and reactions. Every learned component, including the global attention that coordinates distant pathways, is only allowed to output reaction rates. Metabolite states are then updated solely by multiplying those rates by the stoichiometric matrix. This one placement decision makes three things fit together that usually conflict. The model gets long-range expressivity from a hybrid local-global design. It satisfies every conservation law implied by the curated reaction network exactly, for any parameter values. It can take biologically meaningful input features, such as steady-state fluxes from flux balance analysis and thermodynamic driving forces, without any of them being able to break conservation.

Core Claim

Let $x \in \mathbb{R}^m$ be metabolite concentrations, $S \in \mathbb{Z}^{m \times r}$ the stoichiometric matrix of internal reactions, $E$ the matrix mapping exchange reactions (uptake, secretion, biomass drain) to metabolites, and $v_\theta, u_\theta$ the learned internal and exchange rates. The model's dynamics are

$$\frac{dx}{dt} = S\, v_\theta(x, z) + E\, u_\theta(x, z),$$

where $z$ collects context: enzyme levels mapped from expression through gene-protein-reaction rules, flux balance analysis solutions, and thermodynamic features. Let $L$ be any matrix whose rows span the left null space of $S$, meaning $LS = 0$. Each row of $L$ is a conserved group of atoms, such as the total adenosine pool or total NAD. Applying $L$ to both sides gives

$$\frac{d}{dt}(Lx) = L E\, u_\theta.$$

So every conserved group changes only through explicitly modeled exchange. This holds for any network $v_\theta$, however nonlinear, and however much global attention it contains.

This result generalizes the FluxGNN theorem from mesh edges to reaction hyperedges. Graph Neural PDE Solvers with Conservation and Similarity-Equivariance proves that antisymmetric messages with linear node updates give exact local conservation on PDE meshes. A reaction with stoichiometry $A + B \to 2C$ is the multi-node analogue of an antisymmetric edge.

The model also has to handle open systems. CiGNN, in Conservation-informed Graph Learning for Spatiotemporal Dynamics Prediction, splits messages into a conservative channel and a symmetric source channel. Our $E u_\theta$ term plays the source role, but it is restricted to reactions that the reconstruction declares as exchange. Sources therefore cannot leak into internal mass balance. This answers the closed-versus-open tension that strictly conservative mesh solvers leave unresolved.

Our empirical claim is specific, and it could fail. We expect an unconstrained model to match or beat this one on in-distribution one-step error. We expect stoichiometric message passing to win under unseen enzyme perturbations, unseen knockouts, and long rollouts. In those regimes, unconstrained and softly penalized models should accumulate conservation violations that translate into trajectory error.

Research Program

The architecture has three parts. First, a local encoder runs message passing on the bipartite metabolite-reaction graph, so each reaction sees its substrates, products, and enzyme features. Second, a global module applies attention over coarse pathway tokens. Each token pools the reactions of one curated subsystem, such as glycolysis or the TCA cycle. This captures cross-talk and allosteric-like coordination, and its cost is quadratic in the number of subsystems (tens) rather than reactions (thousands). That design responds to the scaling limitation of full attention flagged for genome-scale networks. Third, a rate head turns the combined representation into each reaction's rate. We parameterize each rate as forward minus backward. Each direction is multiplied by a saturating function of its substrate concentrations, so a reaction cannot consume a metabolite that is absent. This keeps concentrations nonnegative in continuous time, and a positivity-preserving integrator keeps them nonnegative in discrete steps.

The global module follows the sequential GNN-then-Transformer pattern of GraphTrans in Representing Long-Range Context for Graph Neural Networks with Global Attention. GraphTrans added a 7.1% accuracy gain on NCI1 from a Transformer stacked on a shallow GNN. Our difference is that attention outputs are routed only into rate space.

Physics-informed feature augmentation enters through $z$. Each reaction receives three inputs: its flux balance analysis flux under the current exchange bounds, the flux-variability range, and an estimate of its thermodynamic driving force. FBA, here, is the linear program that finds steady-state fluxes satisfying $Sv = 0$. This follows Dynamics-Based Feature Augmentation of Graph Neural Networks for Variant Emergence Prediction, where analytically derived features beat a physics-loss model by a wide margin (MedMedAE 1.27 versus 2.24 for a loss-regularized GCN). It also follows PhAST, which enriched atom inputs with physical descriptors. The constraint-based flux graphs of Flux-dependent graphs for metabolic networks provide the recipe for computing context-specific FBA mass flows. In that work the flows were analyzed with classical network tools. Here they become learnable inputs. Because the features enter only the rate network, a misspecified feature can hurt accuracy but can never violate conservation. This addresses the known risk of handcrafted feature bias.

Biological prior integration supplies the graph itself. The graph is a curated stoichiometric reconstruction rather than a co-expression or protein-interaction graph. This is a different kind of prior from the one used by GEARS and DYNAMO. Those models use relational priors that improve transfer but impose no conservation; DYNAMO, for example, retains 51% of native performance from K562 to RPE1, against 30% for unstructured models. It also differs from Biological Pathway Informed Models with Graph Attention Networks (GATs), which uses signed edges on a three-gene loop with unconstrained outputs. The closest biological work is SNODEP (PREDICTING TIME-VARYING METABOLIC DYNAMICS USING STRUCTURED NEURAL ODE PROCESSES). SNODEP predicts flux and balance with a latent neural ODE trained by MSE against scFEA surrogates, so its predictions can violate $S v$ mass balance. Our model inverts that design: balance is a structural identity rather than a regression target.

We take seriously one constraining result. DYNAMO reports a "regularization paradox," in which an unconstrained DirectMLP beat the structured model on its native cell line. We expect the same pattern, and we design the evaluation around out-of-distribution and rollout regimes rather than hiding it.

Baselines

The naive reference point is a persistence or steady-state predictor. For dynamics, it holds concentrations at their last observed values. For steady-state flux, it returns the plain FBA solution. Any learned model that cannot beat FBA alone on held-out perturbations has learned nothing beyond the prior.

The strongest unconstrained competitor is a deep feedforward network on the same enzyme and feature inputs, following Metabolic Fluxes Using Deep Learning Based on Enzyme Variations. On the Entamoeba histolytica glycolysis dataset, that work reports RMSE ≤ 0.01 for its DNN, against roughly 0.096 for Cubist and 30.663 for PLS. On that dataset's in-distribution split, matching RMSE ≤ 0.01 while driving the internal mass-balance residual $\|S v\|$ to machine precision would count as a tie that adds guarantees. Beating it requires lower error on held-out enzyme-variation regimes and on the 29 wet-lab points.

For dynamics, the strongest structured competitor is SNODEP, retrained on our trajectories. Its paper gives no absolute number for the stem-cell data (Ori et al., 2021): no reported result found on Lacuna for SNODEP MSE in absolute terms. We will therefore report it against our own runs.

To isolate the key ingredient, a conservation-agnostic twin uses the identical local-global network and features. Instead of updating states through $S v_\theta$, it predicts $dx/dt$ directly, with an optional soft penalty on $L\,dx/dt$. This is the PINN-style alternative that underperformed in the variant study.

Two further ablations isolate the other components. One removes global attention, leaving local stoichiometric message passing only. The other removes the FBA and thermodynamic features. Every model gets the same splits, the same hyperparameter search budget (equal trials, selected on the same validation split), and matched parameter counts within 10%.

Why not just…?

Why not just project an unconstrained model's output onto the conservation subspace? This is the most serious threat. Guaranteeing Conservation Laws with Projection in Physics-Informed Neural Networks and Deep Conservation show that post-hoc projection enforces linear invariants exactly, and here $L$ is computable from $S$. Projection does preserve $Lx$. It does not produce a reaction-rate vector, it does not prevent negative concentrations, and it can move mass between metabolites that no reaction connects. That last effect is a stoichiometric impossibility that $Lx$ alone does not detect. We include a projected twin as a baseline. We report $Lx$ drift, negativity events, and the number of time steps whose state change lies outside the span of $S$ and $E$. If the projected twin matches our model on accuracy and these extra diagnostics, the contribution shrinks to a cleaner parameterization, and we will say so.

Why not just fit a classical kinetic model with Michaelis–Menten rate laws? Kinetic models are exactly conservative and interpretable, but they need per-reaction parameters that are rarely measured. SNODEP's authors note that dynamic FBA needs hand-specified objectives and kinetic parameters that do not scale to noisy single-cell data. Our model is a kinetic model whose rate laws are learned, so a fitted mechanistic model is a natural lower-capacity comparison. On the synthetic benchmark, where the true rate laws are Michaelis–Menten, the fitted mechanistic model is an oracle-form upper bound. We report how close we come to it.

Why not just use a local GNN on the reaction graph, with no global attention? Small networks like E. coli core may not need long-range coordination. If so, the no-attention ablation will tie, and the hybrid component is unnecessary there. We test this on held-out perturbations whose effects propagate across subsystems, such as knockouts upstream of the TCA cycle evaluated on biomass-precursor pools. This is the regime where over-squashing should hurt a shallow local model, and where the evidence from GraphTrans on NCI1 suggests a gain.

Proposed Experiments

The first testbed is the Entamoeba histolytica glycolysis dataset: 68,950 synthetic instances plus 29 wet-lab points. The task is to predict steady-state pathway flux from enzyme variation. We use a random split for comparability with the reported DNN result, and an extrapolation split that holds out the highest and lowest quantiles of each enzyme. Metrics are flux RMSE and the internal mass-balance residual $\|S v\|$. Unconstrained baselines should show nonzero residuals growing under extrapolation, while our model's residual stays at numerical zero.

The second testbed is synthetic dynamics on the E. coli core reconstruction used in Flux-dependent graphs for metabolic networks. We simulate trajectories from randomized Michaelis–Menten parameters under aerobic and anaerobic exchange bounds and single-reaction knockouts. No published learned-model numbers exist on Lacuna for this setup, so all baselines are run by us. Training covers short horizons. Evaluation uses rollouts 10× longer, on unseen knockouts. We report trajectory RMSE, drift of each conserved group relative to its integrated exchange, negativity rate, and error versus horizon.

The decisive check is the shape of the error-versus-horizon curves, compared against the conservation-agnostic twin and the projected twin. If our curve stays flat while the agnostic twin's conserved-group drift grows and its trajectory error tracks that drift, the hard structure is causally responsible for the gain. If both curves are flat, conservation was not the binding failure on this system.

The third testbed is the stem-cell differentiation single-cell data (Ori et al., 2021) on SNODEP's four KEGG pathways. We compare against SNODEP at the low sampling frequencies where it was strongest. Because scFEA targets are themselves surrogates, results on this testbed count as evidence of consistency, not of accuracy. As an external check, we compare predicted relative flux splits against 13C-derived bacterial flux maps computed with WUFlux. This is the kind of experimental ground truth that SNODEP's evaluation lacks, and it is where a conservation-exact model should show whether exactness also brings it closer to measured biology.