English

NestyNet. I. Physics Functions Are Hard to Fit with Neural Networks: A Framework for Accurate Surrogates and Analytic Derivatives

Instrumentation and Methods for Astrophysics 2026-08-06 v1 Data Analysis, Statistics and Probability

Abstract

Many of the smooth functions that matter most in physics are precisely the ones that standard neural network methods struggle to fit accurately. Here we present NestyNet, a coupled model-and-optimizer framework capable of fitting such targets to high accuracy while also delivering their gradients, Hessians, Laplacians, and antiderivatives analytically and at low cost. This makes it a natural substrate for scientific machine learning tasks. The model is a deterministic segmented analytic surrogate, and its optimizer is a second-order Levenberg--Marquardt scheme whose damping and linear solves are tailored to the stiff, strongly correlated parameter geometries induced by multiscale and sharply structured targets typical in physics and other scientific applications. On the AI Feynman benchmark of 120 physics equations, NestyNet achieves median improvement factors of 2100×2\,100\times for function values, 1400×1\,400\times for first derivatives, and 780×780\times for second derivatives relative to standard neural networks trained with first-order optimization (Adam). Even after refining those fits with quasi-Newton (L-BFGS) optimization, the corresponding improvements are 540×540\times, 450×450\times, and 250×250\times. Owing to the analytic design it is up to 44×\approx 44\times faster than vectorized automatic-differentiation (autograd) baselines, with a margin growing with model size. The same analytic-derivative framework also supports vector- and complex-valued targets, measurement uncertainties in both inputs and outputs, and constraints, and its modules can be composed flexibly to build scientifically useful model architectures, all without reverting to autograd. Together, these components provide a practical modular framework for fitting difficult scientific surrogates while delivering accurate differential operators for subsequent analysis.

Keywords

Cite

@article{arxiv.2608.05862,
  title  = {NestyNet. I. Physics Functions Are Hard to Fit with Neural Networks: A Framework for Accurate Surrogates and Analytic Derivatives},
  author = {Rodrigo Ibata and Wassim Tenachi and Foivos Diakogiannis and Neil Ibata and Anirudh Shankar},
  journal= {arXiv preprint arXiv:2608.05862},
  year   = {2026}
}

Comments

25 pages, 6 figures