Skip to main content
QUICK REVIEW

[Paper Review] A Comparison of Automatic Differentiation and Continuous Sensitivity Analysis for Derivatives of Differential Equation Solutions

Yingbo Ma, Vaibhav Dixit|arXiv (Cornell University)|Dec 5, 2018
Model Reduction and Neural NetworksPhysics and Astronomy18 citations
TL;DR

This paper compares automatic differentiation (AD) and continuous adjoint sensitivity analysis (CASA) for computing derivatives of differential equation solutions. It finds that forward-mode DSAAD is more efficient than CASA for small systems (<100 parameters/ODEs), while CASA scales better for larger problems, with performance heavily dependent on the AD method used for vector-Jacobian products.

ABSTRACT

Derivatives of differential equation solutions are commonly for parameter estimation, fitting neural differential equations, and as model diagnostics. However, with a litany of choices and a Cartesian product of potential methods, it can be difficult for practitioners to understand which method is likely to be the most effective on their particular application. In this manuscript we investigate the performance characteristics of Discrete Local Sensitivity Analysis implemented via Automatic Differentiation (DSAAD) against continuous adjoint sensitivity analysis. Non-stiff and stiff biological and pharmacometric models, including a PDE discretization, are used to quantify the performance of sensitivity analysis methods. Our benchmarks show that on small systems of ODEs (approximately $&lt;100$ parameters+ODEs), forward-mode DSAAD is more efficient than both reverse-mode and continuous forward/adjoint sensitivity analysis. The scalability of continuous adjoint methods is shown to be more efficient than discrete adjoints and forward methods after crossing this size range. These comparative studies demonstrate a trade-off between memory usage and performance in the continuous adjoint methods that should be considered when choosing the technique, while numerically unstable backsolve techniques from the machine learning literature are demonstrated as unsuitable for most scientific models. The performance of adjoint methods is shown to be heavily tied to the reverse-mode AD method, with tape-based AD methods shown to be 2 orders of magnitude slower on nonlinear partial differential equations than static AD techniques. These results also demonstrate the applicability of DSAAD to differential-algebraic equations, delay differential equations, and hybrid differential equation systems, showcasing an ease of implementation advantage for DSAAD approaches.

Motivation & Objective

  • To evaluate and compare the performance of discrete sensitivity analysis via automatic differentiation (DSAAD) and continuous adjoint sensitivity analysis (CASA) for differential equation solutions.
  • To identify the most efficient method for parameter estimation, neural ODE training, and model diagnostics across a range of ODE and PDE systems.
  • To assess the impact of AD implementation choices—particularly tape-based vs. static AD—on computational performance in sensitivity analysis.
  • To evaluate the applicability and efficiency of DSAAD for complex systems such as DAEs, DDEs, and hybrid systems with parameter-dependent events.
  • To guide practitioners in selecting optimal sensitivity analysis techniques based on system size, stiffness, and memory constraints.

Proposed method

  • Employs forward-mode DSAAD by extending the ODE system with sensitivity equations: ∂u/∂p_i = (∂f/∂u)(∂u/∂p_i) + ∂f/∂p_i.
  • Uses Jacobian-free approximation via forward-mode AD with dual numbers to compute directional derivatives without explicit Jacobian formation.
  • Applies reverse-mode AD for vector-Jacobian products in CASA, comparing tape-based and static AD techniques.
  • Implements multiple CASA variants: quadrature-based (fastest but high memory), backsolve (memory-efficient but unstable), and checkpointing (balanced trade-off).
  • Benchmarks performance on non-stiff and stiff ODEs, PDEs, and DAEs/DDEs using the Julia-based DifferentialEquations.jl and DiffEqSensitivity.jl libraries.
  • Evaluates memory scaling and runtime across methods, including the impact of interpolant storage and checkpointing strategies.

Experimental results

Research questions

  • RQ1How does forward-mode DSAAD compare in performance to continuous adjoint sensitivity analysis (CASA) for small systems (<100 parameters/ODEs)?
  • RQ2What is the performance trade-off between memory usage and computational speed in different CASA implementations (quadrature, backsolve, checkpointing)?
  • RQ3How does the choice of reverse-mode AD method (tape-based vs. static AD) affect the performance of CASA on nonlinear PDEs?
  • RQ4To what extent is DSAAD applicable and efficient for complex systems such as DAEs, DDEs, and hybrid systems with parameter-dependent events?
  • RQ5Why are backsolve-based CASA methods unsuitable for most scientific models, and in which cases might they still be viable?

Key findings

  • For small systems (<100 parameters/ODEs), forward-mode DSAAD is more efficient than both reverse-mode AD and continuous adjoint methods.
  • On nonlinear PDEs, tape-based reverse-mode AD is approximately 100x slower than static AD techniques due to overhead in gradient computation.
  • The quadrature-based CASA method is the fastest for stiff ODEs but requires high memory (26NM for 9th-order Runge-Kutta with M time points).
  • Checkpointing-based CASA reduces memory usage to NC (C checkpoints) at the cost of up to 2x increased runtime, with a ~5x performance deficit compared to quadrature CASA.
  • Backsolve-based CASA is numerically unstable for most scientific models and is only viable for non-stiff systems.
  • DSAAD demonstrates strong out-of-the-box applicability to DAEs, DDEs, and hybrid systems with parameter-dependent events, requiring minimal code changes.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.