Learning Symbolic Physics with Graph Networks

Miles D. Cranmer, Rui Xu, Peter W. Battaglia, Shirley HoarXiv 2019

TL;DR

This paper introduces a novel approach using graph networks (GNs) with built-in physical inductive biases to learn interpretable representations of physical laws. By combining GNs with symbolic regression, they successfully recover Newton's law of gravitation from data and demonstrate improved generalization to systems with more bodies than seen during training.

What Problem Does This Paper Address?

Modern deep learning excels at pattern recognition and prediction, often learning implicit representations of knowledge. However, science aims for explicit, interpretable causal explanations. This paper bridges this gap by exploring how to imbue neural networks with physical intuition, enabling them to not only predict physical dynamics but also to reveal the underlying symbolic laws governing them. The challenge lies in moving beyond black-box models to discover generalizable, interpretable scientific principles.

Methods

The core of the approach is a Graph Network (GN) architecture, a type of graph neural network adept at modeling systems with interacting components. The key innovation is imposing "physically motivated inductive biases" on the GN. Specifically, they design the GN's message-passing mechanism to encourage its internal "message" representations to directly correspond to physical force vectors. This is achieved by carefully setting the dimensionality of the message vectors ($L_e'$) to match the dimensionality of the force vectors (D).

After training the GN to predict system dynamics (e.g., velocity updates), they employ a second technique: symbolic regression. Using a tool called "eureqa," they fit explicit algebraic equations to the learned message functions. This allows them to translate the implicit knowledge learned by the neural network into interpretable symbolic equations, effectively discovering physical laws.

Datasets

The paper uses simulated datasets for various physical systems:

  • 2D n-body gravitational simulations (1/r and 1/r² force laws)
  • 3D n-body gravitational simulations (1/r² force law)
  • 2D hanging string simulations (with a global gravity and an r² force law between nodes)

These simulations are generated with random masses and initial conditions, with 100,000 simulations used for training and 1000 for evaluation per environment. The number of bodies in the training set is fixed (e.g., six bodies for n-body systems), and the models are tested for generalization on systems with a variable number of bodies.

Key Insights and Ideas

  • Physically Informed Inductive Biases: By designing the GN's message dimensionality ($L_e'$) to match the force vector dimensionality (D), the network is strongly encouraged to learn interpretable force representations. This is a crucial step beyond generic graph networks.
  • Bridging Implicit and Explicit Knowledge: The combination of GNs (implicit learning) and symbolic regression (explicit discovery) offers a powerful paradigm for extracting scientific laws from data.
  • Interpretable Message Representations: The learned "message" vectors in the GN directly correspond to physical force vectors, allowing for direct interpretation and analysis.
  • Generalization Through Simplicity: Constraining the message space ($L_e' = D$) leads to better generalization to systems with more bodies, suggesting that forcing the model to learn the fundamental force law directly, rather than through complex concatenations, is more robust.

Key Results

  • Recovering Force Vectors: The GN models successfully learned message representations that are linear transformations of the true force vectors for various gravitational and spring-like simulations.
  • Discovering Newton's Law: Using symbolic regression on the learned message function for a 1/r force law, the model recovered an algebraic expression very close to Newton's law of gravitation (specifically, $(0.46m_2\Delta y - 1.55m_2\Delta x)/r^2$ for the y-component of the force, which is proportional to the true force).
  • Improved Generalization: GNs trained with $L_e' = D$ showed significantly better generalization to systems with more bodies than those trained with larger message spaces ($L_e' > D$). For instance, models trained on 6-body systems generalized better to 10-12 body systems when $L_e'$ was set to the force dimension (3 for 3D).

Limitations and Future Work

  • Extensibility: While the approach is extensible in principle to any unknown interaction law, the paper focuses on specific n-body and spring systems. Further work could explore more complex physical phenomena.
  • Symbolic Regression Complexity: The symbolic regression step can be computationally intensive and might struggle with extremely complex laws or very high-dimensional message spaces.
  • Unknown Dimension: If the dimensionality of the force vector (D) is unknown, the paper suggests a heuristic of minimizing $L_e'$ until the loss drops off, which could be further investigated.
  • Future Directions: The authors highlight that this approach offers a valuable technique for interpreting and inferring explicit causal theories from deep learning models, suggesting broad applicability to scientific discovery.

Summary updated

BibTeX
@misc{cranmer2019learning,
  author = {Miles D. Cranmer and Rui Xu and Peter W. Battaglia and Shirley Ho},
  title = {{Learning Symbolic Physics with Graph Networks}},
  year = {2019},
  eprint = {1909.05862},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1909.05862},
}
Figure