arXiv:2611.03451cs.LGNov 2026

Manuscript Offprint

arXiv:2611.03451

Improving Hamiltonian Learning through Local Energy Decomposition

Yaojun Li, Yulong Yang, Christine Allen-Blanchette

ABSTRACT

Hamiltonian neural networks provide a principled framework for learning conservative dynamics. A scalar Hamiltonian is parameterized by a neural network and the vector field is derived using Hamilton's equations. However, preserving Hamiltonian structure does not guarantee that the energy function itself is represented accurately. When modeled by a conventional multilayer perceptron, the Hamiltonian inherits the spectral bias of coordinate-based neural representations, favoring smooth over fine-scale structure. These fine-scale errors can be amplified by differentiation when computing the dynamics. To address this limitation, we introduce Local Multiscale Hamiltonian Neural Network (LM-HNN), which restructures the Hamiltonian according to its physical interaction structure. LM-HNN decomposes the energy into kinetic and potential components and represents them as sums of shared local functions over multiple interaction neighborhoods. This replaces a single high-dimensional approximation problem with lower-dimensional, reusable interaction laws, making fine-scale energy structure easier to resolve while preserving Hamiltonian dynamics. Across low-dimensional, interacting, and fast-slow systems, LM-HNN consistently achieves more accurate Hamiltonian derivatives and long-horizon rollouts than competing structure-preserving models, while substantially extending the effective spectral range of the learned energy. The same structured representation also generalizes more reliably to energy levels not observed during training. These results show that accuracy depends on the Hamiltonian representation as well as its structure, and that incorporating locality, decomposition, and shared interaction laws provides a simple and effective route to more accurate and generalizable Hamiltonian learning.

1 INTRODUCTION

Learning Hamiltonian dynamics can be challenging when the underlying energy function contains fine-scale variations. Hamiltonian neural networks (HNNs) obtain a vector field by differentiating a learned scalar energy Hθ(q,p)H_\theta(q, p), making the quality of this representation central to prediction (Greydanus et al., 2019). A standard HNN uses a global Hamiltonian representation, where a single network maps the full phase-space state to the total energy. Standard HNNs therefore inherit the spectral bias (Rahaman et al., 2019; Tancik et al., 2020) of coordinate networks, learning low-frequency energy variations more readily than fine-scale structure. Since the energy is differentiated, unresolved high-frequency components can cause substantial vector-field errors even when their energy amplitude is small, and these errors can accumulate during rollout (Sitzmann et al., 2020; Gruver et al., 2022).

Efforts to address spectral bias have improved the recovery of fine-scale signals by changing coordinate encodings and activation functions (Tancik et al., 2020; Sitzmann et al., 2020). These modifications change which frequencies a network learns efficiently, making them natural candidates for improving Hamiltonian approximation. Hamiltonian learning has also benefited from decomposing the energy across temporal scales (Li et al., 2026). However, improving frequency resolution or separating timescales does not directly encode how the energy is assembled from physical interactions. A global Hamiltonian model must still infer which state variables interact, how their energy contributions combine, and which interaction laws recur across the system.

Encoding these interactions explicitly allows fine-scale energy variation to be learned through local functions, each depending on only a small subset of the state variables. Many mechanical systems admit a kinetic–potential decomposition (Goldstein et al., 2002; Marion, 2013), and finite-range potentials can be represented as sums of local energy contributions, a principle established in neural potential-energy models (Behler & Parrinello, 2007). Repeated instances of the same interaction provide supervision for a shared local function. This suggests a mechanism for mitigating spectral bias by reducing the dimensionality of the functions being learned and concentrating shared capacity on the underlying interaction laws. The same factorization can support generalization when globally unseen states contain local configurations similar to those encountered during training.

Building on these insights, we introduce the Local Multiscale Hamiltonian Neural Network (LM-HNN). The model learns shared local functions for kinetic and potential energies, then sums their outputs to form the total Hamiltonian. Evaluating these functions over several neighborhood radii accommodates different interaction ranges without committing to a single radius in advance. This local factorization targets spectral bias by concentrating each network's capacity on a lower-dimensional interaction law and its fine-scale energy variations. Aggregating the learned contributions also supports generalization to unseen energy levels when new total energies arise from combinations of local configurations represented during training. The assembled scalar Hamiltonian generates the dynamics through Hamilton's equations, preserving Hamiltonian structure by construction. For systems with repeated interactions and fixed neighborhood sizes, parameter sharing also makes the parameter count independent of system size. We evaluate these properties through spectral diagnostics, tests at unseen energy levels, and prediction accuracy across six conservative systems. Comparisons with structure-preserving baselines and spectral interventions show that LM-HNN achieves lower derivative and rollout errors, while ablations identify locality and kinetic–potential decomposition as the main sources of these gains.

Concretely, our contributions are as follows:

  • We analyze the spectral bias of conventional HNNs, and show that it is measurable directly on the learned Hamiltonian rather than only from prediction error.

  • We propose LM-HNN, which combines kinetic and potential decomposition with shared local energy functions evaluated across multiple neighborhood scales. The representation extends the spectral range over which the Hamiltonian is resolved and improves derivative and rollout accuracy against structure-preserving baselines.

  • We show that LM-HNN generalizes to energy levels outside the training range, where the baselines lose accuracy, supporting more accurate dynamics beyond the training-energy range.

References (74)