Efficient Amortised Bayesian Inference for Hierarchical and Nonlinear Dynamical Systems

Geoffrey Roeder, Paul K. Grant, Andrew Phillips, Neil Dalchau, Edward Meeds

Introduction

In fields ranging from synthetic biology to epidemiology, researchers rely on Ordinary Differential Equations (ODEs) to model complex dynamical systems. However, fitting these mechanistic models to real-world data presents significant challenges. Traditional Bayesian inference methods, such as Markov Chain Monte Carlo (MCMC), require solving the ODE at every single step. For large datasets, this computational cost becomes prohibitive.

Furthermore, real-world data is rarely flat; it is often hierarchical. Variability exists at multiple levels—from the broader population down to specific experimental groups (e.g., a bacterial strain) and individual samples (e.g., a specific well in a microplate). Finally, purely mechanistic "white-box" models often fail to capture complex, secondary biological effects, while "black-box" neural networks lack interpretability.

To address these bottlenecks, researchers have developed VI-HDS (Variational Inference for Hierarchical Dynamical Systems). This scalable Bayesian framework leverages Variational Autoencoders (VAEs) and differentiable ODE solvers to perform fast, hierarchical inference on nonlinear dynamical systems, achieving massive speedups while enabling zero-shot predictions for unseen experimental conditions.

Methodology: The VI-HDS Framework

The core innovation of VI-HDS lies in its ability to "amortize" the inference process and handle hierarchical data structures natively.

Architecture of the VI-HDS framework and its hierarchical probabilistic graphical model.

Key technical components of the framework include:

  • Amortized Inference: Instead of optimizing parameters for every individual data point from scratch (as MCMC does), VI-HDS trains an encoder network to map observations directly to a distribution over the latent parameters. Once trained, this "amortization" makes inferring parameters for new data incredibly fast.
  • Multilevel Block-Conditional Encoder: The variational posterior is factorized into three distinct blocks: Population, Group, and Individual. This hierarchical structure allows the model to share "statistical strength" across similar groups while still accurately accounting for individual-level noise and variations.
  • Differentiable ODE Solver: The "decoder" in this architecture is a differentiable ODE solver (utilizing a modified Euler method). Because the solver is fully differentiable, the entire system can be trained end-to-end using standard gradient descent.
  • Hybrid Dynamics: The framework is highly flexible, supporting both "white-box" models (user-defined mechanistic equations) and "black-box" models (where the ODE's right-hand side is parameterized by a neural network). The authors also introduce a "softplus" activation trick to ensure biological plausibility, such as forcing degradation terms to zero as concentrations deplete.

Datasets and Experimental Setup

To validate VI-HDS, the researchers applied it to a complex Synthetic Biology Case Study.

Overview of the synthetic biology case study, showing genetic components, experimental treatments, and time-series observations.
  • The Biological System: The study utilized genetically engineered E. coli designed to act as "double receiver" biosensors. These bacteria respond to two distinct chemical signals ($C_6$ and $C_{12}$) by producing different fluorescent proteins (CFP and YFP).
  • The Data Hierarchy: The dataset comprises 312 time-series measurements. It features a deep hierarchy, including six different genetic "devices" (unique combinations of genetic parts), with multiple replicated treatments and wells for each device.
  • Observations: The model was trained on multi-channel time-series data, tracking Optical Density (OD) to measure bacterial growth alongside fluorescence levels for RFP, YFP, and CFP.

Key Results and Insights

Dramatic Speed Improvements

By utilizing amortized inference and stochastic optimization, VI-HDS scales effortlessly to the massive data pipelines generated by modern robotic "cloud labs." The VI-HDS white-box model took approximately 2 hours to train, while the black-box version took only 40 minutes. In stark contrast, traditional MCMC methods applied to the same problem typically require 24–48 hours—representing a nearly 40x speedup.

The Interpretability vs. Accuracy Trade-off

The "black-box" ODE model consistently outperformed the "white-box" mechanistic model in terms of raw accuracy, achieving a significantly higher Evidence Lower Bound (ELBO) of 1360 nats compared to 1047 nats. This suggests that the neural network was able to "learn" hidden biological factors—such as metabolic burden, where high chemical concentrations slow down cell growth—that were not explicitly programmed into the human-designed mechanistic equations.

Zero-Shot Generalization

Perhaps the most powerful feature of VI-HDS is its predictive capability. Because the hierarchical model learns the specific contributions of individual genetic components (rather than just memorizing the behavior of the whole circuit), it can predict how a brand-new combination of parts will behave. In "held-out device" experiments, the model successfully captured the dynamics of unseen genetic circuits before they were ever built or tested in the lab.

Limitations and Future Directions

While highly effective, the current iteration of VI-HDS relies on a "mean-field" assumption for the variational posterior, which may oversimplify complex correlations between different latent variables. Additionally, the current experiments focused on deterministic ODEs with observation noise.

Future work will aim to extend this framework to Stochastic Differential Equations (SDEs) to better model intrinsic biological noise. Furthermore, the rapid inference capabilities of VI-HDS open the door to "active learning" loops, where the model could autonomously suggest which genetic circuit to build next to maximize scientific discovery.

Summary updated

BibTeX
@inproceedings{roeder2019efficient,
  author = {Geoffrey Roeder and Paul K. Grant and Andrew Phillips and Neil Dalchau and Edward Meeds},
  title = {{Efficient Amortised Bayesian Inference for Hierarchical and Nonlinear Dynamical Systems}},
  booktitle = {International Conference on Machine Learning},
  year = {2019},
  url = {https://openreview.net/forum?id=SJVuG3b_bB},
}
Figure