Benchpress: a scalable and platform-independent workflow for benchmarking structure learning algorithms for graphical models

Felix L. Rios, Giusi Moffa, Jack Kuipers

Abstract

Structure learning for probabilistic graphical models (PGMs) is a critical task across diverse scientific domains, yet the field suffers from a lack of standardized benchmarking practices. We introduce Benchpress, a novel workflow management system built on Snakemake that addresses the reproducibility crisis in PGM research. By employing containerization and a modular JSON-based configuration, Benchpress enables scalable, platform-independent comparisons of structure learning algorithms across different programming languages and environments.

Introduction

Probabilistic graphical models are essential tools for mapping complex dependencies in high-dimensional data. However, the task of learning the structure of these models is computationally intensive and often NP-hard. Despite the proliferation of new algorithms, comparing their performance remains a significant challenge. Researchers frequently encounter "dependency hell" when trying to run algorithms written in different languages (e.g., R, Python, Java) or using incompatible software versions. Furthermore, inconsistent data formats and evaluation metrics lead to bespoke, non-reproducible benchmarking scripts. Benchpress aims to solve these issues by providing a unified, automated framework for large-scale algorithm evaluation.

The Benchpress Framework

Benchpress is designed with modularity and scalability as core principles. It leverages the Snakemake workflow engine to manage the execution of complex pipelines.

Modular Architecture

The workflow is decomposed into several distinct stages: graph generation, parameter sampling, data simulation, algorithm execution, and evaluation. This separation allows for efficient caching; intermediate results, such as simulated datasets, are stored and reused across different algorithm runs or evaluation modules.

Schematic overview of the Benchpress workflow architecture, illustrating the modular separation of data generation, algorithm execution, and evaluation.

Containerization and Language Agnosticism

To ensure platform independence and reproducibility, Benchpress utilizes Docker and Apptainer containers. Every algorithm module is encapsulated within its own containerized environment, allowing R-based legacy code to run seamlessly alongside modern Python deep learning frameworks. Currently, the system supports 54 algorithm modules from prominent libraries such as bnlearn, pcalg, and causal-learn.

Configuration and Scalability

Users define their experimental setup—including data generation parameters, algorithm choices, and evaluation metrics—in a single JSON configuration file. This "probabilistic programming" style of configuration separates the experimental design from the execution logic. Because it is built on Snakemake, Benchpress can scale from a single laptop to high-performance computing (HPC) clusters or cloud environments without modification.

Data and Evaluation

Benchpress provides a comprehensive suite for data generation and performance assessment:

  • Data Sources: Supports synthetic data generation (e.g., Erdős-Rényi, Christmas tree graphs), standard benchmark datasets (e.g., Sachs, HEPAR II), and user-provided CSV files.
  • Standardized Metrics: Automatically computes a wide range of metrics, including Structural Hamming Distance (SHD), ROC curves, F1 scores, and MCMC trajectory analysis for Bayesian methods.

Experimental Validation

The utility of Benchpress was demonstrated through several case studies. In a comparison between the classic PC algorithm and the Dual PC algorithm on Gaussian data, Benchpress facilitated a clear visualization of Dual PC's superior performance at specific significance levels. In a larger-scale simulation involving 11 algorithms on a 20-node model, the entire benchmark was completed in approximately 40 minutes on a standard laptop. The results highlighted the high performance of permutation-based algorithms like BOSS and GRaSP in specific settings, demonstrating the framework's ability to provide nuanced insights into algorithm behavior.

Conclusion

Benchpress addresses a critical need in the graphical modeling community for a reproducible and scalable benchmarking tool. By bridging the gap between different programming ecosystems and automating the evaluation pipeline, it allows researchers to focus on algorithm development rather than infrastructure management. Future work will involve extending the framework to more general statistical estimation procedures and expanding the library of community-contributed modules.

Summary updated

Abstract

Describing the relationship between the variables in a study domain and modelling the data generating mechanism is a fundamental problem in many empirical sciences. Probabilistic graphical models are one common approach to tackle the problem. Learning the graphical structure for such models is computationally challenging and a fervent area of current research with a plethora of algorithms being developed. To facilitate the benchmarking of different methods, we present a novel Snakemake workflow, called Benchpress for producing scalable, reproducible, and platform-independent benchmarks of structure learning algorithms for probabilistic graphical models. Benchpress is interfaced via a simple JSON-file, which makes it accessible for all users, while the code is designed in a fully modular fashion to enable researchers to contribute additional methodologies. Benchpress currently provides an interface to a large number of state-of-the-art algorithms from libraries such as BDgraph, BiDAG, bnlearn, gCastle, GOBNILP, pcalg, r.blip, scikit-learn, TETRAD, and trilearn as well as a variety of methods for data generating models and performance evaluation. Alongside user-defined models and randomly generated datasets, the workflow also includes a number of standard datasets and graphical models from the literature, which may be included in a benchmarking study. We demonstrate the applicability of this workflow for learning Bayesian networks in five typical data scenarios. The source code and documentation is publicly available from http://github.com/felixleopoldo/benchpress.
BibTeX
@misc{rios2021benchpress,
  author = {Felix L. Rios and Giusi Moffa and Jack Kuipers},
  title = {{Benchpress: a scalable and platform-independent workflow for benchmarking structure learning algorithms for graphical models}},
  year = {2021},
  eprint = {2107.03863},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2107.03863},
}
Figure