ModLaNets: Learning Generalisable Dynamics via Modularity and Physical Inductive Bias

Yupu Lu, Shijie Lin, Guanqi Chen, Jia Pan

Introduction

Traditional deep learning models excel at curve-fitting but often fail to respect the underlying laws of physics. While recent "physics-informed" models like Hamiltonian Neural Networks (HNNs) and Lagrangian Neural Networks (LNNs) have improved upon this by embedding conservation laws into their architecture, they suffer from a major flaw: a lack of generalizability.

If you train a standard LNN on a double-pendulum system, it cannot simulate a triple-pendulum. The network treats the system as a single, monolithic entity with a fixed number of inputs and outputs. Furthermore, as systems grow more complex, the amount of data and the size of the network required to model them explode. For instance, moving from a single to a double pendulum can increase the parameter count tenfold and require orders of magnitude more data.

To address this, researchers have introduced ModLaNets (Modular Lagrangian Networks), a "Lego-like" approach to physics-informed machine learning. By modeling individual system components rather than the entire system at once, this modular framework can learn from simple systems and generalize to more complex ones with high data efficiency and strict adherence to physical conservation laws.

The ModLaNet Framework

ModLaNets break a dynamical system down into its constituent elements. The framework operates in three distinct stages:

  1. Coordinate Transformation: The model first transforms local coordinates (like the angles of a pendulum) into a global Cartesian coordinate system. This step is crucial because it unifies the input format for all elements, making the learning task much simpler for the neural network.
  2. Energy Construction: Instead of one giant network, ModLaNets use multiple "light" multilayer perceptrons (MLPs) to model the potential ($U$) and kinetic ($T$) energy of individual elements. Because identical elements (like the rods in a multi-pendulum) share the same physical properties, they can share the same trained neural network modules.
  3. Dynamics Derivation: The total Lagrangian ($L = T - U$) is constructed by summing the energies of all modules. The system's acceleration ($\ddot{q}$) is then derived using the Euler-Lagrange equation, ensuring the resulting motion respects physical principles like energy conservation.
The ModLaNet framework: Coordinate Transformation, Energy Construction, and Dynamics Derivation.

Key Insights and Experimental Setup

The researchers evaluated ModLaNets on two classic chaotic systems: multi-pendulum systems (ranging from double to quintuple pendulums) and multi-body systems (simulating 3 to 6 particles moving under gravitational-like attraction). Crucially, they focused on small datasets (10K to 20K samples)—a significant departure from previous work where standard LNNs often require upwards of 300 million samples to achieve similar accuracy on double-pendulum tasks.

The success of ModLaNets relies on a few core physical inductive biases:

  • Modularity is the Key to Scaling: By focusing on the "element" rather than the "system," complex simulations can be built by simply plugging in more pre-trained modules. This allows for zero-shot or few-shot extension to systems the model never saw during training.
  • The Linearity of Energy: The authors leverage a fundamental physical property: total energy is the sum of its parts. This mathematical fact justifies summing the outputs of individual neural network modules to represent a complex system.
  • Global Coordinates as a Prior: Moving to a global Cartesian frame makes the kinetic energy term ($T = \frac{1}{2}m\dot{x}^2$) uniform across all elements, significantly reducing the complexity the network needs to learn.

Key Results

ModLaNets demonstrated significant improvements over traditional monolithic approaches:

  • Superior Data Efficiency: ModLaNet was the only model to successfully converge on the small 10K-20K sample datasets. Baselines like HNN and standard MLPs either failed to converge or overfit the training data.
  • Long-term Stability: In 30-second trajectory predictions, ModLaNet maintained significantly lower Mean Squared Error (MSE) in both position and energy compared to HNN and baseline models.
  • Successful Extension: A ModLaNet trained on a double-pendulum could be extended to a triple or quadruple pendulum. While the error naturally grows with system complexity, "fine-tuning" the modular networks with a tiny amount of new data (1/10th of the original training set) drastically improved performance.
Comparison of accumulated MSE over time for three-body systems.

Limitations and Future Work

While ModLaNets represent a leap forward in generalizable physics learning, some hurdles remain. The current prototypes use only one type of element per system; future iterations will need to support heterogeneous systems (e.g., a mix of different masses and lengths). Additionally, elements are currently treated as point masses, and future work will aim to update the energy models to account for rigid bodies with actual volume and geometry. Finally, for extremely chaotic systems (like 4+ pendulums), even modular retraining can struggle if the initial training on simpler systems didn't capture enough dynamical variety.

In summary, ModLaNets provide a promising path toward more flexible and efficient physical simulations, moving us closer to AI that truly understands the "building blocks" of the physical world.

Summary updated

BibTeX
@inproceedings{lu2022modlanets,
  author = {Yupu Lu and Shijie Lin and Guanqi Chen and Jia Pan},
  title = {{ModLaNets: Learning Generalisable Dynamics via Modularity and Physical Inductive Bias}},
  booktitle = {International Conference on Machine Learning},
  year = {2022},
  url = {https://openreview.net/forum?id=03UYf10gxQU},
}
Figure