Identifying Physical Law of Hamiltonian Systems via Meta-Learning

Seungjun Lee, Haesang Yang, Woojae Seong

Abstract

Hamiltonian mechanics is an effective tool to represent many physical processes with concise yet well-generalized mathematical expressions. A well-modeled Hamiltonian makes it easy for researchers to analyze and forecast many related phenomena that are governed by the same physical law. However, in general, identifying a functional or shared expression of the Hamiltonian is very difficult. It requires carefully designed experiments and the researcher's insight that comes from years of experience. We propose that meta-learning algorithms can be potentially powerful data-driven tools for identifying the physical law governing Hamiltonian systems without any mathematical assumptions on the representation, but with observations from a set of systems governed by the same physical law. We show that a well meta-trained learner can identify the shared representation of the Hamiltonian by evaluating our method on several types of physical systems with various experimental settings.

Introduction

In physics, Hamiltonian mechanics provides a powerful way to describe systems using a single energy-based function. If you know the Hamiltonian, you can predict how a system will evolve over time. However, finding the correct mathematical expression for a new, unknown physical process is incredibly difficult—it usually requires years of expert intuition and meticulously designed experiments.

While modern "Hamiltonian Neural Networks" (HNNs) can learn to simulate a specific system (like one specific pendulum), they fail to generalize. If you show a standard HNN a new pendulum with a different mass or length, it has to start learning from scratch. This research addresses a critical gap: How can we train a model to learn the underlying "law of physics" so it can adapt to new systems with different parameters almost instantly?

Methodology

The authors combine the physics-informed architecture of Hamiltonian Neural Networks (HNN) with gradient-based meta-learning algorithms. Unlike standard neural networks, HNNs are constrained by a specific loss function that enforces "symplectic structure"—essentially ensuring the model respects conservation of energy and the fundamental geometric properties of phase space.

Overview of the meta-learning framework for Hamiltonian systems. Meta-optimization (solid arrows) identifies a shared representation $H_\theta$, while task-specific adaptation (dashed arrows) fine-tunes the model for specific physical parameters.

The paper adapts two primary meta-learning approaches:

  • HAMAML (Hamiltonian Model-Agnostic Meta-Learning): Based on the MAML algorithm, this trains the model to find a set of initial parameters that can be quickly fine-tuned for any specific task.
  • HANIL (Hamiltonian Almost No Inner-Loop): Based on the ANIL algorithm, this operates on the feature reuse hypothesis: the idea that the body of the neural network learns the universal physical law (the shared representation), while only the very last layer needs to change to account for specific physical parameters (like mass or gravity).

The methods were evaluated on three classic simulated physical systems: Spring-Mass, Ideal Pendulum, and the Kepler Problem. For each system, 10,000 tasks were generated for meta-training, with evaluation performed on 10 entirely novel systems.

Results and Discussion

The research yields several significant findings regarding the intersection of meta-learning and physics:

  • Physics is Modular: The "Feature Reuse Hypothesis" maps perfectly onto physics. In a Hamiltonian like $H = \\frac{p^2}{2ml^2} + mgl(1 - \\cos q)$, the structure (the cosines and squares) is the universal law, while the coefficients ($m, l, g$) are the system-specific parameters.
  • HANIL Superiority: Updating only the last layer (HANIL) during adaptation was significantly more effective than updating the whole network (HAMAML). In the Pendulum experiment, HANIL achieved a Mean Squared Error (MSE) of 0.003, compared to 1.4 for HAMAML and 5.1 for a standard pretrained HNN.
  • Data Efficiency: The meta-learned model can reconstruct the entire "phase portrait" of a system from just 25 random observations. HANIL converged to near-perfect accuracy within just 1 to 10 gradient steps.
Reconstructed phase portrait of a pendulum system, showing the learned vector field of its dynamics.

Conclusion

This work demonstrates that meta-learning can effectively identify shared physical laws across related systems. While the current method requires ground-truth time derivatives and has been tested on relatively low-dimensional systems, it opens the door for more complex applications. Future directions include scaling to high-dimensional dynamics and combining this approach with symbolic regression to extract human-readable mathematical formulas from the learned meta-features.

Summary updated

Abstract

Hamiltonian mechanics is an effective tool to represent many physical processes with concise yet well-generalized mathematical expressions. A well-modeled Hamiltonian makes it easy for researchers to analyze and forecast many related phenomena that are governed by the same physical law. However, in general, identifying a functional or shared expression of the Hamiltonian is very difficult. It requires carefully designed experiments and the researcher's insight that comes from years of experience. We propose that meta-learning algorithms can be potentially powerful data-driven tools for identifying the physical law governing Hamiltonian systems without any mathematical assumptions on the representation, but with observations from a set of systems governed by the same physical law. We show that a well meta-trained learner can identify the shared representation of the Hamiltonian by evaluating our method on several types of physical systems with various experimental settings.
BibTeX
@inproceedings{lee2021identifying,
  author = {Seungjun Lee and Haesang Yang and Woojae Seong},
  title = {{Identifying Physical Law of Hamiltonian Systems via Meta-Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
  url = {https://openreview.net/forum?id=K7Yj2qXmVm},
}
Figure