arXiv:2610.17483cs.LGOct 2026

Manuscript Offprint

arXiv:2610.17483

Structure-preserving fidelity diagnostics for partial differential equations

Kyriakos Flouris

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Kyriakos Flouris 1,2^{1,2}

1^{1}MRC Biostatistics Unit, University of Cambridge, Cambridge, United Kingdom

2^{2}King's College, University of Cambridge, Cambridge, United Kingdom

Machine learning surrogates of partial differential equations (PDEs) are commonly trained on data generated by numerical solvers. Therefore, the training data obey not the PDE but the modified equation of the numerical scheme, and the test loss, computed on data from the same solver, cannot distinguish a model that learned the physics from one that learned the discretization error. Here, we show that the difference is nevertheless visible in the trained model. We propose a suite of structure-preserving fidelity diagnostics, simple scores that measure whether a learned model respects one known property of the physics, such as a conserved quantity, a symmetry or a Hamiltonian structure, without access to the training data or the governing equation. Over five systems, the diagnostics track the error with respect to the true dynamics with a rank correlation of up to 0.94, while the test loss is uncorrelated or anti-correlated with it. For the Burgers, Korteweg–de Vries and Navier–Stokes equations, the diagnostics separate numerical schemes that the test loss ranks as equivalent, including schemes of the same order.

I. INTRODUCTION

Machine learning models of physical systems described by partial differential equations (PDEs) have become a standard tool, either as fast surrogates of the solution [1–3] or as a means to discover the governing equation from data [4, 5]. Since experimental data are scarce, such models are in most cases trained on data generated by numerical solvers. A numerical solver, however, only approximates the PDE. In fact, a consistent scheme of order q on a grid of spacing h solves exactly a slightly different equation, the modified equation of the scheme [6, 7], which differs from the PDE by terms of order hqh^{q}. For example, first-order upwinding of the Burgers equation adds an artificial viscosity proportional to h. Consequently, a model that fits the training data well learns the modified equation rather than the PDE. For time integrators of ordinary differential equations this effect has been observed and corrected for when the scheme is known [8, 9].

In practice, however, the scheme is often not known to the user of a trained model, and the standard validation of a machine learning model, the test loss, cannot reveal it: the test data are generated by the same solver as the training data, so the test loss measures how well the model reproduces the solver, not the physics. As we show in Section IV B, three models of the Burgers equation trained on data from three different solvers have test losses within a factor of 1.7 of each other, while their errors with respect to the true dynamics differ by a factor of 71. The test loss ranks a model that learned an artificial viscosity as good as the model that learned the physics. Alternatively, checks that compare the model with the governing equation require the equation and all its coefficients, which are not available in most applications of learned surrogates.

We postulate that the information is nevertheless stored in the trained model. Numerical schemes typically break some structural property of the physics, such as a conserved quantity, a symmetry or a Hamiltonian structure, at the order of their discretization error. A model that learned the modified equation inherits this violation, while a model that learned the physics does not. To this end, we propose fidelity diagnostics, simple scores D[fθ]D[f_{\theta}] of a trained model fθf_{\theta} that are zero if the model respects a given structural property and positive otherwise. The diagnostics require only the name of the property, not the governing equation, and are evaluated on the trained model alone, without the training data and in most cases without a rollout. We collect them in a diagnostic suite, Table I, which lists for each diagnostic what it requires and what it detects, and which can be applied to other learned models in the same way.

We test the diagnostics on the viscous Burgers equation, the Korteweg–de Vries (KdV) equation and two-dimensional (2D) Navier–Stokes flow, each discretized by several schemes that generate the training data of otherwise identical models. We show that the test loss fails to indicate the error of the models while the diagnostics track it, that the learned models reproduce the discretization error of their solver quantitatively, and that different diagnostics detect different schemes. Furthermore, we show which diagnostics cannot work: linear conserved quantities and self-consistency checks of learned time-steppers, including the recently proposed semigroup consistency [10]. Finally, we report a case in which the diagnostics do not indicate the rollout error.

First, we discuss related work in Section II. We introduce the modified equation, the learned models and the diagnostics in Section III. In Section IV the experiments and results are presented. The paper finishes with a discussion of the limitations and a summary. The appendix contains the derivations, the details of the experimental setup and additional results.