NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

ConCerNet: A Contrastive Learning Based Framework for Automated Conservation Law Discovery and Trustworthy Dynamical System Prediction

Wang Zhang, Tsui-Wei Weng, Subhro Das, Alexandre Megretski, Luca Daniel, Lam M. Nguyen

Deep Neural Networks (DNNs) are incredibly powerful at modeling complex dynamical systems, but they suffer from a major "trust" issue: they do not inherently understand physics. A standard neural network might predict the path of a planet or a chemical reaction accurately in the short term, but over time, it will slowly "leak" energy or mass because it doesn't respect fundamental conservation laws.

Existing solutions usually fall into two camps:

  1. Prior-knowledge models: Methods like Hamiltonian Neural Networks (HNN) work great, but they require you to know beforehand that the system is Hamiltonian.
  2. Symbolic Regression: These methods try to find the exact mathematical equations for physical laws, but they are computationally expensive and struggle to scale to high-dimensional data.

To address this, researchers have introduced ConCerNet, a novel framework designed to automatically "discover" hidden conservation laws (like energy or mass) directly from raw trajectory data. It then forces neural network predictions to strictly obey these discovered laws, resulting in dynamical system models that are both highly accurate and physically trustworthy.

How ConCerNet Works

ConCerNet operates without prior knowledge of the system's specific physics, relying instead on a clever two-step architecture.

Overview of the ConCerNet framework

Step 1: Learning Invariants via Contrastive Learning

The authors introduce a novel Square Ratio Loss (SRL). The core idea is brilliant in its simplicity: for any physical system, points along the same trajectory must share the same conserved quantities (like total energy), while points on different trajectories likely have different values.

By training a network to minimize the difference between points on the same path and maximize it between different paths, the network naturally learns to represent the system's invariants ($H(x)$). This is a unique application of contrastive learning—typically used for image recognition—repurposed as a mathematically sound tool to identify conserved physical quantities.

Step 2: Enforcing Physics via a Projection Layer

Once the invariant function $H(x)$ is learned, the framework doesn't just hope the dynamics model follows it. Instead, it implements a Neural Projection Layer. This layer takes the raw output of a dynamics-predicting network and mathematically projects it onto a "manifold" where the conserved quantity remains constant ($dH/dt = 0$). This acts as a strict physical "safety rail" for the AI.

Experimental Validation

The framework was evaluated on four distinct systems of increasing complexity:

  • Ideal Spring-Mass System: A classic 2D physics problem involving energy conservation.
  • Chemical Reaction: A 2D system governed by the law of mass conservation.
  • Kepler System: A 4D planetary motion problem involving two invariants: energy and angular momentum.
  • Heat Equation: A high-dimensional (101-node) system. To handle this, the authors combined ConCerNet with an Autoencoder to discover invariants in a compressed latent space.

Key Results

ConCerNet consistently outperformed "vanilla" neural networks across multiple metrics, proving the value of its physics-informed constraints.

Trajectory prediction comparison
  • Superior Accuracy: In complex environments like the Kepler system, ConCerNet reduced coordinate error by a massive margin. The projection layer successfully prevented the model from "drifting" off the physical path over long rollouts.
  • Conservation Mastery: In the spring-mass system, the violation of conservation laws was nearly zero ($1.4e-4$) compared to the baseline ($0.012$).
  • Noise Robustness: Because the projection layer enforces a hard physical constraint, ConCerNet is much more stable when trained on noisy data. Even when the input is messy, the model is forced to produce a physically plausible output.
  • Data Efficiency: The model is relatively "lean," requiring only 100 to 1,000 data points to achieve high accuracy ($R^2 \approx 1$) in discovering the invariants.

Limitations and Future Work

While ConCerNet is a significant step forward for trustworthy AI in physics, it has a few limitations:

  • Interpretability: The model finds a function that is mathematically equivalent to a conservation law, but it doesn't necessarily output a clean, human-readable equation (like $E = mc^2$). The learned invariant might be a complex, non-linear representation.
  • Multiple Invariants: For systems with many conservation laws, the model doesn't guarantee it will disentangle every individual law separately; it might find a single function that combines them.
  • Dissipative Systems: The current framework is designed for systems where quantities are perfectly conserved. Extending this to systems that lose energy over time (e.g., due to friction or drag) while still respecting other laws (like mass) is a promising direction for future research.

Summary updated

BibTeX
@inproceedings{zhang2023concernet,
  author = {Wang Zhang and Tsui-Wei Weng and Subhro Das and Alexandre Megretski and Luca Daniel and Lam M. Nguyen},
  title = {{ConCerNet: A Contrastive Learning Based Framework for Automated Conservation Law Discovery and Trustworthy Dynamical System Prediction}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=6LJvlAiD9z},
}
Figure