ICML 2025

Riemann Tensor Neural Networks: Learning Conservative Systems with
Physics-Constrained Networks
Anas Jnini 1 Lorenzo Breschi 1 Flavio Vella 1
Abstract
Divergence-free symmetric tensors (DFSTs) are
fundamental in continuum mechanics, encoding
conservation laws such as mass and momentum
conservation. We introduce Riemann Tensor Neu-
ral Networks (RTNNs), a novel neural architec-
ture that inherently satisfies the DFST condition
to machine precision, providing a strong induc-
tive bias for enforcing these conservation laws.
We prove that RTNNs can approximate any suffi-
ciently smooth DFST with arbitrary precision and
demonstrate their effectiveness as surrogates for
conservative PDEs, achieving improved accuracy
across benchmarks. This work is the first to use
DFSTs as an inductive bias in neural PDE surro-
gates and to explicitly enforce the conservation
of both mass and momentum within a physics-
constrained neural architecture.
1. Introduction
Partial Differential Equations (PDEs)
Partial Differen-
tial Equations (PDEs) are central to the mathematical model-
ing of complex physical systems, including fluid dynamics,
thermodynamics, and material sciences. Traditional nu-
merical methods, such as finite element and spectral meth-
ods, often require fine discretization of the physical domain
to achieve high accuracy. These approaches can become
computationally expensive, particularly in engineering ap-
plications where systems must be solved repeatedly under
varying parameters or initial conditions. Recent advances in
machine learning (ML) have shown promise in addressing
these challenges by leveraging neural networks (NNs) as po-
tential alternatives or enhancements to traditional numerical
solvers (Kovachki et al., 2021; Li et al., 2020).
1 Department of Information Engineering and Computer Sci-
ence, University of Trento, Trento, Italy. Correspondence to: Anas
Jnini <anas.jnini@unitn.it>.
Proceedings of the 42 nd International Conference on Machine
Learning, Vancou...