Abstract
Likelihood-free methods are often required for inference in systems biology. While Approximate Bayesian Computation (ABC) provides a theoretical solution, its practical application has often been challenging due to high computational demands. To scale likelihood-free inference to computationally demanding stochastic models, we developed pyABC: a distributed and scalable ABC-Sequential Monte Carlo (ABC-SMC) framework. It implements computation-minimizing and scalable, runtime-minimizing parallelization strategies for multi-core and distributed environments scaling to thousands of cores. The framework is accessible to non-expert users and enables advanced users to experiment with and custom implement ABC-SMC schemes without altering the source code. pyABC includes a web interface to visualize ongoing and finished ABC-SMC runs and exposes an API for data querying and post-processing.
Introduction
In fields like systems biology, researchers often build "black-box" models—stochastic simulations of intracellular processes or multi-scale tissue models. While these models are great at mimicking reality, they are a nightmare for statistical inference. Because a traditional likelihood function cannot be derived for these models, standard tools for parameter estimation are inapplicable.
Approximate Bayesian Computation (ABC) offers a solution by relying on millions of simulations and comparing their outputs to real data. However, the high computational cost of ABC has historically limited its practical application. Existing tools often lack the scalability or customization required for modern, high-fidelity models. pyABC was developed to bridge this gap, providing a high-performance Python framework for distributed, large-scale application.
Methods: ABC-SMC and Parallelization Strategies
The core of pyABC is the ABC-Sequential Monte Carlo (ABC-SMC) algorithm. This approach runs sequences of "populations" that gradually refine parameter estimates. A key contribution of pyABC is its implementation of two distinct parallelization strategies to handle the "long tail" of simulation runtimes often found in complex stochastic models.
- Static Scheduling (STAT): This traditional approach assigns one task per particle. While it minimizes the total number of simulations (maximizing computational efficiency), it often leads to significant idle time on large clusters if the number of available cores exceeds the population size.
- Dynamic Scheduling (DYN): This strategy keeps all available cores busy simulating until the required number of particles is accepted. To prevent statistical bias toward "fast" parameters,
pyABCtracks simulation start times and discards surplus accepted particles in a way that preserves statistical integrity.
The framework is highly modular, supporting backends such as Dask, IPython parallel, and Redis. It also allows for custom distance functions and transition kernels, making it adaptable to diverse research needs.
Key Results
Benchmarks using exponentially distributed simulation times demonstrate the framework's massive scalability and performance gains:
- Massive Scalability:
pyABCsuccessfully scales to thousands of cores, a significant jump over previous Python-based ABC tools. - Runtime Gains: In tests with 2,000 cores, the Dynamic Scheduling strategy achieved a relative runtime nearly 60 times faster than Static Scheduling for certain simulation distributions.
- Computational Efficiency: While Dynamic Scheduling reduces wall-clock time, it can increase total computation. However,
pyABCmitigates this through "early stopping," where simulations are terminated as soon as their distance from observed data exceeds the current threshold.
Discussion and Future Work
pyABC provides a powerful solution for parameter estimation in computationally expensive stochastic models. By offering a choice between throughput-optimized (STAT) and runtime-optimized (DYN) scheduling, it allows researchers to tailor the inference process to their specific hardware constraints and time requirements. The framework also includes a web-based UI to visualize posterior distributions and acceptance thresholds in real-time, making high-performance computing more accessible to biologists.
While currently optimized for distributed CPU environments, future developments may look toward deeper integration with GPU-accelerated models. The framework is particularly well-suited for the emerging field of multi-scale modeling, where the computational demands necessitate the distributed, dynamically scheduled approach provided by pyABC.
Summary updated