arXiv:2608.23297cs.MSAug 2026

Manuscript Offprint

arXiv:2608.23297

ADDA: a Modular Framework for Representing, Simulating and Assimilating Dynamics with End-to-end Differentiability

Anthony Frion, Vien Minh Nguyen-Thanh, Ali Can Bekar, Pauleo R. Nimtz, Vadim Zinchenko, David S. Greenberg

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

A PREPRINT

Anthony Frion ∗^{*}

anthony.frion@hereon.de

Pauleo R. Nimtz

pauleo.nimtz@hereon.de

Vien Minh Nguyen-Thanh

thanh.nguyen@hereon.de

Vadim Zinchenko

vadim.zinchenko@hereon.de

Ali Can Bekar

ali.bekar@hereon.de

David S. Greenberg

david.greenberg@hereon.de

Model-Driven Machine Learning

Institute of Coastal Systems - Analysis and Modeling

Helmholtz-Zentrum Hereon

Germany

ABSTRACT

Data assimilation (DA) is an essential tool for prediction and understanding in the geosciences. DA combines simulation programs representing scientific knowledge with observations that constrain system dynamics, resulting in analyses and forecasts that incorporate both knowledge and data. DA tasks can be addressed with a diverse toolset, including variational, ensemble and learning-based methods. In particular, many recent works have proposed using automatic differentiation tools for variational, learning-based or hybrid methods. However, comprehensive comparisons across algorithms and dynamical systems remain challenging, due to the incompatibility of simulation and assimilation codes, inflexible handling of spatial and temporal discretizations, specialization of DA methods to specific simulations, and limited support for automatic differentiation and parallel computation in simulations. To address this challenge, we introduce Automatic Differentiation for Data Assimilation (ADDA), a software framework for defining and working with system states, simulations, observation schemes and DA methods. ADDA provides a powerful and flexible set of base classes for representing dynamical systems and observation operators, with support for collocated and staggered grids, unstructured meshes, Lagrangian state variables and irregular or continuous-time observations. ADDA implements the Kalman filter and smoother, ensemble Kalman filter and smoother, strong-constraint and weak-constraint 4D-Var with a single or a sliding window. It can be easily extended or modified to support new methods. Parallel processing and differentiability are first-class features, with support for batch axes and automatic differentiation throughout. ADDA is implemented in PyTorch library, but supports DA for JAX-based computation of dynamics and their gradients. To demonstrate its features and facilitate development and evaluation of DA methods, we further provide differentiable, ADDA-compatible implementations of 10 dynamical systems of various dimensionalities and scales, from which we design multiple illustrative DA examples. All of our code is publicly available at https://github.com/m-dml/ADDA.

∗^{*}Corresponding author

A PREPRINT

1 Introduction

Data assimilation (DA) [Carrassi et al., 2018], a critically important endeavor in the geosciences, combines simulation and observation to obtain system state sequences consistent with both. It can be used to estimate system states more accurately than simulation or observation alone [Carrassi et al., 2018, Hersbach et al., 2020], to tune simulation parameters [Aksoy et al., 2006, Bocquet and Sakov, 2013] and to identify key situations or phenomena for which simulation and observations conflict [Carrió et al., 2025]. DA is the focus of much theoretical and empirical research, and its operational practice demands significant financial, computational and energy resources [Balsamo et al., 2023, Drillet et al., 2024].

DA unites a diverse suite of methods with an equally varied array of applications. Major classes of well-established “classical” methods include variational methods such as strong- [Rabier et al., 2000] and weak-constraint 4D-Var [Zupanski, 1997], gradient-free ensemble methods [Evensen, 1994, Evensen and Leeuwen, 2000] and hybrid techniques combining gradients with ensembles [Liu et al., 2008, Sakov et al., 2012]. Kalman filtering provides precise Bayesian inference for linear dynamics with Gaussian uncertainty [Kalman, 1960], while particle filters can assimilate nonlinear dynamics or observations but suffer from a curse of dimensionality that limits their application in the geosciences [Wills and Schön, 2023]. Within these classes of DA methods, individual methods exhibit subtle but consequential differences, and implementations of a single method can vary widely in usability, flexibility, numerical stability and computational efficiency.

Advances in data-driven DA present an important, new and highly diverse class of methods [Cheng et al., 2023]. Fully supervised approaches avoid simulation during training, but generally require simulation or another DA method to produce training data [Hersbach et al., 2020], in the form of full system states. Directly training on sparse and/or noisy observations usually assumes access to a differentiable simulation [Zinchenko and Greenberg, 2024, Wang et al., 2024] or emulator [Xiao et al., 2024a, Li et al., 2024]. 4DVarNets [Fablet et al., 2021] learn a 4D-Var-like loss and pass its gradients to a recurrent DA network, supporting both supervised [Beauchamp et al., 2023, Febvre et al., 2024, Fablet et al., 2024] and unsupervised training [Dorffer et al., 2025]. Other approaches train a fast neural emulator on simulations that are too slow or lack gradient routines, enabling classical variational DA [Nonnenmacher and Greenberg, 2021, Hatfield et al., 2021, Maulik et al., 2022, Seabra et al., 2024, Xiao et al., 2024a, Li et al., 2024, Durand et al., 2025]. In some cases, emulators trained on coarse-resolution simulations exhibit better consistency with high-resolution simulations than the coarse simulations they were trained on [Koehler and Thuerey, 2026]. However, emulation is unnecessary when simulations are implemented in deep learning frameworks with automatic differentiation (autodiff), since gradient backpropagation is closely related to variational DA [Cheng et al., 2023]. Latent data assimilation (LDA) reduces computation and memory costs by operating in latent spaces to reduce the dimension [Amendola et al., 2020, Peyron et al., 2021, Cheng et al., 2024, Melinc and Zaplotnik, 2024, Cheng et al., 2025], to leverage simplified (e.g. linear) dynamics [Frion et al., 2024, Singh et al., 2024, Frion et al., 2025, Shoji et al., 2025, Tong et al., 2026] or to work with complex non-Gaussian prior distributions [Qu et al., 2024, Xiao et al., 2024b, 2025, Pasmans et al., 2026, Fan et al., 2026]. Diffusion models have been used for probabilistic DA, both by directly mapping observations onto system state posteriors [Huang et al., 2024] and by training a prior on system state sequences [Rozet and Louppe, 2023] before conditioning with Tweedie's formula [Efron, 2011]. Diffusion models and related approaches can incorporate latent representations [Qu et al., 2024], exploit novel training strategies [Shysheya et al., 2024, Chen et al., 2025, Sun et al., 2025], learn from observations [Rozet et al., 2024] and scale to global atmospheric states [Andry et al., 2025]. Overall, data-driven DA methods are nearly always faster than classical DA, and can be used to initialize iterative classical methods [Frerix et al., 2021, Frion and Greenberg, 2026].

The complex landscape of DA applications is at least as varied as that of its methods. These include the familiar cases of atmospheric [Navon, 2009, Gustafsson et al., 2018, Hersbach et al., 2020, Xu et al., 2025] and ocean dynamics [Stammer et al., 2016, Drillet et al., 2024, Grande et al., 2026], as well as hydrology [Sun et al., 2016], ecosystems [Niu et al., 2014], biogeochemistry [Dowd et al., 2014, Rayner et al., 2019], agriculture [Jin et al., 2018, Pandya et al., 2022], pose estimation [Aharon et al., 2025], economics [Nadler et al., 2019], water quality modeling [Cho et al., 2020], forest inventory [Xu et al., 2023], land surface modeling [Raoult et al., 2025] and agent-based modeling [Ghorbani et al., 2023]. The simulation models underlying these diverse tasks rely on diverse programming languages, compilers, computing hardware, discretization schemes and data formats. Software packages for some simulations include their own assimilation routines [Brajard et al., 2021, Xiao et al., 2024b, Xu et al., 2025], but these are often highly specialized and cannot be applied to other cases.

This complexity and diversity limit compatibility. Researchers developing a new DA method must contend with the difficulty of integrating it with diverse simulation codebases, system representations and observation types. Likewise, comparing assimilation methods on a new (or newly modified) simulation requires adapting the simulation to provide inputs with the format and structure required by each algorithm, and translating observation operators to an accepted format. When simulations support parallel or gradient computation, extending these capabilities to DA methods is

A PREPRINT

nontrivial. The laborious nature of matching DA methods to simulations in each case costs precious research time, limits the feasibility of careful evaluations and increases the risk of implementation errors. Thus, at present it is a significant challenge to evaluate a new DA method, compare DA methods across assimilation tasks, or select the optimal method for each task.

Here we introduce ADDA, a modular framework for representing and simulating dynamical systems, for implementing observation operators, and for building, applying and evaluating data assimilation methods. We built ADDA to satisfy the following set of core requirements:

• End-to-end autodiff support for variational DA methods.

• Support for diverse system state structures, including regular and unstructured grids and meshes, variable staggering, and mixed dimensionality (e.g. surface vs. atmospheric fields for Earth models).

• Observation operators describing the dependence of observations on system states, supporting spatiotemporally structured and unstructured observations, masking and noise.

• Support for flexible classes of dynamics, including time-varying boundary conditions and forcing data and numerical simulators as well as neural emulators.

• Modularity allowing simulation models, observation operators and DA methods to be individually defined, modified and extended before being combined to carry out DA tasks.

• Parallelized batched computation on CPUs and GPUs.

• Concrete, easily-modified examples demonstrating major functionalities.

We implemented ADDA as a set of algorithms, functions and classes in Python and PyTorch. ADDA satisfies our stated core requirements and provides a clearly defined interface through which simulations and DA algorithms can interoperate.

ADDA is inspired by existing efforts to unify DA models, observation operators and simulations in a common framework. DART [Anderson et al., 2009] includes many types of dynamics and observation types, but focuses on ensemble-based DA and lacks variational methods. Its Fortran implementation aids efficiency but increases the complexity of its workflows and of interfacing with new simulations. PDAF [Nerger, 2023] applies ensemble Kalman methods to large scale dynamical systems with emphasis on parallelization, but does not support 4D-Var. NEDAS [Ying, 2025] is an ensemble DA system in Python with CPU parallelization, designed to efficiently scale to large geophysical applications. However, it lacks automatic differentiation, and its required workflows are complex and incompletely documented. PyDA [Ahmed et al., 2020] provides a simple data assimilation tutorial in Python, but also lacks support for automatic differentiation, so its variational DA requires explicit derivation and implementation of cost function gradients, which can become cumbersome for more complex systems. DAPPER [Raanes et al., 2024] is a Python package implementing a variety of variational, ensemble and other methods, with many examples reproducing published studies. It presents a major achievement in unifying DA methods and applications, but with significant limitations: it is not designed for large systems (>60000 DOF), uses inefficient user-specified forward adjoints instead of autodiff backpropagation, provides only limited CPU parallelization and imposes restrictions on the spatial discretization, time stepping and observation scheme. TorchDA [Cheng et al., 2025] supports autodiff in data assimilation, but only for a limited set of methods and examples focused on DA with neural emulators of dynamical systems. Each of these frameworks serves an important community need, but none fulfill the above aims. Generally speaking, one can note that variational methods have historically been considered to be complex to implement due to the necessity of building an adjoint model for the dynamical system of interest, leading to a preference for ensemble Kalman methods in general-purpose data assimilation software. The recent development of automatic differentiation tools has now considerably simplified the usage of 4D-Var, but this change is not yet reflected in major DA packages. Our work aims to fill this gap. As multiple modern frameworks exist for automatic differentiation, ADDA is implemented in PyTorch, the most popular for deep learning. To support a wide and flexible usage, we provide support for solving DA on systems implemented in JAX, which is another major automatic differentiation framework. An associated experiment is presented in Sect. 4.8.

We emphasize that ADDA is not a benchmark or benchmarking tool, and this manuscript does not describe a benchmarking study. Arriving at a fair and comprehensive benchmark will require a concerted community effort to ensure that all relevant DA methods are adequately implemented and properly tuned, that a fair and representative range of DA tasks has been selected, and that reasonable metrics have been used to measure accuracy and efficiency. Rather, we designed and developed ADDA to provide a necessary foundation for implementing DA methods and interfacing them with simulations, keeping in mind the goal of enabling future benchmarking efforts. Our set of examples in Sect. 4 has been designed to showcase the versatility of ADDA.

We describe and demonstrate ADDA as follows. We first frame the DA task and establish notation in Sect. 2. In Sect. 3, we describe essential DA concepts and components and their realizations in ADDA, and the implementation of

A PREPRINT

DA algorithms. Section 4 then illustrates ADDA’s capabilities on DA examples ranging across dynamical systems, observation operators and algorithms. Sections 5 and 6 conclude with a summary of ADDA’s capabilities and the outlook for future developments and applications.

References (100)

Couldn't load all references. Reload the page to try again.