Pith. sign in

REVIEW 3 major objections 5 minor 13 references

Derivative Computation in PINNs: Automatic Differentiation, Finite Differences and Beyond

T0 review · 3 major / 5 minor · reviewed 2026-08-12 · deepseek-v4-flash

Pith's one-line read Finite-difference derivatives, computed with a calibrated step size, match automatic-differentiation accuracy in physics-informed neural networks.

desk verdict Solid paper on a practical question; the FD/AD equivalence holds on the tested benchmarks, and the main fixes are code release and a narrower generalization claim. read the letter →

arxiv 2608.11020 v1 pith:HM7AEPVP submitted 2026-08-11 cs.LG cs.NAmath.NAphysics.comp-ph

classification cs.LGcs.NAmath.NAphysics.comp-ph
keywords physics-informedneuralnetworksfinitedifferencesautomaticdifferentiationstep-sizecalibrationstochasticper-samplederivativesbatchnormalizationself-attention
verification ladder T0 review T1 audit T2 compute T3 formal

The pith

A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.

The reading

This paper investigates whether finite differences can substitute for automatic differentiation inside physics-informed neural networks. It argues that they can, provided the finite-difference step size is chosen carefully and recalibrated as training changes the network's smoothness. On three benchmark PDEs, finite differences, exact-order finite differences, and automatic differentiation produce statistically indistinguishable solution accuracy, while finite differences run faster and use less memory. A stochastic variant helps on a stationary problem with a solution-collapse failure mode, but hurts on shock-forming and time-dependent problems. If the paper is right, practitioners can replace automatic differentiation with finite differences for standard MLP-based physics-informed networks without losing accuracy, and gain speed and memory headroom.

What carries the argument

The central object is the three-point central-difference stencil applied to the network output, evaluated on an enlarged batch of perturbed points in a single forward pass. The load-bearing identity is the error balance between truncation and floating-point roundoff: for a $k$-th derivative the error scales roughly as $C_{\mathrm{trunc}}\varepsilon^{2}+C_{\mathrm{round}}\varepsilon_m/\varepsilon^{k}$, whose minimum sits at $\varepsilon_{\mathrm{opt}}\propto \varepsilon_m^{1/(k+2)}$. Because the constant is function-dependent and changes as training changes the network, the paper calibrates $\varepsilon$ empirically by comparing FD against an AD reference on logarithmically spaced candidates and recalibrating periodically. For mixed-order PDEs it offers three combination rules: a geometric-mean step size (FD), separate order-specific step sizes (eFD), and log-uniform stochastic sampling between the two optima (sFD); the last acts as scale-local regularization.

What would settle it

Track the finite-difference error against step size at several epochs of a single FP32 training run on a problem whose solution develops a sharp front; if the empirical optimal step ever leaves the $[10^{-6},10^{-1}]$ range, or the error curve develops a second minimum, the calibrated FD method will not remain statistically indistinguishable from AD on that problem.

Watch

Extended reading notes

Core claim

On MLP-based PINNs, properly calibrated finite-difference derivative computation is interchangeable with automatic differentiation: on all tested benchmarks the solution differences among AD, FD, and eFD are smaller than seed-to-seed variance, so the two schemes cannot be told apart by their solutions, only by their cost. The optimal step size follows $\varepsilon_{\mathrm{opt}}\propto \varepsilon_m^{1/(k+2)}$ for a $k$-th derivative, and the paper closes the undetermined constant with an empirical search over logarithmically spaced candidates that is repeated periodically during training. For architectures with inter-sample dependencies, the common batched autograd idiom with a vector of ones as the output gradient gives silently wrong per-sample derivatives; the correct per-sample treatment costs $O(B)$ separate backward passes, while finite differences provide a forward-only approximation that is empirically about an order of magnitude closer to the true derivative on BatchNorm networks and about three times closer on attention networks. The paper reads this as evidence that AD is not essential for training PINNs, against a recently argued position.

Load-bearing premise

The calibration procedure assumes that the finite-difference error as a function of step size stays V-shaped with a single minimum inside the candidate range $[10^{-6},10^{-1}]$ throughout training, and that the unknown constant in the optimal-step-size formula remains of order one, so the recalibrated step size stays near the true optimum.

Editorial extensions

If this is right

  • On standard MLP PINNs, FD and eFD can be dropped in for AD with periodic step-size recalibration, matching AD's accuracy while cutting per-step time and peak memory on the tested range.
  • eFD, which assigns each derivative order its own optimal step size, remains within seed-to-seed noise of AD on mixed-order PDEs, so it is a safe choice when a PDE contains both first and second derivatives.
  • sFD is not a general replacement: it improves the stationary Poisson benchmark but degrades accuracy on shock-forming and time-dependent problems, so it should be reserved for collapse-prone stationary problems.
  • For networks with BatchNorm or attention, the batched vector-of-ones autograd idiom is wrong; the only exact AD route is a per-sample loop that becomes impractical at PINN batch sizes, while FD offers a forward-only approximation with much smaller error.
  • Because FD keeps memory nearly constant in derivative order and batch size, it enables batch sizes an order of magnitude or more beyond what correct AD can reach on inter-sample architectures.

Reading between the lines

Editorial extensions of the paper, not claims the author makes directly.

  • Editorial inference: the interchangeability result suggests the same calibrated-FD recipe could apply to any derivative-based scientific ML loss where the architecture is sample-independent, such as gradient penalties or score matching, as long as the step size is recalibrated to that loss's scale.
  • Editorial inference: the silent per-sample-gradient failure is likely broader than the two architectures tested; any layer that mixes information across a batch or sequence, including other normalization schemes, deserves the same FD-versus-reference diagnostic.
  • Editorial inference: if the error curve becomes multimodal as solutions develop sharp features, a natural extension is to make the step size a learned or scheduled multi-scale distribution rather than a single recalibrated value, turning sFD's noise into a deliberately adaptive prior.
  • Editorial inference: a direct test no one reported would compare FD and AD on fourth-order PDEs in FP32, where roundoff amplification scales as $\varepsilon^{-4}$ and the paper's own limitations section leaves the $\varepsilon_m^{1/6}$ scaling open.
Share X Bluesky LinkedIn Reddit HN

Signed reviews

No signed human review yet.

Editorial analysis

A structured set of objections, weighed in public.

Desk editor's note, referee report, and a circularity audit.

Referee Report

3 major / 5 minor

Summary. The paper investigates replacing automatic differentiation (AD) with finite differences (FD) for computing the derivative terms in physics-informed neural network (PINN) losses. It develops an empirical step-size calibration procedure, analyzes the truncation/roundoff trade-off theoretically, proposes three FD strategies (FD, eFD, sFD), and compares them against AD on three PINNacle benchmark PDEs (Poisson 2D, Burgers 1D, Heat2D-CG). The main empirical claim is that, with calibrated step sizes, AD, FD, and eFD produce statistically indistinguishable solution accuracies on MLP-based PINNs, while FD is faster and more memory-efficient. The paper further identifies a silent failure mode of the batched PyTorch autograd idiom for architectures with inter-sample dependencies (BatchNorm, self-attention) and shows that FD gives a partial mitigation. The experiments use 25-26 seeds per configuration, matched architectures, and an AD baseline that is competitive with PINNacle's best reported results.

Significance. If the results hold, this is a useful and timely contribution. The equivalence of calibrated FD and AD on several standard PINN benchmarks is a nontrivial observation that challenges the common assumption that AD is indispensable for PINN training, and the measured speed/memory advantages are practically relevant. The paper also gives a clear cautionary demonstration that the grad_outputs=ones idiom is silently incorrect for per-sample derivatives in inter-sample architectures, which is an important pitfall for the community. Strengths of the experimental methodology include the large number of seeds, the recalibration ablation spanning four orders of magnitude, the strong AD baseline, and the explicit reporting of means and standard deviations. The claims are falsifiable and the experimental protocol is described in enough detail to be reproduced; however, code and data are only promised for publication. The two main caveats are that the calibration procedure itself relies on an AD reference, so FD is not fully AD-free, and that the step-size optimality assumptions are validated only on a fixed network at initialization rather than throughout training.

major comments (3)
  1. [§3.3, Algorithm 2; §5.4] The proposed step-size calibration chooses ε by minimizing the RMSE between the FD approximation and an AD-computed reference. This means the central practical claim that FD is a drop-in replacement for AD is only established for the residual-evaluation phase after an AD-based calibration has been performed. Section 5.4 recommends 'Use FD as the default' without mentioning that the default step size is obtained from an AD oracle. Since the final solution accuracy is measured against reference PDE solutions, this is not full circularity, but it does weaken the 'alternative to AD' framing. The authors should either qualify the recommendation (e.g., state that one AD calibration at initialization is required, or that ε can be chosen from the theoretical scaling with fixed constants), or provide an AD-free calibration procedure. This is load-bearing for the paper's practical conclusion.
  2. [§4.2; §3.3; Figure 5] The error-versus-ε analysis is validated only on a fixed, randomly initialized MLP at a single snapshot (Section 4.2). The recalibration ablation in Figure 5 varies the refresh interval, but it never checks whether the minimizing ε remains inside the searched FP32 range [1e-6, 1e-1] or whether the error curve remains V-shaped and unimodal later in training. On Burgers 1D, where a sharp front develops around t≈0.3, the function-dependent prefactor (|f|/|f'''|) can change substantially; if the true optimum leaves the candidate range, Algorithm 2 returns a boundary value and the FD derivative error is no longer negligible relative to optimization noise. The reported agreement with AD on the three benchmarks is consistent with the assumption holding, but the broad 'practical settings' claim requires additional evidence. A concrete fix is to report the calibrated ε as a function of epoch for each benchmark (and ideally the error landscape at several epochs), showing that the optimum is tracked rather than clipped at a range boundary.
  3. [Tables 3-5; §5.1] The central equivalence claim is expressed as 'statistically indistinguishable,' but no formal statistical test or confidence interval is reported. With 26 seeds, pairwise differences of the observed magnitude are very likely insignificant, so the claim is plausible; nonetheless, the word 'statistically' invites a hypothesis test. Reporting 95% confidence intervals for the pairwise L2 differences, or a simple nonparametric test, would make the claim precise. Alternatively, the wording should be softened to 'differences are small relative to seed-to-seed variance' if no test is performed.
minor comments (5)
  1. [§3.4] The statement that eFD has '40% higher batch size' appears inconsistent with the stencil counts: FD uses 3 forward evaluations per collocation point (x, x±ε_GM), while eFD uses 5 (x, x±ε1, x±ε2), which is 67% more evaluations. If center evaluations are shared differently or if the comparison is against a different baseline, the accounting should be clarified.
  2. [Figure 1; Table 2] Figure 1's caption reports an L2 relative error of 1.15% for sFD, while Table 2 reports 1.11% ± 0.39% as the mean over 26 seeds. Please clarify whether Figure 1 shows a representative seed, the mean solution, or a different metric.
  3. [Throughout] The manuscript contains numerous typographical errors and awkward phrasings (e.g., 'vinicty,' 'unknwon,' 'durign,' 'substaintally,' 'the on that grid,' 'Similary'), and the text in several places appears to have had spacing stripped, making it difficult to read. A careful proofreading and formatting pass is needed.
  4. [§7-8] The data and code availability statements say the artifacts 'will be made available upon publication.' For a computational paper whose central claims depend on exact training configurations, I encourage the authors to provide the code and data with the revision, rather than only at publication, to allow reviewers to verify the results.
  5. [§3.5; Appendix B] In Appendix B, the FD approximation still disagrees with the per-sample AD reference by 0.79 for BatchNorm and 2.1 for attention. The 'order of magnitude closer' wording is accurate for BatchNorm and roughly a factor of three for attention, but the reader should be reminded that FD is a partial mitigation, not a correct per-sample derivative, as the authors themselves note.

Circularity Check

1 steps flagged · score 4.0 of 10

FD/AD equivalence is partly built into the definition of a 'properly calibrated' step size, though final solution errors are measured against external PDE references.

  1. fitted input called prediction [Algorithm 2 (Section 3.3) and Section 5.1; central result in Section 4.3.2]
    "The above analysis motivates the following procedure that evaluates n logarithmically spaced candidate step sizes and selects the one that minimizes the RMSE between the FD approximation and the AD-computed reference. [...] The most immediately practical finding of Section 4 is that on MLP-based PINNs with a properly calibrated step size, AD, FD, and eFD produce statistically indistinguishable solutions on every problem we tested."

    Algorithm 2 defines the 'optimal' or 'properly calibrated' epsilon as the value that minimizes the difference between the FD derivative and the AD derivative on the calibration collocation points. Therefore the derivative-level closeness of FD to AD is the selection objective itself, not an independent result. When the paper then concludes that 'with a properly calibrated step size' FD and AD are interchangeable, part of that equivalence is guaranteed by construction at the derivative level.

full rationale

The paper is largely self-contained and does not rely on load-bearing self-citations: the cited prior work is external, and the benchmark reference solutions come from PINNacle/COMSOL rather than from the authors' own fitted quantities. The main circularity concern is the empirical step-size calibration: 'properly calibrated' is operationalized in Algorithm 2 as minimizing the RMSE between FD and AD derivatives, so the subsequent observation that FD and AD are statistically indistinguishable is partly a consequence of that calibration objective. However, the final accuracy claims are not solely comparisons against AD; they are measured against independent reference PDE solutions, and the training dynamics could in principle break the equivalence even with a good epsilon. Thus the central claim retains genuine empirical content. The scaling law epsilon_opt = C * eps_m^(1/(k+2)) also has an undetermined prefactor C that is fit empirically, but the paper explicitly acknowledges this ('the actual optimum differs by a function-dependent prefactor that the analysis leaves undetermined'), so it is not a hidden circular step. The unverified assumption that the optimal epsilon remains inside the FP32 heuristic range with a single V-shaped error curve throughout training is a robustness/correctness concern, not circularity.

Assumptions & free parameters 6 free parameters · 5 assumptions · 0 invented entities

The central result rests on the fitted FD step size epsilon and on the transfer of the calibration to training. The theoretical error model has two unknown constants that are fit to the measured V-shape minima. No new physical entities are introduced.

free parameters (6)
  • FD step size epsilon (per derivative order, per problem) = Not reported numerically; chosen by Algorithm 2 to minimize RMSE vs AD on a sample of collocation points
    The central hyperparameter; the claim that FD matches AD depends on picking this value well. It is fitted to the AD reference, making the match partly by construction.
  • Scaling constants C1, C2 in epsilon_opt = C * epsilon_m^(1/(k+2)) = C1 about 2-3 (Section 4.2); C2 implied by same fit
    The theoretical analysis leaves these undetermined; they are fit from the measured V-shape minima, so the 'prediction' of the scaling is not parameter-free.
  • sFD sampling range [epsilon_opt^(1), epsilon_opt^(2)] = Derived from the calibrated order-specific optima for each problem
    The stochastic variant draws epsilon from an interval whose endpoints are the fitted values; the choice of log-uniform sampling is ad hoc.
  • Recalibration interval = 4000 epochs (main runs)
    Chosen by the authors; ablation shows results are robust between 1 and 4000 epochs, but degrade at 10000, so this is a tuned schedule.
  • Loss weights lambda_IC, lambda_BC = 10 (Burgers, Heat2D-CG), 1000 (Poisson)
    Standard PINN hyperparameters, not central to the FD vs AD comparison but part of the experimental setup.
  • Candidate epsilon range and number of candidates = 1e-6 to 1e-1, n=50 (FP32)
    Heuristic choice in Algorithm 2; the paper does not test sensitivity to this range.
assumptions (5)
  • domain assumption The network function f_theta is sufficiently smooth (C^4 for first derivative, C^5 for second) so that Taylor expansions hold and the central difference truncation error formulas are valid.
    Used throughout Section 3.2; true for tanh MLPs in principle, but the solution can develop sharp features (Burgers shock) where higher derivatives are large.
  • domain assumption The floating-point roundoff error model E_round = kappa_k * epsilon_m * |f(x)| / epsilon^k with constant kappa_k holds for the neural network evaluations.
    Sections 3.2.1-3.2.2; the constants are unknown and fitted empirically.
  • domain assumption AD provides an exact per-sample derivative reference for calibration purposes.
    Algorithm 2 uses ad_derivative as the 'exact' reference; for the plain MLP this is true, but it is precisely what is called into question for inter-sample architectures.
  • ad hoc to paper The error-versus-epsilon curve has a single minimum in the candidate range [1e-6, 1e-1] for all networks encountered during training.
    Required for Algorithm 2 to select a unique optimal epsilon; not proven.
  • ad hoc to paper For BatchNorm/attention models, the FD stencil, evaluated through the batched forward pass, yields a derivative approximation that is a useful partial mitigation of the inter-sample error.
    Section 3.5 and Appendix B; the FD estimate also sees inter-sample dependencies through the batch, so it is not a true per-sample derivative either.

how reviews work

0 comments
Cite this review

Pith. "Pith review of Derivative Computation in PINNs: Automatic Differentiation, Finite Differences and Beyond." pith.science (2026). https://pith.science/paper/HM7AEPVP

@misc{pith2026260811020,
  author       = {Pith},
  title        = {Pith review of: Derivative Computation in PINNs: Automatic Differentiation, Finite Differences and Beyond},
  year         = {2026},
  howpublished = {\url{https://pith.science/paper/HM7AEPVP}},
  note         = {Machine review of arXiv:2608.11020}
}
read the original abstract

We systematically investigate finite-difference (FD) derivative computation in Physics-Informed Neural Networks (PINNs) as an alternative to automatic differentiation (AD). On three benchmark PDEs we show that, with a properly calibrated step size, FD matches AD in accuracy on every problem while running faster across the full tested batch-size range and using substantially less GPU memory, and that a stochastic variant we propose outperforms AD on a stationary problem. We further show that for neural architectures with inter-sample dependencies (e.g. BatchNorm, self-attention) the standard PyTorch autograd idiom is silently incorrect; the correct per-sample alternative is computationally infeasible at PINN-relevant batch sizes, while FD provides a forward-only approximation that is empirically an order of magnitude closer to the true per-sample derivative.

Figures

Figures reproduced from arXiv: 2608.11020 by the authors.

Figure 1
Figure 1. Solution of the 2D Poisson equation on a multiply-connected domain — a square with [PITH_FULL_IMAGE:figures/full_fig_p001_1.png] view at source ↗
Figure 2
Figure 2. Error (RMSE and max) of the central finite-difference approximation of the first derivative [PITH_FULL_IMAGE:figures/full_fig_p011_2.png] view at source ↗
Figure 3
Figure 3. Error (RMSE) of the central finite-difference approximation of the first derivative as a [PITH_FULL_IMAGE:figures/full_fig_p011_3.png] view at source ↗
Figures from the paper (2 more)
Figure 4
Figure 4. Figure 4: Wall-clock time per training step (top) and peak GPU memory (bottom, measured on a 12 [PITH_FULL_IMAGE:figures/full_fig_p015_4.png]
Figure 5
Figure 5. Figure 5: Ablation of the ε recalibration interval on Burgers 1D, Heat2D-CG, and Poisson 2D (L2 relative error vs. interval). FD and eFD are robust to the interval across four orders of magnitude; sFD is stable on Poisson but fails catastrophically on Burgers and Heat2D-CG when …

Discussion (0). Continue with ORCID to comment.

Reference graph

Works this paper leans on

13 extracted references · 6 canonical work pages

  1. [4]

    My Ha Dao, Pao-Hsiung Chiu, Jian Cheng Wong, and Chin Chun Ooi

    doi: 10.1007/s10915-022-01939-z. My Ha Dao, Pao-Hsiung Chiu, Jian Cheng Wong, and Chin Chun Ooi. Physics-informed neural network with numerical differentiation for modelling complex fluid dynamic problems.Volume 7: CFD and FSI,

  2. [5]

    Tim De Ryck and Siddhartha Mishra

    doi: 10.1115/omae2022-81237. Tim De Ryck and Siddhartha Mishra. Numerical analysis of physics-informed neural networks and related models in physics-informed machine learning.Acta Numerica, 33:633 – 713,

  3. [7]

    ISBN 9798400720185

    Association for Computing Machinery. ISBN 9798400720185. doi: 10.1145/3784013. 3784074. Zhongkai Hao, Jiachen Yao, Chang Su, Hang Su, Ziao Wang, Fanzhi Lu, Zeyu Xia, Yichi Zhang, Songming Liu, Lu Lu, and Jun Zhu. PINNacle: A comprehensive benchmark of physics-informed neural networks for solving PDEs. InAdvances in Neural Information Processing Systems, v...

  4. [8]

    Andreas Langer

    doi: 10.1002/fld.5217. Andreas Langer. The ill-posed foundations of physics-informed neural networks and their finite- difference variants.arXiv preprint arXiv:2601.07017,

  5. [9]

    Tianyu Pang, Kun Xu, Chongxuan Li, Yang Song, Stefano Ermon, and Jun Zhu

    doi: 10.1109/SMC53654.2022.9945171. Tianyu Pang, Kun Xu, Chongxuan Li, Yang Song, Stefano Ermon, and Jun Zhu. Efficient learning of generative models via finite-difference score matching. InAdvances in Neural Information Processing Systems, volume 33,

  6. [11]

    Transition models: Rethinking the generative learning objective.arXiv preprint arXiv:2509.04394,

    Zidong Wang, Yiyuan Zhang, Xiaoyu Yue, Xiangyu Yue, Yangguang Li, Wanli Ouyang, and Lei Bai. Transition models: Rethinking the generative learning objective.arXiv preprint arXiv:2509.04394,

  7. [12]

    Hybrid finite difference with the physics-informed neural network for solving PDE in complex geometries.arXiv preprint arXiv:2202.07926,

    Zixue Xiang, Wei Peng, Weien Zhou, and Wen Yao. Hybrid finite difference with the physics-informed neural network for solving PDE in complex geometries.arXiv preprint arXiv:2202.07926,

  8. [13]

    Jiaming Zhang, David Dalton, Hao Gao, and Dirk Husmeier

    doi: 10.1063/5.0159224. Jiaming Zhang, David Dalton, Hao Gao, and Dirk Husmeier. Physics-informed deep learning based on the finite difference method for efficient and accurate numerical solution of partial differential equations. InProceedings of the 5th International Conference on Statistics: Theory and Applications (ICSTA’24), Barcelona, Spain,

Show all 13 references
  1. [2019]

    2018.10.045

    doi: 10.1016/j.jcp. 2018.10.045. Nityananda Roy, Robert Dürr, Andreas Bück, and S. Sundar. Finite difference physics-informed neuralnetworksenableimprovedsolutionaccuracyoftheNavier–Stokesequations.arXiv preprint arXiv:2501.00014,

  2. [2022]

    20 Junwoo Cho, Seungtae Nam, Hyunmo Yang, Seok-Bae Yun, Youngjoon Hong, and Eunbyung Park

    doi: 10.1016/j.cma.2022.114909. 20 Junwoo Cho, Seungtae Nam, Hyunmo Yang, Seok-Bae Yun, Youngjoon Hong, and Eunbyung Park. Separable physics-informed neural networks. InAdvances in Neural Information Processing Systems, volume 36,

  3. [2023]

    Chuqi Chen, Yahong Yang, Yang Xiang, and Wenrui Hao

    doi: 10.1088/2632-2153/acf97a. Chuqi Chen, Yahong Yang, Yang Xiang, and Wenrui Hao. Automatic differentiation is essential in training neural networks for solving differential equations.Journal of Scientific Computing, 104,

  4. [2024]

    Zekai Guo and Ye Li

    doi: 10.1017/s0962492923000089. Zekai Guo and Ye Li. Fd-pinn: A finite-difference physics-informed neural network with adaptive residual point selection for seismic inversion. InProceedings of the 2025 2nd Symposium on Big Data, Neural Networks, and Deep Learning, BDNNDL ’25, ...

  5. [2025]

    Pao-Hsiung Chiu, Jian Cheng Wong, Chinchun Ooi, My Ha Dao, and Yew-Soon Ong

    doi: 10.1007/s10915-025-02965-3. Pao-Hsiung Chiu, Jian Cheng Wong, Chinchun Ooi, My Ha Dao, and Yew-Soon Ong. CAN-PINN: A fast physics-informed neural network based on coupled-automatic-numerical differentiation method.Computer Methods in Applied Mechanics and Engineering, 395:114909,

Pith tools

Reviewed August 12, 2026 · model on record in the stance chip above.