NOTMAD: Estimating Bayesian Networks with Sample-Specific Structures and Parameters

Benjamin J. Lengerich, Caleb Ellington, Bryon Aragam, Eric P. Xing, Manolis KellisarXiv 2021

Abstract

Context-specific Bayesian networks (i.e. directed acyclic graphs, DAGs) identify context-dependent relationships between variables, but the non-convexity induced by the acyclicity requirement makes it difficult to share information between context-specific estimators. To overcome this challenge, we propose NOTEARS-optimized Mixtures of Archetypal DAGs (NOTMAD). NOTMAD models context-specific Bayesian networks as the output of a function which learns to mix archetypal networks according to sample context. We encode the acyclicity constraint as a smooth regularization loss which is back-propagated to the mixing function; in this way, NOTMAD shares information between context-specific acyclic graphs, enabling the estimation of Bayesian network structures and parameters at even single-sample resolution. We demonstrate the utility of NOTMAD through analysis and experiments across diverse domains including finance, football, and cancer genomics.

Introduction

Bayesian Networks (BNs) are powerful tools for representing relationships between variables as Directed Acyclic Graphs (DAGs). Traditionally, these are estimated for an entire population. However, in fields like personalized medicine or finance, relationships are often "context-specific"—the way genes interact in a lung tumor differs from how they interact in a brain tumor, and even individual tumors within the same tissue type may exhibit unique behaviors based on patient-specific factors.

The primary challenge in inferring context-specific BNs is the combinatorial constraint of acyclicity, which makes it difficult to build "graph generator" functions capable of outputting a unique network for every sample. Previous methods often relied on breaking data into small subgroups, which reduces statistical power and cannot handle continuous, high-dimensional contexts.

Methods

NOTMAD introduces a framework where the network structure itself is the output of a learnable function of the sample's context (e.g., clinical covariates or epigenetic data).

The NOTMAD architecture: Contextual covariates are encoded to produce mixture weights for archetypal DAGs, which are then combined into a personalized network and trained using the NO-TEARS loss.

Key components of the model include:

  • Archetypal Mixing: Instead of learning a unique graph from scratch for every sample, NOTMAD learns a small set of K "archetypal" DAGs. Each sample’s specific network is a weighted mixture (a convex combination) of these archetypes.
  • Context Encoder: A differentiable function (such as a Neural Additive Model) maps the sample's context to the mixture weights.
  • Smooth Acyclicity (NOTEARS): The core innovation is using the NOTEARS loss—a mathematical approach that transforms the discrete requirement of "no cycles" into a smooth, differentiable function. This allows the entire pipeline to be trained using standard gradient descent.
  • Joint Optimization: The model learns the archetypes and the mixing function simultaneously, enabling the discovery of latent structures without prior labels.

Experimental Results

The authors evaluated NOTMAD across four diverse domains: Finance, Football, Cancer (TCGA), and Single-Cell (SNARE-seq) genomics.

Performance comparison (MSE) of NOTMAD against population-level, clustered, and LIONESS baselines across four datasets.

As shown in the results table, NOTMAD consistently outperformed state-of-the-art baselines, including standard NOTEARS and LIONESS, in terms of Mean Squared Error (MSE) on held-out data.

Key Insights

  • Bottleneck Regularization: By forcing networks to be mixtures of a few archetypes, NOTMAD creates a bottleneck that prevents overfitting, allowing for accurate network estimation even from a single observation.
  • Unsupervised Discovery: In cancer datasets, NOTMAD naturally clustered samples by tissue type and identified distinct subtypes (e.g., LUAD vs. LUSC) without explicit labels.
  • Biological and Morphological Correlation: In colon and head/neck cancers, the mixture weights of the archetypes corresponded to visible differences in tumor morphology seen in pathology slides. In single-cell data, the model successfully recovered the distinct regulatory logic of different cell types.

Conclusion

NOTMAD provides a robust framework for estimating sample-specific Bayesian networks by leveraging archetypal mixing and differentiable acyclicity constraints. By sharing statistical power across samples while allowing for individual variation, it enables high-resolution causal discovery in complex, context-dependent systems. Future work will explore extending the model to non-linear structural equations and further refining the acyclicity guarantees for unseen contexts.

Summary updated

BibTeX
@misc{lengerich2021notmad,
  author = {Benjamin J. Lengerich and Caleb Ellington and Bryon Aragam and Eric P. Xing and Manolis Kellis},
  title = {{NOTMAD: Estimating Bayesian Networks with Sample-Specific Structures and Parameters}},
  year = {2021},
  eprint = {2111.01104},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2111.01104},
}
Figure