4D‐Var Using Hessian Approximation and Backpropagation Applied to Automatically Differentiable Numerical and Machine Learning Models

Kylen Solvik, Stephen G. Penny, Stephan Hoyer

Introduction

Numerical Weather Prediction (NWP) relies on Data Assimilation (DA) to synthesize past forecasts with sparse, noisy observations to create an optimal "analysis" of the current atmosphere. The gold standard for this process is 4D-Variational (4D-Var) data assimilation. However, traditional 4D-Var faces a significant "barrier to entry": it requires the manual derivation and coding of Tangent Linear Models (TLM) and Adjoint Models. This process is notoriously difficult, error-prone, and hard to maintain as physical models evolve.

This paper introduces "Backprop-4DVar," a modern evolution of the technique that leverages automatic differentiation (autodiff) and Hessian approximations. By reimagining DA through the lens of machine learning optimization, the authors provide a framework that is easier to implement, faster to run, and natively compatible with the next generation of AI-based weather models.

Methodology: The Backprop-4DVar Framework

The proposed method replaces the manual calculus of traditional DA with a unified optimization approach implemented in JAX. The core components include:

1. Automatic Differentiation (AD)

Instead of writing manual adjoint code, the authors implement their models in JAX, which automatically computes the necessary gradients (backpropagation) of the cost function with respect to the initial state. This allows researchers to focus on the physics of the model rather than the mathematical derivation of its adjoint.

2. Hessian Approximation

Optimization in high-dimensional spaces typically requires the Hessian (the matrix of second-order derivatives) to ensure fast convergence. Because computing a full Hessian is computationally prohibitive for large-scale atmospheric systems, the authors utilize a Gauss-Newton approximation. This provides a low-cost version of the Hessian that significantly accelerates the optimization process compared to simple gradient descent.

3. Surrogate and ML Integration

One of the primary strengths of Backprop-4DVar is its software agnosticism. The authors demonstrate that for cases where the original physical model is non-differentiable or too slow, a Reservoir Computing (RC) model can be trained as a differentiable surrogate. This allows "black-box" machine learning models to be effectively constrained by physical observations within the DA framework.

Experimental Setup

The researchers evaluated Backprop-4DVar against traditional incremental 4D-Var using three chaotic dynamical systems of increasing complexity:

  • Lorenz-96: A standard 1D testbed for DA, scaled from 36 to 256 dimensions.
  • PyQG (Quasi-Geostrophic): A 2D fluid dynamics model simulating atmospheric layers, scaled up to 8,192 dimensions.
  • qgs package: Used to generate training data for the Reservoir Computing surrogate models.

Key Results and Insights

Linear Scaling and Speed

Traditional 4D-Var computation time often scales quadratically with system size due to explicit matrix-vector multiplications. In contrast, Backprop-4DVar scales nearly linearly. On a 2,048-dimensional PyQG system, the new method achieved an order-of-magnitude speedup over the reference 4D-Var implementation. This efficiency makes the approach highly viable for the high-resolution requirements of global weather models.

Accuracy and Robustness

Across various noise levels and observation densities, Backprop-4DVar achieved Root Mean Square Error (RMSE) results nearly identical to conventional incremental 4D-Var. In certain sparse-data scenarios, the new method even outperformed traditional approaches, demonstrating its robustness in real-world conditions where observations are limited.

Bridging Meteorology and AI

Because the method relies on autodiff, it treats the forecast model as a standard loss function to be minimized. This bridges the gap between classical meteorology and modern AI, allowing the same optimization tools used to train neural networks to be used for atmospheric state estimation.

Limitations and Future Directions

While promising, the authors identify several areas for further development:

  • Hyperparameter Tuning: The performance of the optimizer is sensitive to the learning rate and its decay schedule, currently requiring offline tuning via Bayesian optimization.
  • Memory Constraints: Reverse-mode AD requires storing intermediate states during the forward pass. While the authors managed this by limiting optimization depth, extremely long assimilation windows may require advanced memory management on current hardware.
  • Hardware Acceleration: While this study was conducted on CPUs, the JAX implementation is natively compatible with GPUs and TPUs, suggesting that even greater performance gains are possible on specialized hardware.

Conclusion

Backprop-4DVar represents a significant step toward making high-performance data assimilation more accessible and scalable. By replacing manual adjoints with automatic differentiation and utilizing Hessian approximations for speed, the framework provides a powerful tool for integrating numerical physics with machine learning in the next generation of weather forecasting systems.

Summary updated

BibTeX
@misc{solvik2024dvar,
  author = {Kylen Solvik and Stephen G. Penny and Stephan Hoyer},
  title = {{4D‐Var Using Hessian Approximation and Backpropagation Applied to Automatically Differentiable Numerical and Machine Learning Models}},
  year = {2024},
  eprint = {2408.02767},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2408.02767},
}
Figure