Hospital lab values such as serum creatinine and blood urea are not arbitrary time series. Each is a waste molecule that the body makes at a roughly known rate, that is diluted by the body's water, and that the kidneys (or a dialysis machine) remove in proportion to its concentration. What clinicians actually want to track is kidney function, the clearance rate itself. Clearance is never measured directly, and how it falls and recovers during acute illness is poorly understood. Current deep models for clinical time series learn an unconstrained "velocity field" over the raw lab values. They discard the mass balance we do know, and they still cannot see the clearance we care about.
We propose a hybrid model that splits these two parts. A hand-written, physically exact solute balance links the observed labs to a hidden, patient-specific clearance trajectory. A small neural network then learns only how that hidden clearance evolves in response to illness, drugs, and fluids. The claim is narrow and testable. On short, in-distribution forecasts, such a model should roughly match flexible black-box forecasters. When the forecast requires extrapolating to interventions the training data rarely shows (unusually large fluid loads, changed dialysis schedules, longer horizons), it should beat them clearly, because those interventions enter through terms whose form is known rather than learned.
Core Claim
Two patients can show the same creatinine of 2.5 mg/dL on day three and then diverge. In one, a large fluid load has diluted creatinine while true clearance stays low. In the other, the kidney is actually recovering. This is the "crossing trajectories" problem. Trajectory Flow Matching trains neural stochastic differential equations without running a numerical solver and handles crossing paths with a sliding window of past observations. We argue that a better memory for this case is a small set of physiologically meaningful hidden states: clearance and distribution volume. These states are constrained by the observations through mass balance, so the explanation for a divergence lives in variables that have meaning and obey known laws.
Concretely, for creatinine concentration $C(t)$ and urea concentration $B(t)$ in a patient with distribution volume $V(t)$, we write
$$\frac{d(VC)}{dt} = G_C - \big(K(t) + D(t)\big)\,C, \qquad \frac{d(VB)}{dt} = G_B(t) - \big(\alpha K(t) + D_B(t)\big)\,B,$$
The terms are as follows. $G_C$ and $G_B$ are generation rates; $G_C$ has a prior from weight, age, and sex, and $G_B$ is allowed to drift with protein catabolism. $K(t)$ is native kidney clearance, with $\alpha$ a per-patient ratio of urea to creatinine handling. $D(t)$ and $D_B(t)$ are dialysis clearances, nonzero only during recorded sessions. $V(t)$ is updated from charted fluid inputs and outputs. The only learned dynamics are
$$\frac{dK}{dt} = N(K)\,U_\theta\big(K, z, u(t)\big),$$
where $U_\theta$ is a neural network, $z$ holds static patient covariates, $u(t)$ holds time-varying exposures such as vasopressors, nephrotoxic drugs, and contrast, and $N(K)$ is a suppression factor that drives the learned rate to zero as clearance approaches zero, so $K$ can never go negative. The novelty is where the neural network sits. It sits in the hidden organ-function equation, not in the equations for the observed labs. Two observed markers then constrain one shared hidden clearance, and the interventions with known physics (dilution and dialysis) are never left for the network to rediscover.
Relation to Prior Work
Three groups of papers motivate, supply, and constrain this design.
The motivation comes from comparisons of mechanistic and empirical models. Das et al. found that a hand-derived HIV viral-dynamics model forecast simulated patients far better than an LSTM, with a day-180 root mean squared error (RMSE) of 0.09 against 0.165. Their mechanistic model, however, assumed fully known dynamics. We assume only the solute balance is known and leave clearance dynamics open. INSITE discovers sparse symbolic differential equations per patient and argues that a discoverable equation allows extrapolation beyond the treatments seen in training. It reports a 6-step normalized RMSE of 0.79 against 0.92 for the strongest neural causal model on synthetic cancer pharmacology data. INSITE was never run on real records, and it needs the whole system to fit a dictionary of candidate functions. We keep its extrapolation argument but apply it only to the part of the system whose form we actually know.
The method comes from non-negative universal differential equations. That paper multiplies neural reaction terms by a state-dependent factor so that concentrations stay non-negative. It also penalizes the size of the neural output so that the network does not absorb dynamics that are already known. On an 8-equation STAT5 signaling benchmark, this penalty cut normalized mean squared error from about 146 to 12. We reuse both devices, the suppression factor and the output penalty. We move them from small in vitro signaling models to a patient-level hidden state learned across thousands of irregularly sampled patients, which that paper explicitly left open.
The constraints come from latent continuous-time clinical models. These include latent stochastic differential equations on PhysioNet 2012, whose authors note that integrating expert biological equations remains unsolved; SurvLatent ODE, which uses latent dynamics only to produce hazard rates; and CNODE, which aligns patients by learned time shifts and progression speeds. All three learn latent spaces with no physical meaning. Their good performance on irregular sampling is a bar we must meet, not a gap we can assume. TD-HNODE shows how much predefined clinical structure can add on MIMIC-IV, with 85.7% recall for complication milestones. Its structure is a graph of diagnoses rather than a continuous mass balance.
Research Program
We first build a simulator: virtual ICU patients with known clearance trajectories (stable, acute injury with recovery, progressive decline), realistic fluid charts, dialysis sessions, and MIMIC-like sampling of roughly one draw per day. This lets us ask whether $K(t)$, $V$, and $\alpha$ can be recovered at all. Generation and clearance are confounded at steady state, so the study tests whether the population prior on $G_C$, together with the second marker, breaks that confounding. We then fit the hybrid model to adult ICU and hospital stays with at least four creatinine and urea draws in MIMIC-IV. Cohorts are extracted with the open MIMIC-IV processing pipeline, but we do not use its time binning, because the model integrates exact observation times. Fluid balance and dialysis events come from charted data.
Training uses variational inference over the per-patient parameters and initial state. We use a stiff-capable adjoint solver; the system has only a few states, so the solver cost that Trajectory Flow Matching avoids is small here. The output penalty on $U_\theta$ is tuned on validation data. Measurement noise is modeled with a lab-specific error term, and the reported forecast is a predictive distribution, not a point estimate. eICU serves as an external hospital system for transfer testing. Finally, we analyze whether the learned clearance-response function $U_\theta$ shows recognizable behavior, such as a dose-response to vasopressors or delayed recovery after contrast exposure. That analysis is exploratory and is not the main claim.
Baselines
The naive reference is last-value-carried-forward for each lab, plus a per-patient linear trend on log values. Any model that does not beat this at 48-hour horizons is not worth its complexity. A purely mechanistic reference fits the same solute balance per patient but holds clearance constant or lets it change piecewise-linearly, in the spirit of the hand-built model in Das et al.. It tests whether any learned clearance dynamics are needed at all.
The strongest existing competitor is Trajectory Flow Matching, run from its official code on log-transformed labs with the same covariates, fluid, and dialysis inputs. It is the strongest because it was built for irregular ICU time series with crossing paths, and on eICU sepsis it reports a 15–83% error reduction over Neural ODE, Neural SDE, and Latent ODE baselines. It reports no absolute creatinine or urea forecasting figure, and we found no reported result on Lacuna for creatinine or urea trajectory forecasting on MIMIC-IV. Its numbers on our task will therefore be produced by us. We also run a latent stochastic differential equation model in the style of the PhysioNet latent SDE work. Every model gets the same patient splits, the same input streams, and the same hyperparameter search budget in GPU-hours, and every model reports predictive distributions.
Three ablations isolate the key ingredient. The first replaces the mass-balance layer with a neural decoder from the hidden state, which keeps all capacity but removes the physics. The second drops the fluid-volume term. The third removes the output penalty and the suppression factor. Beating the strongest baseline means one of two outcomes. Either the hybrid shows lower continuous ranked probability score and RMSE on the out-of-regime splits with non-overlapping bootstrap intervals, or it shows equal in-distribution error with better calibration. A win only on in-distribution short horizons would not support our claim.
Why not just…?
Why not just log-transform the labs and use Trajectory Flow Matching? A log transform makes predictions positive, so non-negativity alone is not a contribution, and we do not claim it is. The real question is whether known dilution and dialysis terms help when interventions fall outside the training range. A black box can only interpolate the effect of a 6-liter fluid load from the cases it has seen, while the mass balance computes it. The out-of-regime splits below settle this. If flow matching matches the hybrid there, our claim fails.
Why not just estimate each patient's clearance with a simple fit and feed it as a feature to a neural forecaster? This is the most serious threat. On short in-distribution horizons it may well match the hybrid. We include it as a baseline: per-patient constant clearance from the mechanistic fit, appended to the flow-matching inputs. The hybrid differs in that clearance changes over time and is updated jointly with the forecast, and in that interventions act through equations rather than learned associations. If the feature-augmented model also wins out of regime, the honest conclusion is that mechanistic features, not mechanistic structure, carry the value, and we will report it that way.
Why not just use the purely mechanistic model, as in Das et al.? In their HIV setting the full dynamics were known. Here the time course of kidney injury and recovery is precisely what is unknown, and a constant or piecewise clearance cannot anticipate recovery from exposures. The purely mechanistic baseline measures how much the learned clearance dynamics add. If it ties the hybrid, the neural part is unnecessary.
Proposed Experiments and Decisive Checks
On simulated patients, we measure recovery error for the hidden clearance trajectory. We also measure how often clearance and generation are confused when only creatinine is observed versus when both markers are observed. The second marker should markedly reduce that confusion. If it does not, the model is not identifiable, and the clinical results would be uninterpretable.
On MIMIC-IV, we forecast creatinine and urea at 24, 48, and 96 hours from every draw after the third, under three splits. The first is random patients. The second, the out-of-regime split, trains on stays whose cumulative fluid balance and dialysis intensity fall within the central range and tests on the extremes. The third trains on MIMIC-IV and tests on eICU. The decisive pattern for our claim is parity on the random split, a clear advantage on the extreme-intervention split that grows with horizon, and a corresponding loss of that advantage in the ablation without the mass-balance layer.
A crossing-trajectory test selects pairs of patients matched on creatinine at a given time who later diverge. It asks whether the inferred hidden clearance, at the matching time, already separates the pairs better than flow matching's history window does. As a secondary check, we test whether inferred clearance predicts subsequent dialysis initiation better than raw creatinine. That check carries no headline claim, since the file reports only mortality figures for the MIMIC-IV kidney cohort: AUROC 0.87 for a hybrid LSTM and 0.67 for logistic regression in the pipeline paper.
References
- Trajectory Flow Matching with Applications to Clinical Time Series Modelling
- A Comparative study of Neural Networks vs. Mechanistic ODE Models for Health Data Forecasting
- ODE Discovery for Longitudinal Heterogeneous Treatment Effects Inference
- Non-Negative Universal Differential Equations With Applications in Systems Biology
- Generative modeling of clinical time series via latent stochastic differential equations
- SurvLatent ODE : A Neural ODE based time-to-event model with competing risks for longitudinal data improves cancer-associated Venous Thromboembolism (VTE) prediction
- Conditional Neural ODE for Longitudinal Parkinson's Disease Progression Forecasting
- Temporally Detailed Hypergraph Neural ODE for Disease Progression Modeling
- An Extensive Data Processing Pipeline for MIMIC-IV