Distribution Learning Meets Graph Structure Sampling

Arnab Bhattacharyya, Sutanu Gayen, Philips George John, Sayantan Sen, N. V. Vinodchandran

Introduction

Bayesian networks (Bayes nets) are powerful probabilistic tools for modeling complex, high-dimensional data. They represent conditional dependencies between variables using a Directed Acyclic Graph (DAG). However, learning the optimal DAG structure and its parameters from raw data is notoriously difficult—often NP-hard.

Historically, efficient learning algorithms have been restricted to very simple structures, like trees (via the classic Chow-Liu algorithm), or to polytrees under strict "realizable" assumptions (meaning the real-world data perfectly matches the model). But real-world data is messy. In practice, we often need to learn models in an agnostic setting, where the goal is to find the best possible fit even if the true distribution doesn't perfectly match our model class. Until now, efficiently and agnostically learning Bayes nets with more complex, loopy structures remained an unsolved problem.

This paper bridges the gap between learning high-dimensional probability distributions and graph sampling algorithms. By framing distribution learning as an online "expert" prediction problem, the authors provide the first computationally efficient algorithms for agnostically learning Bayesian networks with chordal skeletons and bounded indegrees, significantly advancing beyond classic tree-based models.

Methods: Online Learning and Graph Sampling

The authors tackle this challenge using an online learning framework. Imagine an algorithm trying to predict the distribution round by round, taking advice from a massive pool of "experts," where each expert is a specific Bayes net structure (a specific acyclic orientation of edges).

Different acyclic orientations (Bayes net structures) over a fixed skeleton, representing the 'experts' in the online learning framework.

Standard online learning algorithms, like Exponential Weighted Average (EWA) or Randomized Weighted Majority (RWM), update the weights of these experts based on how well they predict the data. The catch? There are exponentially many possible DAGs, so maintaining weights for every single expert would normally take exponential time.

The authors' novel breakthrough is realizing they don't need to evaluate every expert individually. For certain graph families, they can use advanced graph counting and sampling algorithms to efficiently sample the "best" experts directly from the massive pool. For trees, they use the Matrix-Tree theorem. For chordal graphs, they use dynamic programming over clique trees to efficiently sample acyclic orientations without explicitly enumerating them.

Key Insights

  • Online Learning = KL Divergence Minimization: Framing the problem as regret minimization in an online setting naturally leads to minimizing the Kullback-Leibler (KL) divergence, which is the gold standard metric for distribution learning.
  • Sampling Beats Enumeration: The computational bottleneck of having exponentially many candidate graphs can be bypassed. If you can efficiently sample acyclic orientations of a graph proportional to their likelihood weights, you can learn the distribution in polynomial time.
  • Chordal Graphs are the Sweet Spot: Chordal graphs (graphs where every cycle of 4 or more vertices has a shortcut edge) are much more expressive than trees but still possess nice structural properties. These properties allow dynamic programming to efficiently count and sample their acyclic orientations, making them learnable.

Key Results

The paper establishes several new state-of-the-art bounds for learning Bayes net distributions, summarized in the table below:

Summary of sample complexity bounds for learning chordal graphs and trees.
  • Chordal Graphs: The authors provide the first efficient agnostic PAC-learning algorithm for Bayes nets with a known chordal skeleton and bounded indegree $d$. It runs in polynomial time and uses $\widetilde{O}(n^3/\varepsilon^2\delta^2 + nk^{d+1}/\varepsilon)$ samples.
  • Polytrees: They solved an open problem by providing an efficient agnostic learner for polytrees (directed graphs with a tree skeleton) with a known skeleton, matching the sample complexity above.
  • Trees (Unknown Skeleton): They developed a new algorithm for learning standard tree distributions that requires $\widetilde{O}(nk^2/\varepsilon)$ samples. This improves the sample complexity's dependence on the alphabet size $k$ compared to the classic Chow-Liu algorithm, achieving optimal bounds.

Limitations and Future Work

While a significant step forward, the approach has a few notable constraints:

  • Known Skeleton Requirement: For the chordal and polytree algorithms, the underlying undirected graph (the "skeleton") must be known in advance. The algorithm only learns the edge directions and the conditional probabilities.
  • Bounded Indegree: The runtime scales exponentially with the maximum indegree $d$ (the maximum number of parents a node can have). Therefore, $d$ must be a small constant for the algorithm to remain computationally efficient.

Future Directions: The authors suggest extending these techniques to general graphs with bounded treewidth. They also propose searching over Markov equivalence classes (which represent sets of statistically indistinguishable DAGs) rather than specific DAGs, and exploring whether approximate sampling (like Markov Chain Monte Carlo) can unlock learning for even broader classes of graphs.

Summary updated

Abstract

This work establishes a novel link between the problem of PAC-learning high-dimensional graphical models and the task of (efficient) counting and sampling of graph structures, using an online learning framework. The problem of efficiently counting and sampling graphical structures, such as spanning trees and acyclic orientations, has been a vibrant area of research in algorithms. We show that this rich algorithmic foundation can be leveraged to develop new algorithms for learning high-dimensional graphical models. We present the first efficient algorithm for (both realizable and agnostic) learning of Bayes nets with a chordal skeleton. In particular, we present an algorithm that, given integers $k,d > 0$, error parameter $\varepsilon > 0$, an undirected chordal graph $G$ on $n$ vertices, and sample access to a distribution $P^\ast$ on $[k]^n$; (1) returns a Bayes net $\widehat{P}$ with skeleton $G$ and indegree $d$, whose KL-divergence from $P^\ast$ is at most $\varepsilon$ more than the optimal KL-divergence between $P^\ast$ and any Bayes net with skeleton $G$ and indegree $d$, (2) uses $\widetilde{O}(n^3k^{d+1}/\varepsilon^2)$ samples from $P^\ast$ and runs in time $\mathrm{poly}(n,k,\varepsilon^{-1})$ for constant $d$. Prior results in this spirit were for only for trees ($d=1$, tree skeleton) via Chow-Liu, and in the realizable setting for polytrees (arbitrary $d$ but tree skeleton). Thus, our result significantly extends the state-of-the-art in learning Bayes net distributions. We also establish new results for learning tree and polytree distributions.
BibTeX
@inproceedings{bhattacharyya2025distribution,
  author = {Arnab Bhattacharyya and Sutanu Gayen and Philips George John and Sayantan Sen and N. V. Vinodchandran},
  title = {{Distribution Learning Meets Graph Structure Sampling}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=x6pqrvXgfY},
}
Figure