Command Palette
Search for a command to run...
Stochastic Taylor Derivative Estimator: Effiziente Amortisierung für beliebige Differentialoperatoren
Stochastic Taylor Derivative Estimator: Effiziente Amortisierung für beliebige Differentialoperatoren
Zekun Shi Zheyuan Hu Min Lin Kenji Kawaguchi
Zusammenfassung
Die Optimierung neuronaler Netze mit Verlustfunktionen, die hochdimensionale Differentialoperatoren höherer Ordnung enthalten, ist mit Backpropagation aufwändig auszuwerten, da die Größe des Ableitungstensors mit O(dk) und der Berechnungsgraph mit O(2k−1L) skaliert, wobei d die Dimension des Definitionsbereichs, L die Anzahl der Operationen im Vorwärts-Berechnungsgraph und k die Ableitungsordnung ist. In früheren Arbeiten wurde die polynomiale Skalierung in d durch Amortisierung der Berechnung über den Optimierungsprozess mittels Randomisierung angegangen. Separat wurde die exponentielle Skalierung in k für univariate Funktionen (d=1) mit automatischer Differenzierung höherer Ordnung (AD) behandelt. In dieser Arbeit zeigen wir, wie man beliebige Kontraktionen des Ableitungstensors beliebiger Ordnung für multivariate Funktionen effizient durchführen kann, indem man die Eingangstangenten für die univariate AD höherer Ordnung geeignet konstruiert, wodurch beliebige Differentialoperatoren effizient randomisiert werden können. Angewandt auf Physics-Informed Neural Networks (PINNs) bietet unsere Methode eine mehr als 1000-fache Beschleunigung und eine mehr als 30-fache Speicherreduktion gegenüber Randomisierung mit AD erster Ordnung, und wir können nun PDEs mit einer Million Dimensionen in 8 Minuten auf einer einzelnen NVIDIA A100 GPU lösen. Diese Arbeit eröffnet die Möglichkeit, Differentialoperatoren höherer Ordnung in großskaligen Problemen einzusetzen.
One-sentence Summary
Researchers from the National University of Singapore and Sea AI Lab propose the Stochastic Taylor Derivative Estimator, which constructs input tangents to univariate high-order automatic differentiation to efficiently contract arbitrary-order derivative tensors of multivariate functions, yielding >1000× speed-up over prior randomization methods when solving high-dimensional PDEs with Physics-Informed Neural Networks.
Key Contributions
- The paper introduces STDE, a general method for constructing stochastic estimators for arbitrary differential operators by using univariate Taylor-mode automatic differentiation to evaluate arbitrary contractions of high-order derivative tensors efficiently.
- STDE combines randomization with high-order automatic differentiation to reduce the cost of high-dimensional and high-order differential operators in neural-network losses, making it applicable to Physics-Informed Neural Networks and other input-gradient problems such as adversarial attacks, feature attribution, and meta-learning.
- Experiments on Physics-Informed Neural Networks show more than 1000x speed-up and more than 30x memory reduction over randomization with first-order automatic differentiation, and enable 1-million-dimensional PDEs to be solved in 8 minutes on a single NVIDIA A100 GPU.
Introduction
The authors work at the intersection of automatic differentiation and physics-informed machine learning, where training objectives often contain high-order derivatives of neural networks with respect to their inputs. Computing these derivatives with repeated backward-mode AD can scale exponentially in both derivative order and input dimension, while randomized approaches such as SDGD, Hutchinson trace estimators, finite differences, and randomized smoothing can reduce cost but often rely on approximations, work well mainly for low-order or Laplacian-like operators, and may be sensitive to discretization or estimator variance.
The authors leverage Taylor mode AD to propose Stochastic Taylor Derivative Estimator, a method that uses constructed input tangents to contract high-order derivative tensors and randomize arbitrary differential operators efficiently. Their approach generalizes previous randomized estimators, clarifies limits of Hutchinson-type methods beyond fourth order, and enables faster, memory-efficient training of PINNs, including million-dimensional PDE problems on a single GPU.
Method
The authors first introduce Stochastic Dimension Gradient Descent as an operator approximation step. A differential operator D is decomposed into additive terms, each depending on only a few input dimensions, and a random subset is sampled at each iteration:
D:=j=1∑NDDj≈∣J∣NDj∈J∑Dj:=D~J,where J is the sampled index set. This reduces the cost of differentiation over large input dimensions d, but it does not remove the exponential dependence on derivative order k. The main method therefore builds on Taylor mode automatic differentiation and recasts high order derivative tensor contraction as an efficient jet propagation process.
The core mathematical idea is to view a univariate Taylor mode AD operator as a contraction of a multivariate derivative tensor. A jet of order k at a point a can be written as
Jgk(t)=(g(t),v(1),…,v(k)),and pushing this jet through a function F computes a high order Fréchet derivative. By setting some tangent vectors to 0, one can select diagonal, mixed, or structured entries of the derivative tensor. Thus, a kth order differential operator can be represented as a contraction between a derivative tensor and a coefficient tensor. For a scalar function u:Rd→R, a kth order operator L can be written as
Lu(a)=d1,…,dk∑Duk(a)d1,…,dkCd1,…,dk(L)=Duk(a)⋅C(L),where C(L) is zero except at the multi indices corresponding to terms in the operator. The Laplacian is a simple example because its coefficient tensor is the identity matrix I.
The proposed Stochastic Taylor Derivative Estimator replaces the exact tensor contraction with a random contraction. If the moments of the random jet match the coefficient tensor, that is,
E[vd1(v1)⋯vdk(vk)]=Cd1,…,dk(L),then the pushforward of a random higher order jet gives an unbiased estimator:
EJgl∼p[∂lu(Jgl)]=Lu(a).In practice, the authors estimate Lu(a) by averaging several pushforwards of independently sampled jets. The main computational modules are therefore: a random jet sampler, a Taylor mode AD pushforward, and a sample mean estimator. This design avoids explicitly constructing and storing the full kth order derivative tensor Duk.
The computation graph of the pushforward is central to the scalability of the method. As shown in the figure below:
The figure illustrates a second order pushforward through a sequence of primitives. The left column contains an input 2 jet with primal value x and tangents v(1) and v(2). Each primitive maps one jet to the next jet, so the output of one stage becomes the input of the next stage. The first tangent branch corresponds to a Jacobian vector product, while the second tangent branch accumulates Hessian vector products and the quadratic Hessian form. Because all tangent orders at a given layer can be processed in parallel, the method does not require sequential expansion over the derivative order. For one call to dkF, the memory scaling is O(kd) and the computation scaling is O(k2dL), where L is the number of primitives. Randomization further removes the polynomial dependence on input dimension d when only a subset of derivative directions is needed.
For many operators, the authors construct sparse random jets. Any coefficient tensor can be decomposed into basis tensor terms:
C(L)=d1,…,dk∑Cd1,…,dked1⊗⋯⊗edk,where ei is the ith standard basis vector. The method samples sparse jets built from these basis vectors with probabilities proportional to the corresponding coefficient entries:
p(⊗i=1kedi)=ZCd1,…,dk,where Z is a normalization factor. The normalization cancels the additive form of the operator. For example, the Laplacian estimator samples indices j and applies the second order pushforward with tangent ej and zero second tangent:
∇~J2uθ(a)=∣J∣dj∈J∑∂2uθ(a)(ej,0).For a high order diagonal operator L=∑j∂k/∂xjk, the same pattern applies by setting the first order tangent to ej and all higher order tangents to zero:
L~Juθ(a)=∣J∣dj∈J∑∂kuθ(a)(ej,0,…).For second order parabolic PDEs, the diffusion term may contain non diagonal Hessian entries. The authors remove this difficulty through a change of variable so that the operator becomes a sum over terms of the form
∂2u(x,t)(σ(x,t)ei,0).Then the stochastic estimator samples over the terms generated by the columns of σ(x,t).
When mixed partial derivatives cannot be removed by such a reformulation, the authors increase the jet order and encode each desired tensor entry as the output of a higher order pushforward. The required order depends on how non diagonal the target tensor slice is. If all differentiated dimensions are distinct, a higher order jet is needed, and the corresponding derivatives are recovered by reading different tangent orders from the output jet and applying chain rule scaling factors. This allows arbitrary kth order derivative tensor elements to be accessed from Taylor mode AD without constructing the full tensor.
The method also supports dense random jets. The classical Hutchinson trace estimator is recovered as a special case where the first order tangent is drawn from a distribution satisfying E[vv⊤]=I, and the second order pushforward is taken with a zero second tangent. For a general second order operator with symmetrically regularized coefficient tensor
C′′=21(C+C⊤)+λI=UΣU⊤,the authors construct an estimator by drawing Gaussian tangents with covariance Σ and subtracting a correction term associated with λI. Dense STDE can be more efficient for some operators, but it is not universally applicable beyond second order. The sparse version remains general, while the dense version can reduce variance in selected cases.
Experiment
The experiments evaluate STDE for amortized PINN training on inseparable, semilinear parabolic, high-order, and high-dimensional PDEs. They show that stochastic differential estimation preserves the PINN optimization objective while substantially reducing training computation and memory relative to standard backward-mode approaches. Ablation studies further attribute gains to implementation choices and favorable scaling, with exact derivative methods becoming less effective in high dimensions while STDE remains more efficient.
The speed ablation shows that implementation and parallelization choices strongly affect throughput for the two-body Allen-Cahn equation. STDE scales more robustly with dimension than PyTorch or sequential backward-mode SDGD, and it remains usable at very high dimension where most baselines run out of memory. Forward Laplacian performs best at low dimension but has poor scaling and fails at higher dimensions. Moving backward-mode SDGD from PyTorch to JAX gives a large speed improvement. Parallelizing backward-mode SDGD substantially increases speed over the sequential JAX version. Forward Laplacian is fastest in low dimension but degrades sharply as dimension grows. STDE shows the best high-dimensional scalability among the compared methods. STDE is reported to provide major speed and memory gains over the strongest SDGD baseline.
The memory comparison shows that STDE remains memory efficient as input dimension grows, while baseline stochastic gradient methods and exact forward Laplacian scale less favorably. Reimplementing the original method in JAX and parallelizing sampled-dimension work lowers peak memory relative to the original PyTorch loop, but still causes out of memory failures at very large dimensions. STDE uses much less memory than the strongest SDGD baseline in high dimensional settings and avoids the poor scaling of the exact Laplacian approach. STDE remains memory efficient at the largest tested dimension where baselines fail. JAX and parallelization reduce peak memory relative to the original PyTorch implementation. Forward Laplacian is memory competitive only at small dimension and scales worse at high dimension. Parallelized backward-mode and mixed mode variants have similar memory behavior. STDE achieves substantial memory savings over the strongest SDGD baseline.
Experiments evaluate the two-body Allen-Cahn case through speed ablations and memory comparisons, validating the impact of implementations, parallelization, and scaling behavior across methods. The speed results show that JAX and parallelization improve backward-mode SDGD, Forward Laplacian is fastest only at low dimension, and STDE scales most robustly and remains usable at very high dimensions. The memory results confirm that STDE avoids the poor scaling of exact Laplacian and achieves substantial memory savings over the strongest SDGD baseline, while JAX and parallelization reduce peak memory.