A simple equivariant machine learning method for dynamics based on scalars

Weichi Yao, Kate Storey-Fisher, David W. Hogg, Soledad VillararXiv 2021

TL;DR

This paper introduces a "Scalars" method for building equivariant machine learning models that intrinsically respect physical symmetries like rotations and translations. By using invariant scalar products as the primary building blocks, the authors achieve state-of-the-art accuracy in predicting chaotic dynamics while training four times faster than existing complex equivariant architectures.

What Problem Does This Paper Address?

The laws of physics don't care about your coordinate system. If you rotate a pendulum, its underlying dynamics remain the same—this is known as equivariance. Standard machine learning models, like Multi-Layer Perceptrons (MLPs), are "symmetry-blind." They have to spend a lot of their capacity learning these basic rules from scratch, often requiring massive amounts of data or "data augmentation" (showing the model rotated versions of the same data).

While researchers have developed "equivariant" neural networks to solve this, many existing methods are mathematically cumbersome, relying on complex group theory and irreducible representations. The authors of this paper set out to prove that you can achieve the same (or better) results using a much simpler approach based on classical invariant theory.

Methods

The core idea is based on a fundamental theorem of invariant functions: any function that is invariant under the orthogonal group $O(d)$ (rotations and reflections) can be expressed solely as a function of the scalar products (dot products) of the input vectors.

The authors implement this "Scalars" method in two ways:

  1. Neural Ordinary Differential Equations (N-ODEs): The model learns to predict the derivative (the "velocity" of the system state) as an equivariant vector function.
  2. Hamiltonian Neural Networks (HNNs): The model learns the Hamiltonian (total energy), which is a scalar invariant. The dynamics are then derived using Hamiltonian mechanics.

Instead of feeding raw coordinates into an MLP, they feed in the dot products of all relevant vectors (positions, momenta, and gravity). For vector outputs, they use a linear combination of the input vectors, where the coefficients are scalar functions learned by the network.

Figure 2: The solving process of learning springy dynamics from data.

Datasets

The researchers evaluated their method on a springy double pendulum—a chaotic dynamical system.

  • Training Data: 500 different initializations, each tracked for a very short duration ($T=5$ time steps).
  • Testing/Evaluation: The models were tasked with "rolling out" trajectories for much longer periods ($T=150$) to see how well they generalized.
  • Baselines: They compared their method against standard MLPs and the "Equivariant MLP" (EMLP), a more complex state-of-the-art symmetry-enforcing model.

Key Insights and Ideas

  • Simplicity is a Superpower: By using dot products, the symmetry is "baked in" by construction. This removes the need for the complex mathematical "machinery" used in other equivariant networks.
  • HNNs + Scalars = Physical Consistency: While both N-ODEs and HNNs benefit from the Scalars method, the HNN approach is particularly powerful because it naturally conserves quantities like angular momentum.
  • Generalization through Inputs: By treating the gravitational acceleration vector ($g$) as an input rather than a fixed constant, the model can potentially generalize to different physical environments (e.g., predicting how the pendulum would behave on Mars) without retraining.

Key Results

The Scalars method outperformed all competitors in both precision and efficiency:

  • Accuracy: On the springy pendulum task, the Scalars $O(3)$ HNN achieved the lowest "State Relative Error" (0.005), significantly beating the standard MLP (0.028) and the best EMLP variant (0.012).
  • Speed: The Scalars method is remarkably efficient. It trained in just 15 minutes, whereas the EMLP method took about one hour on the same hardware.
  • Long-term Stability: As shown in the phase space plots, the HNN-based Scalar models track the "ground truth" trajectory much more closely over long time scales than N-ODE versions.
Figure 3: Left: Ground truth and predictions of mass 1 (top) and 2 (bottom) in the phase space w.r.t. each dimension. HNNs exhibits more accurate predictions for longer time scales. Top right: Invariance of the projection of the angular momentum onto the gravitational force vector L⊥as in (12). The geometric mean of the relative error is computed over T = 150 rollouts and averaged across initial conditions. Errorbars are 95% confidence interval over 3 runs. Bottom right: The state relative error along the orbit as in (13). Shaded regions show one standard deviation in log space across the different trajectories, showing the variance in the data. Only the best EMLP method is shown for clarity.

The quantitative superiority is summarized in the table below, showing that the $O(3)$ scalar approach consistently yields the lowest error.

Table showing geometric mean of state relative errors for various models.

Limitations and Future Work

While the results are promising, the authors note a few hurdles for future research:

  • Scalability: The number of dot products grows quadratically with the number of input vectors. For systems with thousands of particles, this could become a computational bottleneck.
  • Noise: The current study used clean, simulated data. Real-world physical data is often noisy, and the robustness of the Scalars method in those conditions remains to be tested.
  • Symbolic Regression: The authors suggest that because the scalar formulation is so simple, it might be a great candidate for "symbolic regression"—turning the learned neural network back into human-readable physical equations.

Summary updated

BibTeX
@misc{yao2021simple,
  author = {Weichi Yao and Kate Storey-Fisher and David W. Hogg and Soledad Villar},
  title = {{A simple equivariant machine learning method for dynamics based on scalars}},
  year = {2021},
  eprint = {2110.03761},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2110.03761},
}
Figure