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

Maciej J. Mikulski, Tadeusz Uhl
8/11/2026
cs.LGmath.NAphysics.comp-ph

No confident code implementation found for this paper.

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{mikulski2026derivative,
  title  = {Derivative Computation in PINNs: Automatic Differentiation, Finite Differences and Beyond},
  author = {Maciej J. Mikulski and Tadeusz Uhl},
  year   = {2026},
  eprint = {2608.11020},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2608.11020v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2608.11020.svg)](https://codeofpaper.com/paper/2608.11020)

Discussion