Trajectory-Consistent Dropout for Uncertainty Decomposition in Hamiltonian Neural Networks

Yuki Tachibana, S RobertsNeurIPS 2026

TL;DR

When you plug standard Monte Carlo dropout into a physics-informed Hamiltonian Neural Network, resampling neurons at every integration step quietly breaks energy conservation—like changing the laws of gravity mid-orbit. By simply freezing one dropout mask per entire trajectory, this paper restores physical coherence and unlocks a clean way to tell why a forecast is uncertain: is your sensor noisy, or is your model flying blind in unfamiliar physics?

What Problem Does This Paper Address?

Imagine forecasting a satellite’s orbit using a learned surrogate model. If your prediction gets fuzzy, knowing that it’s uncertain isn't enough—you need to know why. Is your initial radar reading slightly off (an aleatoric / state-estimation problem, solved by better sensors), or has the satellite drifted into a gravitational perturbation the model never saw in training (an epistemic / model-ignorance problem, solved by gathering new training data)?

To model conservative physical systems, researchers love Hamiltonian Neural Networks (HNNs). Instead of predicting raw state updates, HNNs learn a single energy function (the Hamiltonian) and step forward in time using a geometric "leapfrog" integrator, guaranteeing bounded, energy-conserving rollouts. Meanwhile, Monte Carlo (MC) dropout—randomly zeroing out neurons at test time to get an ensemble of predictions—is the go-to, single-model trick for estimating uncertainty.

Here’s the catch: standard MC dropout ("Fresh-mask MC") resamples its random mask at every single forward pass. Inside a leapfrog integrator, that means every tiny sub-step evaluates a slightly different subnetwork—a different Hamiltonian. The trajectory no longer obeys one fixed set of physical laws. Time-translation symmetry shatters, step-by-step error cancellations fail, and energy drifts away in a process akin to "stochastic heating." Worse, this step-wise noise scrambles the distinction between initial-state sensitivity and model ignorance.

Methods

The authors propose trajectory-consistent dropout (implemented as Fixed-mask MC). While fixing dropout masks across time exists in recurrent sequence models ("locked dropout"), the novelty here is applying this contract to geometric integration and pairing it with an initial-condition grid.

Figure 1: Mechanism of trajectory-consistent dropout. Fresh-mask MC dropout changes the mask inside a rollout, so the integrator no longer follows a single sampled Hamiltonian. Fixed-mask dropout samples one mask per rollout, producing a coherent sampled-Hamiltonian trajectory. The bottom panel shows how the initial condition (IC) ensemble separates epistemic variance Varepi (across masks at fixed initial condition) from aleatoric variance Varalea (across initial conditions after mask averaging). See Equation (4).
  1. Finite Mask Bank & Trajectory Locking: At initialization, the model pre-samples and stores a finite bank of $M$ Bernoulli dropout masks. During an inference rollout, the model picks one mask $m$ and holds it fixed across every leapfrog sub-step from start to finish. Each rollout is once again a deterministic, energy-conserving trajectory of a single sampled Hamiltonian $H_m$.
  2. 2D Uncertainty Grid (IC $\times$ Mask Ensemble): Because each mask’s trajectory is deterministic given a starting point, the authors cross $M$ masks with $N$ slightly perturbed initial conditions (ICs). Applying the law of total variance across this $N \times M$ grid cleanly splits total predictive variance into two operational buckets:
  3. Epistemic variance ($\text{Var}_{\text{epi}}$): How much the $M$ masks disagree when launched from the exact same starting state.
  4. Aleatoric variance ($\text{Var}_{\text{alea}}$): How sensitive the mask-averaged trajectory is to initial-state perturbations.

Datasets

Rather than static datasets, the authors evaluate across a controlled ladder of simulated dynamical systems (plus an exploratory hidden-parameter benchmark in the appendix) designed to stress-test out-of-distribution (OOD) physics shifts:

  • Coupled Pendulum: Classical phase-space dynamics where OOD shifts are induced cleanly by sweeping a single scalar—the mass ratio $r = m_2/m_1$—outside the training range.
  • Spring Chain: A classical system with structured pairwise interactions governed by a stiffness/connectivity matrix, testing shifts in multi-body couplings.
  • Transverse-Field Ising Model (TFIM): Latent quantum wavefunction dynamics ($\psi = q + ip$) driven by an external transverse-field control $g$, testing whether the decomposition survives beyond classical mechanics.

Key Insights and Ideas

  • Standard dropout causes "stochastic heating" in symplectic integrators: Even though every individual sub-step under a fresh mask is mathematically symplectic, switching Hamiltonians mid-flight destroys the shared modified energy that leapfrog integrators rely on to stay bounded.
  • Fresh masks hide model ignorance inside sensor noise: When fitting an initial-condition noise scale $\hat{\sigma}$ on validation data, Fresh-mask MC inflates $\hat{\sigma}$ to swallow its own step-wise model errors. As a result, when the model encounters unfamiliar OOD physics, it blames the initial state rather than flagging model ignorance!
  • Single-run efficiency with ensemble semantics: Deep Ensembles (training 5 separate networks) naturally preserve trajectory consistency, but cost $5\times$ the training and storage. Fixed-mask MC gets coherent per-trajectory physics from a single training run.

Key Results

  • Energy Conservation: Fixed-mask MC slashes the self-consistency drift of its sampled Hamiltonian down to deterministic-network levels (e.g., $0.00432$ vs. $0.157$ for Fresh-mask MC on Coupled Pendulum; $0.108$ vs. $1.751$ on Spring Chain). Over 1000-step rollouts, Fresh-mask MC accumulates $1.9\times$ to $4.7\times$ more physical energy error than Fixed-mask MC.
  • Honest Noise Calibration: Where true data IC noise is $\sigma = 0.1$, Fixed-mask MC recovers validation scales closest to truth ($\hat{\sigma} = 0.250$ on Pendulum, $0.130$ on Spring Chain vs. $0.331$ and $0.483$ for Fresh-mask MC). Evaluated at the true $\sigma = 0.1$, Fixed-mask MC achieves significantly better Gaussian negative log-likelihoods across both classical systems (e.g., OOD G-NLL of $4.739$ vs. $14.45$ on Pendulum).
  • OOD Detection: Pushing the Coupled Pendulum out of distribution causes Fixed-mask MC’s epistemic share of variance ($\alpha$) to jump by $+0.32$ (from $0.203$ to $0.524$), carrying $\sim 19\times$ more variance on the model axis than Fresh-mask MC, whose epistemic share barely budges ($+0.03$).
  • Quantum Transfer: On TFIM, the variance split remains clearly visible and yields better true-noise OOD likelihood ($-1.250$ vs. $3.343$), though raw point-prediction (MSE) wins are system-dependent.

Limitations and Future Work

The authors are refreshingly candid about boundaries:

  • Scope of Guarantees: Their theoretical conservation guarantee covers only conservative, separable Hamiltonians integrated with leapfrog—omitting dissipative systems, external forcing, trajectory process noise, and partial observability.
  • Not a Universal Accuracy Bullet: Fixed-mask MC is about interpretable uncertainty and physical coherence, not guaranteed MSE dominance on every system (as seen in the TFIM experiments).
  • Open Loop Only: While the epistemic-vs-aleatoric split offers a clear rule of thumb (retrain/abstain vs. filter/sense), actually closing the loop in an automated decision-making policy remains future work.

Summary updated

Abstract

Hamiltonian Neural Networks (HNNs) produce stable long-horizon rollouts by integrating a learned Hamiltonian with a symplectic scheme. Monte Carlo dropout (Fresh-mask MC) conflicts with this per-trajectory interpretation because resampling the dropout mask inside a leapfrog integrator means successive sub-steps follow different subnetworks, so a single MC rollout no longer corresponds to any one sampled Hamiltonian. We propose trajectory-consistent dropout, implemented as Fixed-mask MC, where each stochastic rollout selects one mask from a finite bank and reuses it across the full integration path. This restores a coherent per-rollout Hamiltonian sample and makes uncertainty decomposition operational. Crossing the mask axis with an initial-condition ensemble separates epistemic uncertainty, the model's own, from aleatoric uncertainty, the sensitivity to the initial state. Experiments on classical dynamical systems show three benefits. First, sampled trajectories conserve energy better over long horizons, with 1.9--4.7 times less physical energy drift than fresh-mask rollouts. Second, the method achieves a better aleatoric-epistemic decomposition. Fixed-mask MC recovers the initial-condition noise closest to its true scale and has the best likelihood at that scale, whereas fresh-mask baselines fit a larger noise scale that absorbs model error into the aleatoric term. Third, because model error stays on the epistemic axis, epistemic uncertainty responds to distribution shift. Out of distribution on a coupled pendulum, the epistemic share of predictive variance rises by 0.32 for Fixed-mask MC but by only 0.03 for Fresh-mask MC, whose epistemic variance is about 19 times smaller. On a transverse-field Ising model the decomposition carries over to latent quantum dynamics, while predictive gains remain system-dependent. Fixed-mask MC thus gives trajectory-consistent, physically interpretable uncertainty from a single training run.
BibTeX
@inproceedings{tachibana2026trajectory,
  author = {Yuki Tachibana and S Roberts},
  title = {{Trajectory-Consistent Dropout for Uncertainty Decomposition in Hamiltonian Neural Networks}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=Vuh3ZNdgF6},
}
Figure