No Generalized Momentum Data Needed: A New Breakthrough in Hamiltonian Networks

A new architecture requires only state and derivative data to jointly learn generalized momentum, Hamiltonian structure, and dynamics, overcoming HNNs' dependence on momentum priors.
Hamiltonian Neural Networks (HNNs) offer energy conservation and interpretability by embedding physical priors, but reliance on generalized momentum data limits practical application. A new study proposes a general extended architecture that treats generalized momentum as a learnable latent variable, jointly learning momentum, Hamiltonian structure, and dynamics from state and derivative data alone. Validated on a dissipative mass-spring system, a double pendulum, and a nonholonomic rolling disk, covering linear to nonlinear and holonomic to nonholonomic scenarios. The method lowers the barrier to physical priors and could extend to robot dynamics modeling, but noise robustness of state derivatives remains unaddressed, a potential practical limitation.
Hamiltonian Neural Networks (HNNs) have attracted significant attention for embedding physical priors into network architecture and loss functions, but their reliance on generalized momentum data severely limits practical application. A new study proposes a general extended architecture that can simultaneously learn a system's generalized momentum, Hamiltonian structure, and dynamics solely from data on states and their derivatives when the analytical form of generalized momentum is unknown.
The Core Strengths and Key Bottleneck of HNNs
By explicitly encoding Hamiltonian mechanics, HNNs and their variants not only guarantee physical properties such as energy conservation during modeling but also provide additional interpretable information. This combination of "physical priors + neural networks" demonstrates unique value in data efficiency and extrapolation capability.
However, both training and inference of HNNs depend on the generalized momentum of the target system. In classical mechanics, generalized momentum is typically defined as the partial derivative of the Lagrangian with respect to generalized velocity. For many real-world systems, the analytical form of momentum is unknown or difficult to measure directly. This means that for a black-box system, even if state variables and their derivatives can be observed, HNNs often cannot be directly applied.
The study explicitly identifies this pain point: the dependence on generalized momentum "severely hinders its applicability," especially in real scenarios where the analytical form is unknown.

Hamiltonian Mechanics and Generalized Momentum
Hamiltonian mechanics is an alternative formulation of classical mechanics, equivalent to Newtonian and Lagrangian mechanics, but centered on the system's total energy (the Hamiltonian). In the Hamiltonian framework, the system state is described by generalized coordinates $q$ and generalized momenta $p$, with evolution governed by a system of first-order differential equations (Hamilton's equations): $\dot{q} = \partial H/\partial p$, $\dot{p} = -\partial H/\partial q$. This structure naturally guarantees energy conservation (when $H$ does not explicitly depend on time) and endows the system with symplectic geometric properties.
Generalized momentum is defined as the partial derivative of the Lagrangian with respect to generalized velocity: $p_i = \partial L/\partial \dot{q}_i$. For simple systems (e.g., a free particle), generalized momentum is simply mass times velocity; but in complex systems (e.g., charged particles in electromagnetic fields, nonholonomic constraint systems), the analytical form of generalized momentum can be very complex or even impossible to write explicitly. HNNs use $q$ and $p$ as inputs to learn the gradient of $H$, so if $p$ is unknown, HNNs cannot be directly applied.
New Architecture: "Completing" Momentum from Data
The proposed extended architecture treats generalized momentum as a latent variable to be learned, jointly optimized with the Hamiltonian structure and dynamics model. Its input requires only state variables and their derivatives (which can be non-sequential data), and its output includes the learned generalized momentum and the system evolution laws.
This design breaks the hard requirement of HNNs for prior knowledge of momentum. During learning, the network automatically discovers a numerical representation of momentum and aligns it with the Hamiltonian structure. Since the Hamiltonian structure itself embodies constraints such as energy conservation, the learned momentum is not an arbitrary fit but is guided by physical laws.
Methodologically, this belongs to the fusion approach of "physical priors + latent variable learning": retaining the structural advantages of HNNs while delegating missing physical quantities to data-driven modules for completion.
Validation on Three Benchmark Systems
To evaluate the architecture's performance, the authors selected three typical systems as test cases:
- Dissipative mass-spring system: A classical linear system, but the dissipative term increases modeling difficulty;
- Double pendulum: A multi-body system with strong nonlinearity and chaotic tendencies;
- Rolling disk under nonholonomic constraints: Involves nonholonomic constraints, placing higher demands on dynamics modeling.
These systems cover a variety of scenarios from linear to nonlinear and from holonomic to nonholonomic constraints. The paper notes that these are "typical examples for evaluating the performance of the proposed architecture." Although the original text does not disclose specific error values, the choice of these three systems itself indicates the authors' intent to verify the method's generality under diverse dynamic conditions.

Nonholonomic Constraints
Nonholonomic constraints are non-integrable constraints imposed on system velocities (or momenta), meaning the constraint equations cannot be integrated into constraints on position coordinates. A typical example is the rolling disk: when a disk rolls without slipping on a plane, the velocity of its contact point is zero, giving a constraint relationship between velocities that cannot be integrated into a position constraint (the disk can reach any position and orientation on the plane). Dynamics modeling of nonholonomic constraint systems is more complex than that of holonomic constraint systems because constraint forces do no work but change the direction of motion, requiring Lagrange mechanics to introduce multiplier methods or pseudo-coordinates. For HNNs, nonholonomic constraints mean that both the definition of generalized momentum and the Hamiltonian structure may require special handling, so this benchmark system can effectively test the new architecture's generalization capability under complex constraints.
Implications for Physics-Informed Machine Learning
This work addresses a common challenge in the physics-informed neural network (PINN) field: how to continue leveraging structured physical knowledge when certain quantities in physical priors cannot be directly obtained. The previous high barrier for HNNs was momentum data; the new architecture lowers this barrier to "states and their derivatives," which are generally easier to obtain in simulation and experiments.
From an application perspective, the method could benefit robot dynamics modeling, mechanical system parameter identification, and any scenario requiring extraction of Hamiltonian structure from observational data. Especially when systems are too complex to write analytical momentum expressions, data-driven momentum learning provides a feasible path.
However, the method still relies on state derivative data. If derivatives can only be approximated by numerical differentiation, noise will propagate to momentum learning. The paper does not discuss this practical limitation, and future work may need to evaluate noise robustness.
Conclusion
This study fills a critical gap for Hamiltonian neural networks: turning generalized momentum from "must be known" to "can be learned." By jointly learning momentum, Hamiltonian structure, and dynamics, the applicability of HNNs expands from idealized analytical systems to more realistic observational data scenarios. The design of the three benchmark systems also shows the authors' emphasis on generality. For researchers and engineers interested in the fusion of physical priors and deep learning, this is a direction worth following.
One-line Summary
A new architecture requires only state and derivative data to jointly learn generalized momentum, Hamiltonian structure, and dynamics, overcoming HNNs' dependence on momentum priors.
Paragraph Summary
Hamiltonian Neural Networks (HNNs) offer advantages in energy conservation and interpretability by embedding physical priors, but their reliance on generalized momentum data limits practical application. A new study proposes a general extended architecture that treats generalized momentum as a latent variable to be learned, jointly learning momentum, Hamiltonian structure, and dynamics solely from state and derivative data. The architecture is validated on three benchmark systems: a dissipative mass-spring system, a double pendulum, and a rolling disk under nonholonomic constraints, covering scenarios from linear to nonlinear and from holonomic to nonholonomic constraints. The method lowers the barrier to using physical priors and could extend to robot dynamics modeling, but noise robustness of state derivatives has not been discussed, posing a potential practical limitation.
Related articles

Running a Local LLM on a Laptop CPU: Ollama + Qwen3 Gives a Desktop Pet a Brain
An ordinary laptop without a GPU can run a local LLM: a Bilibili creator uses Ollama plus open-source Qwen3 8B on pure CPU to give an original desktop pet a local brain, with DeepSeekHarness handling plugin development and three rounds of debugging — 0 yuan, works offline, privacy stays on-device.

AgentScope 2.0 in Practice: A Guide to Enterprise-Level AI Agent Development in Java
AgentScope 2.0 is Alibaba's Java enterprise-grade distributed agent framework. This article explains why it suits server-side AI applications, contrasts client-side AI apps in permissions, state management, and concurrency, and outlines a practical learning path from environment setup to project integration.

GPT-6 Astra Directly Edits Weights to Fix Models? Full Analysis of the MIT Paper and Leaks
MIT paper shows GPT-6 Astra repairs small models by directly editing weights, raising math scores from 7.9% to 48.1%; OpenAI internal charts hint an unreleased model leads on BenchCAD 2.0; Fable 5.5 pure-code movies and the Claude WiFi radar incident analyzed.