NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Differentiable programming for Earth system modeling

Maximilian Gelbrecht, Alistair White, Sebastian Bathiany, Niklas Boers

Abstract

Earth system models (ESMs) are the primary tools for investigating future Earth system states at timescales from decades to centuries, especially in response to anthropogenic greenhouse gas release. State-of-the-art ESMs can reproduce the observational global mean temperature anomalies of the last 150 years. Nevertheless, ESMs need further improvements, most importantly regarding (i) the large spread in their estimates of climate sensitivity, i.e., the temperature response to increases in atmospheric greenhouse gases; (ii) the modeled spatial patterns of key variables such as temperature and precipitation; (iii) their representation of extreme weather events; and (iv) their representation of multistable Earth system components and the ability to predict associated abrupt transitions. Here, we argue that making ESMs automatically differentiable has a huge potential to advance ESMs, especially with respect to these key shortcomings. First, automatic differentiability would allow objective calibration of ESMs, i.e., the selection of optimal values with respect to a cost function for a large number of free parameters, which are currently tuned mostly manually. Second, recent advances in machine learning (ML) and in the number, accuracy, and resolution of observational data promise to be helpful with at least some of the above aspects because ML may be used to incorporate additional information from observations into ESMs. Automatic differentiability is an essential ingredient in the construction of such hybrid models, combining process-based ESMs with ML components. We document recent work showcasing the potential of automatic differentiation for a new generation of substantially improved, data-informed ESMs.

The Tuning Problem in Climate Science

Earth System Models (ESMs) are essential for predicting climate futures, but they face a significant "tuning" problem. These models, often comprising hundreds of thousands of lines of legacy code, rely on complex physical processes like ocean currents and atmospheric chemistry. Currently, many parameters within these models (such as those governing cloud formation) are adjusted manually through expert trial-and-error. This subjective and computationally expensive process limits the number of parameters that can be optimized, leading to large uncertainties in climate sensitivity and poor representation of extreme weather events.

Methods: Differentiable Programming and Automatic Differentiation

The authors propose adopting Differentiable Programming (DP) as a solution. At its core is Automatic Differentiation (AD), a technique that decomposes a computer program into a chain of elementary operations to compute exact mathematical derivatives (gradients) using the chain rule.

Workflow of a differentiable model using automatic differentiation (AD) to compute gradients and Hessians for various applications.

Key approaches discussed include:

  • Adjoint Modeling: AD allows for the automatic generation of "adjoint" models, which are essential for understanding how sensitive a model's output is to its inputs.
  • Hybrid Modeling: Using DP to build "Universal Differential Equations" where traditional physics-based solvers are combined with Neural Networks. The ML components handle unresolved sub-grid processes while the physical core ensures conservation of mass and energy.
  • Modern Tooling: The paper highlights a new generation of AD tools like JAX (Python) and Zygote/Enzyme (Julia), which offer easier interfacing with ML workflows and GPU acceleration.

Key Insights: From Tuning to Optimization

DP allows for the objective calibration of hundreds of parameters simultaneously by minimizing a cost function. Furthermore, AD doesn't just provide gradients; it can compute the Hessian (second derivatives), which is a goldmine for uncertainty quantification, helping researchers identify which parameters the model is most—and least—certain about.

A critical insight is the necessity of "Online" Training. While ML components can be trained separately ("offline"), this often leads to instabilities and biases when integrated back into the ESM. Training ML components inside the ESM solver loop ("online") ensures they remain stable and accurate across the data distributions encountered during simulation.

Comparison between offline and online training strategies for hybrid Earth System Models (ESMs).

Results and Future Directions

While this is a perspective piece, it cites several breakthrough results:

  • Speedups: Hybrid fluid dynamics models have demonstrated 40-fold to 80-fold computational speedups while remaining stable.
  • Improved Accuracy: Gradient-based tuning scales significantly better with increasing data availability than traditional manual methods.
  • Emulation: ANN-based emulators have successfully replaced traditional sub-grid parameterizations for clouds and ocean eddies.

Transitioning legacy Fortran codebases to differentiable frameworks remains a major engineering hurdle. Additionally, the chaotic nature of climate systems can lead to "exploding" gradients. Despite these challenges, the integration of physics-aware ML through differentiable programming represents the next frontier for data-informed Earth system modeling.

Summary updated

BibTeX
@inproceedings{gelbrecht2023differentiable,
  author = {Maximilian Gelbrecht and Alistair White and Sebastian Bathiany and Niklas Boers},
  title = {{Differentiable programming for Earth system modeling}},
  booktitle = {Geoscientific},
  year = {2023},
  doi = {10.5194/gmd-16-3123-2023},
}
Figure