LLM-initialized Differentiable Causal Discovery

Shiv Kampani, David Hidary, Constantijn van der Poel, Martin Ganahl, Brenda Miao · DOI

Introduction

Causal discovery—the task of determining "what causes what" from observational data—is a cornerstone of science, from genetics to economics. Currently, researchers face a trade-off between three imperfect approaches: score-based methods that suffer from combinatorial explosion, Differentiable Causal Discovery (DCD) methods that often use uninterpretable "black-box" neural networks, and Large Language Model (LLM) based methods that possess domain knowledge but struggle with formal statistical reasoning.

LLM-DCD is a new framework that addresses this gap by using LLMs to provide a "warm start" for DCD. By initializing a statistically rigorous optimization process with the domain-specific priors of an LLM, the method achieves state-of-the-art accuracy on complex causal graphs while remaining significantly more interpretable than traditional neural-network-based approaches.

Methods

The authors introduce LLM-DCD, which combines these worlds through two primary innovations:

  • The MLE-INTERP Ansatz: Traditional DCD methods use Multi-Layer Perceptrons (MLPs) to model conditional probabilities, which obscures the causal graph. The authors replace the MLP with an explicitly defined adjacency matrix ($A$) and a rational function based on frequency counts from the data. This makes the adjacency matrix the only variational parameter, ensuring the model is fully interpretable.
  • LLM Initialization: Because the adjacency matrix is explicit, it can be directly initialized with a "guess" from an LLM. The authors tested two strategies: Pairwise (PAIR), asking the LLM about every possible pair of variables, and Breadth-First Search (BFS), a more efficient three-stage algorithm that reduces the number of required LLM queries.

The process starts with the LLM's suggested graph and then uses the Adam optimizer to refine that graph based on real-world observational data, while enforcing a "spectral acyclicity constraint" to ensure the final result is a valid Directed Acyclic Graph (DAG).

Experimental Setup

The method was evaluated on five standard benchmarking datasets from the bnlearn R package, representing real-world causal structures of varying complexity:

  • Cancer: 5 variables, 4 edges (Small/Simple)
  • Sachs: 11 variables, 17 edges
  • Child: 20 variables, 25 edges
  • Alarm: 37 variables, 46 edges
  • Hepar2: 70 variables, 123 edges (Large/Complex)

Key Results

The authors used Structural Hamming Distance (SHD) as their primary metric, where a lower score indicates a predicted graph closer to the ground truth. As shown in the performance table below, LLM-DCD variants consistently outperform baseline methods.

Structural Hamming Distance (SHD) results across datasets. Lower scores indicate better performance. Bold values represent the best performance per dataset.

Superior Accuracy and Scalability

On the complex Alarm dataset (37 variables), LLM-DCD-B (BFS-initialized) achieved an SHD of 36.3, vastly outperforming standard DCD methods like SDCD (SHD 131) and even the LLM-only BFS approach (SHD 64). This trend continues as graph size increases. On the Hepar2 dataset (70 variables), LLM-DCD-B achieved an SHD of 140, while many baseline methods either failed to finish or produced significantly worse results (e.g., DAGMA at 272).

Performance metrics (F1-score, Precision, Recall) and computation time as a function of the number of variables (d).

Metric Dominance

Across almost all datasets, the LLM-initialized versions showed higher F1-scores (a balance of precision and recall) compared to random initialization. The visualization of metrics against the number of variables ($d$) demonstrates that while precision and recall generally fluctuate with graph complexity, the LLM-DCD (BFS) approach maintains a competitive edge in F1-score while remaining computationally efficient compared to methods like PAIR as $d$ grows.

Discussion and Insights

  • Priors as the "Secret Sauce": The quality of the final causal graph is directly tied to the quality of the initialization. A "warm start" from an LLM helps the optimization avoid local minima that trap purely data-driven methods.
  • Interpretability Enables Integration: By moving away from black-box neural networks to an explicit adjacency matrix, the authors created a "hook" that allows external knowledge (from LLMs or human experts) to be injected directly into the mathematical optimization.
  • Data Corrects the LLM: While the LLM provides a great starting point, the DCD optimization refines it using actual observations. This allows the system to benefit from LLM "intuition" while remaining grounded in statistical evidence.

Limitations

The current implementation of the gradient calculation is $O(d^4)$, which could become a bottleneck for extremely large graphs (hundreds or thousands of variables). Additionally, the current MLE-INTERP function is designed for discrete data; extending this to continuous variables is a key area for future work. Finally, while the data helps correct the LLM, a highly confident but incorrect LLM prior could potentially bias the discovery process, necessitating further study into LLM "hallucinations" in causal contexts.

Summary updated

BibTeX
@misc{kampani2024llm,
  author = {Shiv Kampani and David Hidary and Constantijn van der Poel and Martin Ganahl and Brenda Miao},
  title = {{LLM-initialized Differentiable Causal Discovery}},
  year = {2024},
  eprint = {2410.21141},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.21141},
}
Figure