On the Role of Sparsity and DAG Constraints for Learning Linear DAGs

Ignavier Ng, AmirEmad Ghassami, Kun Zhang

Introduction

Discovering the causal or conditional dependency structure of a set of variables—represented as a Directed Acyclic Graph (DAG)—is a fundamental problem in machine learning. Traditionally, this is incredibly difficult because the number of possible DAGs grows super-exponentially with the number of nodes.

Recently, a breakthrough method called NOTEARS bypassed this combinatorial nightmare by framing DAG learning as a continuous optimization problem. It used a clever algebraic formula to enforce acyclicity. However, NOTEARS relies on a least-squares objective and enforces acyclicity as a hard constraint. This hard constraint requires complex augmented Lagrangian solvers, often leads to ill-conditioned numerical issues, and scales poorly to large graphs.

The authors of this paper ask: are these hard constraints actually necessary, or can we relax them by choosing a better mathematical objective? They prove that by switching from a least-squares objective to a likelihood-based one, researchers can use soft sparsity and DAG constraints instead. The resulting method, GOLEM, transforms DAG learning into a highly scalable, unconstrained optimization problem that easily handles thousands of nodes on a GPU.

Methods

The authors theoretically analyze the asymptotic behavior of maximum likelihood estimators (MLE) for linear DAGs. Based on their proofs, they introduce GOLEM (Gradient-based Optimization of dag-penalized Likelihood for learning linEar dag Models).

Key methodological shifts include:

  • Likelihood over Least-Squares: Instead of minimizing a least-squares regression loss, GOLEM maximizes the Gaussian data likelihood. This introduces a crucial log-determinant (LogDet) term into the objective.
  • Soft Constraints: GOLEM uses an L1 penalty to encourage sparsity (fewer edges) and the NOTEARS trace exponential penalty to encourage "DAGness" (acyclicity). Crucially, these are applied as soft penalties added to the loss function, rather than strict, hard constraints.
  • Unconstrained Optimization: Because the constraints are soft, the problem becomes an unconstrained continuous optimization task. The authors solve this using standard gradient descent (Adam) in TensorFlow, leveraging automatic differentiation and GPU acceleration.
  • Post-processing: A simple thresholding step is applied at the end to snap near-zero edge weights to exactly zero, ensuring the final output is a strict DAG.

Datasets

  • Synthetic Data: Simulated data from Erdös–Rényi (ER) and Scale-Free (SF) graphs with varying sizes (from 10 up to 3,200 nodes). The data featured different noise distributions: Gaussian (with equal and non-equal variances), Exponential, and Gumbel.
  • Real-world Data: The classic Sachs et al. (2005) single-cell protein-signaling network dataset, which contains 11 nodes (proteins/phospholipids) and 853 observational samples.

Key Insights and Ideas

  • The Magic of the Log-Det Term: The least-squares objective treats node predictions as independent regression tasks. If variable A predicts B, and B predicts A, least-squares will happily assign weights to both, creating a cycle. The likelihood objective's log-determinant term enforces a shared structure across the variables, naturally discouraging these cycles.
  • Soft Constraints are Sufficient: Because the likelihood objective inherently avoids cycles better than least-squares, a soft DAG penalty is entirely sufficient to guide the optimizer to the correct DAG. You don't need to force the math into a strict acyclic box.
  • Theoretical Guarantees: The authors prove that in the general Gaussian case, applying soft sparsity and DAG constraints to the likelihood objective asymptotically guarantees finding a DAG that is quasi-equivalent to the ground truth.
  • Identifiability Bonus: In statistically identifiable cases (like when noise variances are strictly equal, or noise is non-Gaussian), the true DAG is the unique global minimizer. Here, the soft constraints aren't even strictly necessary for asymptotic identifiability, but they act as excellent regularizers for finite, noisy real-world samples.

Key Results

  • Superior Accuracy: GOLEM consistently outperformed NOTEARS and traditional baselines (FGS, PC, DirectLiNGAM) across most synthetic settings, achieving lower Structural Hamming Distance (SHD) and Structural Intervention Distance (SID).
Normalized SHD and SID comparing GOLEM and NOTEARS across different noise distributions and graph densities.
  • Massive Scalability: Thanks to the unconstrained formulation and GPU parallelization, GOLEM successfully scaled to massive 3,200-node graphs (taking ~12.4 hours). In contrast, NOTEARS struggled to scale past 1,600 nodes due to the computational friction of its hard constraint.
  • Robustness to Weight Scales: GOLEM proved highly robust to the scale of the underlying true edge weights. NOTEARS' performance degraded significantly when true edge weights were very large or very small, whereas GOLEM remained stable.
  • Real Data Success: On the Sachs biological dataset, GOLEM achieved the best unnormalized SHD (14) compared to the baselines.

Limitations and Future Work

  • Non-convexity: The unconstrained optimization problem is still highly non-convex. Gradient descent is only guaranteed to find local stationary points, meaning the model can occasionally get stuck in local optima (though the authors note that smart initialization helps mitigate this).
  • Thresholding Heuristics: The post-processing step relies on a manual threshold ($\omega$) to snap small weights to zero. The authors acknowledge the need for a more systematic, data-driven way to choose this threshold.
  • Future Directions: The authors suggest extending this soft-constraint framework to other score functions (like BDe for discrete data), developing early stopping criteria to speed up training, and further studying how sensitive the model is to the specific tuning of the penalty coefficients.

Summary updated

BibTeX
@inproceedings{ng2020role,
  author = {Ignavier Ng and AmirEmad Ghassami and Kun Zhang},
  title = {{On the Role of Sparsity and DAG Constraints for Learning Linear DAGs}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
  url = {https://openreview.net/forum?id=oed_TutXTRU},
}
Figure