arXiv:2609.07437math.NASep 2026

Manuscript Offprint

arXiv:2609.07437

A Systematic Analysis of Automatic Differentiation versus Discretization-based Constraints for Physics-Informed PDE Solvers

Xing Guo, Hongwei Tang, Zewei Meng, Yidong Zhang, Shaoqiu Xiao, Feng Liu

Xing Guo a,b,†^{a,b,\dagger}, Hongwei Tang b,†^{b,\dagger}, Zewei Meng b^{b}, Yidong Zhang a,b^{a,b}, Shaoqiu Xiao a,∗^{a,*}, Feng Liu b,∗^{b,*}

a. School of Systems Science and Engineering, Sun Yat-sen University, Guangzhou, China

b. National Key Laboratory of Aerospace Physics in Fluids, Mianyang, China

†^{\dagger}The authors contribute equally to this work.

∗^{*}Corresponding author.

E-mail address: guox89@mail2.sysu.edu.cn (X. Guo), thw1021@nuaa.edu.cn (H. Tang), mengzw94@163.com (Z. Meng), zhangyd8@mail2.sysu.edu.cn (Y. Zhang), xiaoshq8@mail.sysu.edu.cn (S. Xiao), liufengmaple@foxmail.com (F. Liu)

Abstract: Physics-informed neural networks (PINNs) represent a growing frontier in using artificial intelligence to solve partial differential equations (PDEs). Automatic differentiation (AD) plays a central role in this paradigm, which is mesh-free and replaces traditional iterative solvers with gradient-based optimization in continuous space. However, the inherent limitations of AD, particularly in handling higher-order derivatives and discontinuous solutions, pose significant challenges for complex problems. This has motivated a growing number of researchers to explore discretization-based constraints as an alternative path. Yet, the respective applicability of these two paradigms remains largely unexplored. In this work, we conduct systematic experiments across a wide spectrum of problems, from simple linear Poisson to high-Mach hypersonic flows with strong discontinuities. Through a rigorous decomposition of approximation, optimization, and truncation errors, we systematically elucidate the fundamental trade-offs and error-governing mechanisms of both paradigms, as well as two representative network architectures: multi-layer perceptron (MLP) and graph neural network (GNN). Our results reveal a consistent trend: as nonlinearity strengths, the accuracy advantage of discretization-based constraints becomes increasingly pronounced, with smaller optimization errors compensating for the truncation errors. Moreover, the more complex the nonlinearity and boundary conditions, the greater the advantage of GNN over MLP. These insights offer a robust practical guideline for configuring neural PDE solvers in demanding engineering applications. Our source data and code are available at https://github.com/guoxing0809/neuropde_analysis.

Keywords: physics-informed neural network, automatic differentiation, finite difference, finite volume, error analysis

1 Introduction

Physics-informed neural networks (PINNs) have become an established methodology since Raissi's seminal work [1], evolving from earlier attempts to integrate artificial neural networks with physical constraints for solving differential equations. The PINN framework advances this paradigm by preserving physical interpretability while incorporating deep learning's representational capacity, demonstrating superior effectiveness for ill-posed [2] and inverse problems [3] where purely physics-driven or data-driven methods face limitations, and exhibiting enhanced robustness to noisy observational data [4]. In fluid dynamics, PINN variants have branched into multiple directions, reflecting different design choices in data sampling, network architecture and the formulation of physical constraints [5, 6].

Unlike direct numerical simulation (DNS), which exhibits well-defined convergence orders and rigorous error bounds, PINNs rely on a nonlinear optimization framework with mean squared error (MSE) as the loss function. Consequently, PINNs are inherently subject to the so-called spectral bias [7]—a tendency to prioritize learning low-frequency components of the solution while struggling to capture high-frequency features. This pathology, which often hinders the training of

PINNs in more complex cases, has been systematically analyzed by [8] through the lens of neural tangent kernel theory. Several strategies have been adopted by researchers to mitigate such limitations. Dynamic loss weighting [9, 10] is a typical example. In addition, a number of techniques have been developed to improve the optimization convergence of PINNs, including variable-scaling techniques for stiff and high-frequency problems [11], gradient-enhanced residual formulation [12], and curvature-aware optimization method [13]. More recently, an operator learning framework has been proposed to learn the Cholesky factors of regularized Newton updates, unrolling the iteration into a neural architecture to emulate partial differential equations (PDEs) solvers [14]. Although these advances have improved PINN training in certain settings, their broader practical applicability remains limited. Dynamic loss weighting strategies, for instance, are highly problem-dependent and often lack generalizability across different problem settings. Furthermore, higher-order optimizers, despite reported accuracy gains in certain cases, often suffer from convergence instability [15]. Methods that incorporate higher-order parameter-space information into neural networks may reduce the number of outer-loop iterations, but this comes at a computational cost that can be several times that of standard iterative procedures, and their reliability on more complex physical problems remains unclear. Such efforts, however, may diverge from the original motivation for applying machine learning to PDEs. Rather than pursuing marginal improvements over classical solvers on problems where the latter already perform well, neural network methods should focus on more demanding problems where traditional methods fall short [16].

The alternative physics-informed paradigm embeds the PDE residual through discretization-based constraints, which can take differential, integral, variational, or mixed forms. A notable strength of this paradigm lies in its ability to naturally incorporate elemental conservation laws into the learning framework [3]. While the conventional finite difference (FD) form is often constrained to regular grids [17], the integral finite volume (FV) form can be straightforwardly extended to computational domains with unstructured meshes [18–21]. Variational formulations offer another route within the discretization-based constraints. For instance, hp-VPINNs introduced domain decomposition and high-order polynomial test functions to enforce PDE residuals in an integral sense [22]. Along similar lines, finite element (FE) frameworks have been employed to integrate weak-form discretization with neural network architecture [23, 24]. Hybrid strategies with mixed forms include coupling automatic differentiation (AD) with auxiliary discrete operators [25], embedding Rankine-Hugoniot jump conditions as additional loss constraints for discontinuous shock problems [26], combining spectral discretization for fractional derivatives with AD for integer-order derivatives [27], and leveraging prior field information from pre-trained PINNs to enforce conservation laws on node topology networks [28]. In addition to constraint formulation, the network architecture itself also plays a critical role in determining solver performance. Multi-layer perceptrons (MLPs) are widely used due to their simplicity and efficiency, but they lack the coupling of neighbourhood information, which limits their ability to capture local interactions in complex geometries. Convolutional neural networks (CNNs) have been employed to address this limitation by leveraging local stencils on structured grids [18, 29], yet they offer limited flexibility for enforcing hard constraints, especially on unstructured meshes. As a result, increasing attention has turned to graph neural networks (GNNs), which offer greater flexibility by operating directly on graph structures [20, 21, 23]. This flexibility has been demonstrated in hybrid frameworks that couple GNNs with differentiable PDE solvers [30], as well as in mesh-based simulation pipelines that learn dynamics directly on adaptive meshes [31]. A practical limitation, however, is that the cost of message passing scales with the number of mesh edges, which can become significant for large meshes. Thus, it is crucial to determine when the accuracy gains of GNNs outweigh their computational overhead, and whether such trade-offs are justified for a given problem.

Much of the existing work has primarily emphasized accuracy, or has sought to reproduce the efficiency of high-order iterative schemes within neural network training, yet their performance on unseen problems remains highly uncertain. Such post-hoc validation is often neither feasible nor reliable for engineering practice. More significantly, according to a report from [32], nearly 80% of machine learning approaches for fluid-related PDEs benchmark their proposed models against weak baselines. This striking statistic reveals persistent overoptimism in machine learning applications for this domain. Accuracy, though important, is not the sole criterion for practical utility. What is equally, if not more, needed in engineering practice are guidelines grounded in physical priors, such as actual efficiency (not the one-sided efficiency that ignores additional overhead), robustness, stability, and the applicability domain of each method [16]. These considerations, however, remain severely underexplored in the current literature. For instance, [17] compares AD with FD on simple linear and weakly nonlinear problems, concluding that AD outperforms FD in training. This conclusion is drawn from a relatively narrow set of test cases and may not generalize well for several reasons: weak nonlinearity favors AD by design, higher-order FD schemes were not tested, and lower training loss does not guarantee fidelity in high-frequency regions. Convergence of neural network training loss alone, without a posteriori verification, is an insufficient metric for evaluating solver performance in engineering practice [33]. Recent work formalises this optimisation pathology under the term the term "hallucination": optimisers can attain low training loss while generating physically inadmissible solutions, meaning that additional safeguarding mechanisms become necessary particularly for strongly-nonlinear problems [34]. Nevertheless, broadly-applicable evaluation criteria decoupled from specific solver formulations and training pipelines are still lacking within the community, which motivates further in-vestigation into reliable assessment strategies for neural PDE solvers. To this end, we take a step toward filling this gap by systematically and fairly comparing AD and discretization-based formulations. Our goal is not to declare a winner, but to provide practical insights into when and why each paradigm is preferable, and to offer physically informed guidelines for engineering applications. In this work, our major contributions are generalized as follows:

  • We conduct a systematic comparative study of AD and discretization-based formulations across a wide spectrum of PDEs with increasing nonlinearity and boundary complexity, revealing that the accuracy advantage of discretization-based methods becomes increasingly pronounced as nonlinearity intensifies, while the approximation and optimization errors of AD escalate more rapidly in strongly nonlinear regimes.

  • We analyze errors through a rigorous decomposition framework that distinguishes approximation, discretization, and optimization errors, using the numerical solution obtained under identical discretization settings as a reference for truncation error. This enables a clear separation of the neural solver's approximation error from the underlying grid discretization error.

  • We provide a comprehensive and fair evaluation of different paradigms and network architectures across diverse scenarios, covering accuracy, efficiency, and robustness, and derive consistent empirical guidelines for selecting appropriate neural solver configurations in engineering practice. Our analysis further reveals key practical bottlenecks for achieving robust training under general hyperparameter configurations without extensive case-specific tuning or a posteriori reference solutions.

References (51)