Trajectory-Consistent Dropout for Uncertainty Decomposition in Hamiltonian Neural Networks
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.