Efficient and Scalable Structure Learning for Bayesian Networks: Algorithms and Applications

Rong Zhu, Andreas Pfadler, Ziniu Wu, Yuxing Han, Xiaoke Yang, Feng Ye, Zhenping Qian, Jingren Zhou, Bin Cui

TL;DR

This paper introduces LEAST, a novel algorithm for learning the structure of Bayesian Networks (BNs) that is significantly more efficient and scalable than existing methods. By reformulating the acyclicity constraint using a differentiable spectral radius-based measure, LEAST can handle BNs with hundreds of thousands of variables, making BN structure learning practical for large-scale real-world applications.

What Problem Does This Paper Address?

Bayesian Networks (BNs) are powerful tools for modeling causal relationships, with applications ranging from biology to anomaly detection in complex systems. However, learning the structure of these networks from data is computationally challenging. Existing methods, particularly those that rely on continuous optimization, struggle with efficiency and scalability, limiting their use to BNs with at most a few thousand nodes. This is a major bottleneck for large organizations like Alibaba, where BNs could offer immense value in areas like production monitoring and recommendation systems, which often involve tens of thousands to millions of variables. The paper aims to bridge this gap by developing a BN structure learning algorithm that is accurate, efficient, and scalable enough for these real-world, large-scale scenarios.

Methods

The core innovation of LEAST lies in its novel approach to enforcing the acyclicity constraint, a crucial requirement for BNs. Instead of relying on computationally expensive matrix exponentials or multiplications used in prior work (like NOTEARS), LEAST leverages an upper bound on the spectral radius of a graph-related matrix. This spectral radius-based measure is:

  • Differentiable: Allowing for the use of efficient gradient-based optimization methods.
  • Time and Space Efficient: Computable in near-linear time with respect to the number of nodes, and with low memory overhead, making it suitable for large graphs.

The algorithm formulates the structure learning problem as a continuous constrained optimization problem. It uses an iterative process to compute the acyclicity constraint and its gradient, employing techniques like batching and thresholding to further enhance efficiency and maintain sparsity. The paper also details the implementation of LEAST using both dense (TensorFlow) and sparse (SciPy) matrix representations, catering to different application needs.

Datasets

The paper evaluates LEAST on:

  • Artificial Datasets: Generated using the Erdös-Rényi (ER) and scale-free (SF) graph models with varying noise types (Gaussian, Exponential, Gumbel). These datasets are used to compare LEAST with NOTEARS in terms of accuracy and efficiency.
  • Real-World Datasets:
    • Movielens: A large-scale recommendation dataset.
  • App-Security and App-Recom: Internal datasets from Alibaba for cloud security and recommendation systems, respectively.
  • Gene Expression Datasets: Sachs, E. Coli, and Yeast datasets, which are standard benchmarks for BN structure learning in bioinformatics.

Key Insights and Ideas

  • Spectral Radius as an Acyclicity Proxy: The paper demonstrates that an upper bound on the spectral radius of a graph-related matrix can serve as an effective and computationally efficient proxy for graph acyclicity. This is a significant departure from previous methods that relied on more complex matrix operations.
  • Scalability Breakthrough: By making the acyclicity constraint computationally tractable for large graphs, LEAST unlocks the potential of BN structure learning for applications with hundreds of thousands of variables, a scale previously unattainable.
  • Practical Deployment: The successful deployment of LEAST in Alibaba's production environment for over 20 applications highlights its real-world applicability and robustness.
  • Implicit Regularization: The authors suggest that the iterative computation of the spectral radius measure might introduce a form of implicit regularization, potentially leading to higher accuracy in certain scenarios (like gene expression data analysis).

Key Results

  • Accuracy: LEAST achieves comparable accuracy to state-of-the-art methods like NOTEARS on artificial and gene expression datasets. In some cases, LEAST even shows slightly better performance (e.g., detecting more true positive edges on E. Coli and Yeast datasets).
  • Efficiency: LEAST is 1-2 orders of magnitude faster than NOTEARS, especially for larger graphs. This speedup is attributed to the near-linear time complexity of its acyclicity constraint computation compared to the cubic complexity of NOTEARS.
  • Scalability: LEAST successfully scales to BNs with up to hundreds of thousands of variables on real-world datasets, a feat not achieved by existing continuous optimization methods. For instance, it processed the Movielens dataset (91,850 nodes) in approximately 89 hours.
  • Real-World Impact: In a ticket booking anomaly detection system, LEAST reduced analysis time from hours to minutes, improving the first-attempt success booking rate.

Limitations and Future Work

  • Variance: The paper notes that LEAST can exhibit higher variance compared to NOTEARS, particularly on dense graphs or for larger numbers of nodes. This is attributed to potential numerical instabilities in the iterative computation of the spectral radius measure.
  • Future Work: The authors plan to explore implementing LEAST in a distributed environment to handle even larger-scale applications and to further investigate its potential in various domains. They also aim to release an open-source implementation.

Summary updated

BibTeX
@inproceedings{zhu2021efficient,
  author = {Rong Zhu and Andreas Pfadler and Ziniu Wu and Yuxing Han and Xiaoke Yang and Feng Ye and Zhenping Qian and Jingren Zhou and Bin Cui},
  title = {{Efficient and Scalable Structure Learning for Bayesian Networks: Algorithms and Applications}},
  booktitle = {ICDE},
  year = {2021},
  doi = {10.1109/icde51399.2021.00292},
}
Figure