NeurIPS 2026

Generalizable Physics Simulation through Compositional Energy Minimization

Abstract

Learning the dynamics of interacting physical systems is a central challenge in machine learning for the physical sciences. Prevailing architectures such as Graph Neural Networks (GNNs) and feedforward models often fail to explicitly capture the compositional nature of physical laws. Instead of modeling the forces that govern a system, these networks learn to approximate aggregate state transitions. As a result, they lack a causal understanding of the underlying physical interactions, leading to poor generalization in out-of-distribution systems with varying numbers of entities or novel configurations. In this work, we introduce Compositional Potential Minimization (CPM), a framework that casts simulation as an energy minimization procedure over a composition of learned force potentials. Each force component is represented as a separate, interpretable energy landscape, and interaction dynamics emerge from their addition. Inference in CPM is framed as a global energy minimization problem over an arbitrary number of composed functions. Because CPM learns to disentangle separate forces during training, it enables seamless generalization at test time to larger-scale systems and unseen configurations through straightforward compositions of the learned energy components. Our experiments show that CPM significantly outperforms previous state-of-the-art GNN-based solutions in 2D, 3D, and particle-based simulations.

1

Compositional Potential Minimization

Compositional Energy Training

Individual pairwise potentials \( E_\theta(y, x_i, x_j) \) sum into \( \sum_j E_\theta(y) \). Training is done so that \( y_i \) is assigned the minimum of the energy function.

Initial Setting
→
\( E_\theta(y, x_i, x_{j_1}) \)
Self-Discovered Potential Well

+
→
\( E_\theta(y, x_i, x_{j_2}) \)
Self-Discovered Potential Well

Composed \( \sum_j E_\theta(y) \)
High
Low
Ground Truth Data

Loss: train such that ground truth prediction is assigned low energy

Training Epoch: 185

Global Energy Minimization

Starting from a noisy initialization \( y_i^{(0)} \), iterative gradient descent traverses the summed potential \( \sum_j E_\theta(y) \) to converge on the predicted next state \( \hat{y}_i \).

Initial Setting
→
\( E_\theta(y, x_i, x_{j_1}) \)
+
→
\( E_\theta(y, x_i, x_{j_2}) \)
GD on \( \sum_j E_\theta(y) \)
High
Low
Predicted Motion
Gradient Descent Steps: S = 9

Zero-Shot Compositional Energy Minimization

Starting from a noisy initialization \( y_i^{(0)} \), iterative gradient descent minimizes the larger composition of learned pairwise potentials \( \sum_j E_\theta(y, x_i, x_j) \), enabling zero-shot generalization to more interacting particles without retraining.

Initial Setting
GD on \( \sum_j E_\theta(y) \)
High
Low
Predicted Motion
Zero-Shot Neighbor Count:
4 Neighbors (OOD Zero-Shot)
Gradient Descent Steps: S = 7
2

Experimental Results

2D, 3D, and particle-based benchmarks

4

BibTeX

@inproceedings{oarga2026generalizable,
  title={Generalizable Physics Simulation through Compositional Energy Minimization},
  author={Oarga, Alexandru and Du, Yilun},
  booktitle={Advances in Neural Information Processing Systems (NeurIPS)},
  year={2026}
}