Adaptive Checkpoint Adjoint Method for Gradient Estimation in Neural ODE

Juntang Zhuang, Nicha C. Dvornek, Xiaoxiao Li, Sekhar Tatikonda, Xenophon Papademetris, James S. Duncan

Abstract

Neural Ordinary Differential Equations (NODEs) offer a continuous-depth alternative to traditional discrete neural networks, but their practical application has been hindered by inaccurate gradient estimation. This paper introduces the Adaptive Checkpoint Adjoint (ACA) method, which addresses the numerical drift of the standard adjoint method and the memory inefficiency of naive backpropagation. By employing smart checkpointing and local backpropagation, ACA enables NODEs to achieve superior accuracy and stability. Experimental results on CIFAR benchmarks and physical simulations show that ACA-trained NODEs can outperform parameter-matched ResNets and reliably model complex time-series data.

Introduction

Traditional neural networks, such as ResNets, process data through a series of discrete layers. Neural ODEs (NODEs) reimagine this architecture by treating network depth as a continuous time variable, modeling data transformations as ordinary differential equations. Despite their theoretical elegance, NODEs have historically struggled on standard benchmarks; for instance, yielding a 19% error rate on CIFAR-10 compared to 5% for ResNets. This paper identifies inaccurate gradient estimation as the primary cause of this performance gap and proposes a novel training technique to resolve it.

The Gradient Estimation Challenge

To train a NODE, gradients must be calculated by backpropagating through an ODE solver. Existing approaches face a trade-off between memory and accuracy:

  1. The Adjoint Method: While memory-efficient, it attempts to reconstruct the forward pass by running the ODE solver backwards in time. Numerical truncation errors cause this reverse trajectory to drift from the original forward path, leading to inaccurate gradients.
  2. The Naive Method: This approach records every operation of the solver. However, adaptive solvers take many trial-and-error steps, creating a redundantly deep computation graph that causes memory bloat and vanishing gradients.
Comparison of backward trajectories: The standard Adjoint method drifts from the true path, while ACA maintains accuracy.

Methods: Adaptive Checkpoint Adjoint (ACA)

The authors propose the Adaptive Checkpoint Adjoint (ACA) method to balance efficiency and accuracy. ACA utilizes two key strategies:

  • Smart Checkpointing: During the forward pass, ACA discards the trial-and-error steps of the adaptive solver, saving only the "accepted" time steps and their hidden states as checkpoints.
  • Accurate Local Backpropagation: During the backward pass, ACA uses these checkpoints to perform local forward and backward passes. This ensures the reverse trajectory perfectly matches the forward trajectory, eliminating numerical drift while keeping the computation graph shallow.

Key Results

ACA significantly improves both the training stability and final performance of NODEs. On the CIFAR-10 benchmark, training with ACA reduced the error rate to 4.85%, outperforming a standard ResNet18 (6.98%) with the same number of parameters. Furthermore, ACA-trained models exhibited higher test-retest reliability and faster convergence than those using the standard Adjoint method.

Absolute error in gradient estimation across integration time for ACA, Adjoint, and Naive methods.

Beyond image classification, ACA excels in physics-informed AI. By incorporating physical laws directly into the NODE architecture, the model successfully predicted chaotic trajectories in the Three-Body Problem where standard LSTMs failed. It also achieved lower Mean Squared Error on irregularly sampled time-series data from the Mujoco dataset.

Conclusion

The Adaptive Checkpoint Adjoint method proves that the perceived limitations of Neural ODEs were largely due to optimization flaws rather than inherent architectural weaknesses. By providing a numerically stable and memory-efficient way to calculate gradients, ACA allows continuous-depth models to finally realize their potential, outperforming discrete counterparts in both accuracy and reliability.

Summary updated

BibTeX
@inproceedings{zhuang2020adaptive,
  author = {Juntang Zhuang and Nicha C. Dvornek and Xiaoxiao Li and Sekhar Tatikonda and Xenophon Papademetris and James S. Duncan},
  title = {{Adaptive Checkpoint Adjoint Method for Gradient Estimation in Neural ODE}},
  booktitle = {International Conference on Machine Learning},
  year = {2020},
}
Figure