Zero coordinate shift: Whetted automatic differentiation for physics-informed operator learning

Kuangdai Leng, Mallikarjun Shankar, Jeyan Thiyagalingam · DOI

TL;DR

Researchers have developed a clever mathematical "trick" called Zero Coordinate Shift (ZCS) that slashes the GPU memory and training time of physics-informed operator networks (like DeepONets) by an order of magnitude. By reframing how automatic differentiation handles coordinate derivatives, ZCS turns a computationally expensive "many-to-many" problem into a streamlined "one-to-many" operation without sacrificing any accuracy.

What Problem Does This Paper Address?

Physics-Informed Neural Networks (PINNs) have revolutionized how we solve partial differential equations (PDEs) by embedding physical laws directly into the loss function. However, PINNs usually solve for one specific scenario. Physics-Informed Neural Operators (PINOs), such as DeepONets, go a step further: they learn to map entire families of physical parameters (like varying material properties or source terms) to their corresponding solutions.

The bottleneck is Automatic Differentiation (AD). To enforce a PDE, the model must calculate high-order derivatives of its output with respect to spatial/temporal coordinates. In operator learning, you aren't just doing this for one set of points, but for thousands of different physical functions simultaneously. Standard AD libraries (like PyTorch or TensorFlow) struggle with this "many-roots-many-leaves" structure, leading to massive computational graphs that devour GPU memory and slow training to a crawl. Current workarounds—either looping through functions one by one or duplicating data—are inefficient and don't scale.

Methods

The authors introduce the Zero Coordinate Shift (ZCS) algorithm. The core idea is elegantly simple:

  1. The Shift: Instead of calculating derivatives with respect to every individual coordinate $x_j$, they introduce a single dummy scalar variable $z$ and shift all coordinates by it: $x_j + z$.
  2. The Equivalence: Using basic calculus, they prove that the derivative of the output with respect to the coordinate is identical to the derivative with respect to this single dummy variable $z$, evaluated at $z=0$.
  3. Graph Optimization: This shift collapses the derivative requirement from "many-roots-many-leaves" (where every point is a leaf) to "one-root-many-leaves" (where $z$ is the only leaf).
  4. Reverse-Mode Efficiency: By further introducing a dummy tensor $a_{ij}$ to create a scalar-valued root, they make the process perfectly compatible with highly optimized reverse-mode AD.

This approach is "agnostic" to the network architecture, meaning it can be plugged into existing DeepONet implementations with minimal code changes (the authors extended the popular DeepXDE library).

Datasets

The researchers evaluated ZCS across a variety of PDE benchmarks to test its scaling and versatility:

  • Scaling Benchmark: A high-order linear 2D PDE used to test how the method handles increasing numbers of functions ($M$), points ($N$), and derivative orders ($P$).
  • 1D Reaction-Diffusion: A standard small-scale demonstration problem.
  • 1D Burgers’ Equation: A larger-scale problem involving 12,800 collocation points.
  • Kirchhoff-Love Plate Bending: A complex 4th-order scalar-valued PDE.
  • 2D Stokes Flow: A 2nd-order vector-valued PDE describing fluid flow in a square box.

Key Insights and Ideas

  • The "Aha" Moment: The realization that a global translation (the shift $z$) contains all the information needed for local derivatives. By shifting the entire coordinate field by the same tiny amount, you can extract the gradient for every point simultaneously using a single backpropagation pass.
  • Graph Size Matters: The primary reason ZCS is faster isn't just "better math"—it's that it prevents the computational graph from exploding. In traditional methods, the graph size scales linearly with the number of physical functions ($M$). With ZCS, the graph size remains nearly constant regardless of how many functions you process in a batch.
  • Low-Level Optimization: Unlike many papers that propose new neural architectures, this is a low-level optimization technique. It doesn't change what the model learns, only how efficiently it learns it.

Key Results

The performance gains are dramatic, as shown in the paper's benchmarks:

  • Memory Savings: For complex problems like the Kirchhoff-Love plate, GPU memory usage dropped from ~78 GB (nearly the limit of an A100 GPU) to just ~3 GB.
  • Speedup: Training time for 1000 batches was reduced from ~4081 seconds to ~144 seconds—a roughly 28x speedup.
  • Scaling: While traditional methods (FuncLoop or DataVect) see memory and time usage skyrocket as the number of functions increases, ZCS remains nearly flat, allowing for much larger batch sizes.
  • Accuracy: In all cases, the relative error of the ZCS-trained models was identical to (or slightly better than) the baseline methods, confirming that the optimization doesn't compromise the physics.

Limitations and Future Work

  • Pointwise Operators Only: ZCS is designed for "pointwise" operators like DeepONets. It does not provide the same benefits for models built on structured grids, such as Convolutional Neural Networks (CNNs) or Fourier Neural Operators (FNOs), where techniques like Finite Differences or FFT are already highly efficient.
  • Derivative Order Limits: While ZCS handles high-order derivatives much better than standard AD, the computational cost still grows with the order of the PDE ($P$). The authors suggest that for extremely high-order systems, decomposing them into systems of first-order PDEs remains a sensible strategy.
  • Future Directions: The authors suggest ZCS could be further optimized for forward-mode AD as that technology matures in deep learning libraries.

Summary updated

BibTeX
@article{leng2024zero,
  author = {Kuangdai Leng and Mallikarjun Shankar and Jeyan Thiyagalingam},
  title = {{Zero coordinate shift: Whetted automatic differentiation for physics-informed operator learning}},
  journal = {Journal of Computational Physics},
  year = {2024},
  doi = {10.1016/j.jcp.2024.112904},
}
Figure