Causal- LLM : A Unified One-Shot Framework for Prompt- and Data-Driven Causal Graph Discovery (2025)

Abstract: Current causal discovery methods using Large Language Models (LLMs) often rely on pairwise or iterative strategies, which fail to capture global dependencies, amplify local biases, and reduce overall accuracy. This work introduces a unified framework for one-step full causal graph discovery through: (1) Prompt-based discovery with in-context learning when node metadata is available, and (2) Causal_llm , a data-driven method for settings without metadata. Empirical results demonstrate that the prompt-based approach outperforms state-of-the-art models (GranDAG, GES, ICA-LiNGAM) by approximately 40% in edge accuracy on datasets like Asia and Sachs, while maintaining strong performance on more complex graphs (ALARM, HEPAR2). Causal_llm consistently excels across all benchmarks, achieving 50% faster inference than reinforcement learning-based methods and improving precision by 25% in fairness-sensitive domains such as legal decision-making. We also introduce two domain-specific DAGs—one for bias propagation and another for legal reasoning under the Bhartiya Nyaya Sanhita—demonstrating LLMs’ capability for systemic, real-world causal discovery.

## related works this work investigates the causal discovery capabilities of large language models (llms), specifically focusing on the construction of the complete causal graph (see figure 2 ). although prior studies have explored general causal reasoning @xcite , cause-effect inference @xcite , and correlation-to-causation transitions @xcite , they do not address full graph discovery. most llm-based approaches rely on pairwise causal edge detection @xcite or iterated querying across all node pairs @xcite @xcite , which scale poorly due to quadratic complexity and often introduce cycles @xcite . some mitigate this via post-processing or causal ordering with voting @xcite , but these are typically restricted to small graphs (≤22 nodes). other works explore breadth-first querying for more scalable graph discovery @xcite , or generate domain knowledge graphs from text @xcite , but without benchmarking against ground-truth dags. recent efforts in single-shot generation @xcite show promise, yet remain limited in scope. in parallel, pre-trained language models (plms) have been explored within causal discovery frameworks @xcite , demonstrating that while plms can provide useful prior knowledge through text-based causal reasoning, their effectiveness is constrained by prompt sensitivity and lack of direct data analysis. crucially, these methods are prompt-based and rely on node metadata-making them unsuitable for purely data-driven causal discovery. existing work using llms as auxiliary tools @xcite typically generate priors-e.g., pairwise edge constraints, causal orders, or adjacency matrices-which guide conventional algorithms rather than enabling direct inference. attempts to elicit direct causal structure from data via prompting @xcite have not succeeded. to fill this gap, we propose and benchmark a unified framework (refer section 3): (i) prompt-based full-graph discovery when metadata is available, and (ii) causal_llm, a novel llm-based method for end-to-end causal graph inference directly from data-evaluated on diverse datasets with up to 100 nodes. ## methodology prior works in llm-based causal discovery have largely explored either: (i) prompt-based querying, which relies on external metadata and humanreadable descriptions to elicit causal knowledge from language models @xcite @xcite , or (ii) data-driven causal discovery, grounded in statistical principles and algorithms such as pc, ges, or ica-lingam. however, these two strands have been treated independently, and the literature lacks a unified framework that combines both capabilities-especially at scale. our work (please ref figure 3 ) addresses this gap by proposing a dual-mode framework that evaluates and compares: (1) a prompt-based approach that performs causal graph generation directly from node metadata (refer appendix a), enabling an llm to reason based on its pre-trained knowledge; ## mathematical foundation our end-to-end approach is grounded in theoretical guarantees that ensure reliable dag learning, specifically the projection of raw data into the llm embedding space. in this section, we provide a bayesian map derivation of our loss function: state embedding assumptions: under the markov and faithfulness conditions, solving the convex map problem with acyclicity enforcement recovers the true graph up to markov equivalence. ## discussion in this paper, we have argued that the question of causal understanding is equivalent to the understanding of how llm functions, that is, whether llm follows any causation while generating the output. our experimental results rigorously validate the effectiveness of both the prompt-based method and the data-driven causal_llm model, while also delineating their respective strengths and limitations. below, we synthesize these findings through systematic analysis: prompt-based method: leveraging node metadata for superior accuracy the promptbased approach, which utilizes node metadata, demonstrates measurable advantages (refer appendix figure 10 ): these complementary strengths establish the prompt-based and data-driven approaches as effective, versatile tools for modern causal discovery (refer appendix figures 10 to 12), with demonstrated success across domains ranging from small biological networks to large-scale gene regulatory systems. ## key takeaways in this section, we compare the prompt-based approach and the data-driven approach to determine their respective advantages (refer figure 5 ). ## conclusion overall, the prompt-based method excels in metadata-rich settings, ensuring high accuracy and fairness in critical domains. the data-driven causal_llm model emerges as a scalable and efficient alternative, delivering competitive performance with reduced runtime. this highlights llms' capability for full graph discovery, positioning them as strong contenders in causal discovery for both metadata-rich and data-only scenarios.