NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

DiBS: Differentiable Bayesian Structure Learning

Lars Lorch, Jonas Rothfuss, Bernhard Schölkopf, Andreas Krause

Introduction

Discovering causal relationships—represented as Bayesian Networks (BNs)—is a fundamental challenge in science. However, "structure learning" (identifying which variables influence others) is notoriously difficult because the number of possible directed acyclic graphs (DAGs) grows super-exponentially with the number of variables.

While many methods try to find a single "best" graph, Bayesian structure learning aims to find a distribution over possible graphs. This is vital for quantifying epistemic uncertainty, especially when data is scarce. Traditionally, this required "conjugate" models (like linear Gaussians) where the math is tractable, or discrete sampling methods like Markov Chain Monte Carlo (MCMC) that are often slow and struggle to explore the vast space of graphs.

To address the inability of existing methods to handle complex, nonlinear dependencies and joint inference in a scalable way, researchers have introduced DiBS (Differentiable Bayesian Structure Learning). DiBS is a novel framework that transforms the discrete, combinatorial problem of learning Bayesian network structures into a continuous optimization task.

Methodology

DiBS moves the inference task into a continuous latent space, allowing the use of gradient-based optimization tools. The framework is built on several key components:

  1. Latent Graph Representation: Instead of optimizing the discrete adjacency matrix $G$ directly, DiBS represents it using latent embedding matrices $\mathbf{Z}$. The probability of an edge existing between two nodes is determined by the inner product of their embeddings: $p(g_{ij}=1 | \mathbf{Z}) = \sigma(\mathbf{u}_i^\top \mathbf{v}_j)$.
  2. Differentiable Acyclicity: To ensure the learned structures are valid DAGs (containing no cycles), the authors employ a differentiable penalty function $h(G)$ that equals zero if and only if the graph is acyclic. This penalty is baked into the prior distribution of the latent variables.
  3. Joint Inference: The framework models the generative process as $\mathbf{Z} \to G$ and $(G, \Theta) \to \mathbf{x}$, where $\Theta$ represents the parameters of the local conditional distributions.
Generative model of BNs with latent variable Z. This formulation generalizes the standard Bayesian setup.
  1. Stein Variational Gradient Descent (SVGD): To approximate the posterior, DiBS uses SVGD, a particle-based variational inference method. It iteratively evolves a set of "particles" (candidate models) toward the high-probability regions of the posterior using gradients of the log-density.
  2. Annealing: An annealing schedule for the sigmoid temperature and acyclicity penalty is used to gradually push the continuous approximation toward valid, discrete DAGs.

Experiments and Results

The authors evaluated DiBS on both synthetic and real-world benchmarks, including synthetic Linear/Nonlinear BNs (generated using Erdős-Rényi and Scale-free models) and the classic Sachs protein signaling dataset.

DiBS consistently outperformed state-of-the-art baselines like MCMC and bootstrapping methods (BGES, BPC).

  • Structural Accuracy: In joint posterior inference for linear networks, a variant called DiBS+ (which weights the inferred particles by their unnormalized posterior probability) achieved significantly lower Expected Structural Hamming Distance (E-SHD) and higher AUROC compared to baselines.
  • Nonlinear Performance: DiBS excelled in the nonlinear setting, where the relationship between variables is modeled by a neural network—a regime where most traditional methods fail to even run.
  • Real-World Application: On the Sachs dataset, DiBS with nonlinear conditionals achieved the best E-SHD (22.6), successfully finding a structure closest to the biological consensus network.
Comparison of inference methods across multiple metrics (E-SHD, AUROC, neg. MLL, neg. I-MLL) for Erdős-Rényi and Scale-free graphs. DiBS+ performs highly competitively.

Key Insights and Limitations

By treating graph structure as a continuous latent variable, DiBS unlocks the suite of gradient-based optimization tools that have revolutionized deep learning. Crucially, it is agnostic to conditionals: unlike previous methods that required specific mathematical forms to remain tractable, DiBS can handle variables that relate linearly or through deep neural networks, making it highly expressive. Furthermore, DiBS demonstrates that joint inference (learning $G$ and $\Theta$ together) is not only possible but often leads to better structural recovery in complex settings than marginalizing out parameters.

Despite its strengths, the framework has limitations. SVGD scales quadratically with the number of particles, which might limit the number of "hypotheses" the model can maintain simultaneously in very large systems. Additionally, like all structure learning methods using observational data, DiBS is limited by Markov equivalence; it cannot always distinguish between $A \to B$ and $B \to A$ without interventional data. Future work may extend DiBS to handle missing data and incorporate interventional data directly into the differentiable framework to improve causal identifiability.

Summary updated

BibTeX
@inproceedings{lorch2021dibs,
  author = {Lars Lorch and Jonas Rothfuss and Bernhard Schölkopf and Andreas Krause},
  title = {{DiBS: Differentiable Bayesian Structure Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=BpA1IZ1l3gO},
}
Figure