Collapsing Taylor Mode Automatic Differentiation
Felix Dangel, Tim Siebert, Marius Zeinhofer, Andrea Walther
TL;DR
This work tackles the computational burden of evaluating PDE operators with neural networks by introducing Collapsed Taylor Mode AD, a graph-rewrite optimization that leverages linearity to propagate the sum of highest-order Taylor coefficients instead of aggregating results post-hoc. The method generalizes forward schemes like the forward Laplacian and extends to randomized Taylor mode and arbitrary linear differential operators via Faà di Bruno expansions and Griewank interpolation. Empirical results on Laplacian, weighted Laplacian, and biharmonic operators show substantial speedups and memory reductions over standard Taylor mode and outperform nested first-order AD, with potential integration into ML compilers to automate these rewrites. The approach is implemented in PyTorch using torch.fx and demonstrates practical gains for scientific ML tasks such as PINNs and VMC, suggesting broad applicability and a route toward broader adoption of Taylor mode in PDE contexts.
Abstract
Computing partial differential equation (PDE) operators via nested backpropagation is expensive, yet popular, and severely restricts their utility for scientific machine learning. Recent advances, like the forward Laplacian and randomizing Taylor mode automatic differentiation (AD), propose forward schemes to address this. We introduce an optimization technique for Taylor mode that 'collapses' derivatives by rewriting the computational graph, and demonstrate how to apply it to general linear PDE operators, and randomized Taylor mode. The modifications simply require propagating a sum up the computational graph, which could -- or should -- be done by a machine learning compiler, without exposing complexity to users. We implement our collapsing procedure and evaluate it on popular PDE operators, confirming it accelerates Taylor mode and outperforms nested backpropagation.
