Abstract
Learning the structure of Bayesian Networks (Directed Acyclic Graphs or DAGs) from data is a computationally intensive task due to the super-exponential growth of the search space. We present Gibby, a highly optimized MCMC sampler that addresses the bottlenecks of traditional methods through two primary innovations: a "tentative acceptance" strategy using geometric skipping to bypass rejected simulation steps, and a novel "score pruning" technique to discard insignificant parent sets. Our empirical results demonstrate speedups of one to three orders of magnitude over state-of-the-art methods, making the sampling of networks with hundreds of variables computationally feasible.
Introduction
Learning Bayesian Network structures is fundamental for probabilistic machine learning and causal inference. However, as the number of variables ($n$) increases, exact algorithms become impractical. Approximate methods like Markov Chain Monte Carlo (MCMC) are typically used, but standard approaches like the GC (Giudici and Castelo) algorithm suffer from high rejection rates and computational bottlenecks when summing local scores over massive parent sets.
Methodology
Gibby: Optimized MCMC Moves
Gibby replaces the traditional "propose-then-check" approach with a rejection sampling architecture that ensures every acyclic proposal is accepted. The algorithm utilizes Geometric Skipping: by establishing an upper bound on acceptance probability, Gibby draws from a geometric random variable to determine how many steps the chain remains in its current state, effectively jumping over rejected iterations. To maintain efficiency, it uses a sum-tree data structure for $O(\log n)$ node pair selection and simple path-finding (DFS/BFS) for acyclicity checks, which scales better than matrix-based methods in high-efficiency regimes.
Score Pruning
To accelerate complex moves involving parent set resampling, we introduce a pruning rule that discards parent sets with local scores significantly lower than the weighted sum of their subsets' scores. This approach is "$\epsilon$-close," ensuring the approximate posterior remains within a controlled relative error of the true posterior.
As shown in Table 2, this pruning is remarkably effective; in the ANDES network, for instance, less than 0.2% of parent sets need to be retained to maintain accuracy, representing a massive reduction in computational overhead.
Empirical Evaluation
Computational Speedup
We evaluated Gibby against several benchmark networks ranging from small (ALARM, $n=37$) to large (PIGS, $n=441$). Gibby consistently outperformed the standard GC algorithm by factors of 10x to 200x.
In the PIGS network, Gibby achieved over 500 steps per microsecond, compared to just 3.1 steps for the GC algorithm (Table 1). This efficiency is largely due to the combination of geometric skipping and the low overhead of path-finding updates in large, sparse networks.
Convergence and Accuracy
Beyond raw speed, Gibby demonstrates superior mixing compared to modern samplers like BiDAG and DAG-GFlowNet. While other samplers often struggle with local modes in large networks, Gibby's independent runs converge to consistent high-scoring regions. Estimated arc posterior probabilities converge to exact values at the expected Monte Carlo rate of $O(1/\sqrt{t})$.
Discussion and Future Work
While currently focused on discrete data, the theoretical foundations of Gibby and score pruning are applicable to continuous data (e.g., BGe scores). Future work will explore these contexts and investigate the integration of these fast moves into partition MCMC frameworks to further enhance robustness on complex posterior landscapes. The implementation is available as an open-source tool for the research community.
Summary updated