Can LLMs Leverage Observational Data? Towards Data-Driven Causal Discovery with LLMs

Yuni Susanti, Michael Färber

TL;DR

Can Large Language Models infer cause-and-effect directly from raw numerical data rather than relying solely on variable names? This paper explores data-driven causal discovery by embedding sampled observational data directly into LLM prompts using pairwise and breadth-first search (BFS) strategies. The authors find that feeding tabular observations into GPT-4 boosts causal graph reconstruction (up to +0.11 F1) and significantly outperforms classical statistical algorithms in sample-limited regimes.

What Problem Does This Paper Address?

Traditional causal discovery relies on statistical algorithms (like PC or GES) applied to observational data, but these methods often require large sample sizes and strict assumptions about data distributions. Recently, LLMs have been deployed for knowledge-based causal discovery—relying on variable names and text metadata to guess causal relationships. However, text-only inference is prone to hallucination, domain bias, and inability to adapt to real-world dataset variations.

This paper investigates the bridge between these two worlds: Can LLMs leverage raw observational data directly within prompts to perform data-driven causal discovery?

Methods

The authors formulate causal discovery as edge classification (identifying whether $V_i \to V_j$, $V_j \to V_i$, or no relation exists) and incorporate sampled tabular observations $\mathcal{D}_s$ (fixed at $k = 100$ rows due to context limits) into the prompt:

  • Pairwise Prompting + Data: The model is queried pairwise for every variable pair $(V_i, V_j)$ alongside a sub-table containing sampled joint observations of the two variables.
  • Breadth-First Search (BFS) Prompting + Data: To avoid the quadratic query explosion of pairwise checks, the authors adapt a BFS-based strategy traversing the causal graph in three phases: Initialization (find root causes unaffected by others), Expansion (query which variables are caused by the current node given joint observations), and Insertion (cycle-checked queue insertion).
  • Baselines: Statistical baselines include PC (constraint-based) and GES (score-based), alongside LLM prompts with metadata-only or with precomputed summary statistics (Pearson correlation).
  • Model: Experiments used gpt-4-0125-preview evaluated across multiple temperatures $\{0, 0.5, 0.7, 1.0\}$.

Datasets

The authors evaluated methods on three standard synthetic/benchmark Bayesian networks from the BNLearn repository:

  1. ASIA: 8 variables predicting lung diseases based on medical observations and travel history.
  2. CANCER: 5 variables modeling factors influencing cancer development with intricate dependency structures.
  3. SURVEY: 6 variables modeling public transport preferences across social demographics.

No new datasets were introduced; the authors chose these benchmarks because their ground-truth causal structures are well-established.

Key Insights and Ideas

  • Raw data provides contextual grounding: Feeding raw numerical tables directly into the prompt consistently improved the LLM's causal inference over metadata-only prompting across both pairwise and BFS setups.
  • Raw samples beat summary statistics: Directly supplying sampled rows yielded higher performance improvements on average (+0.075 F1) than providing precomputed Pearson correlations (+0.035 F1). Raw tables likely allow the model to detect non-linear dependencies or conditional patterns that simple bivariate correlations miss.
  • Global context beats local pairs: BFS-based prompting substantially outperformed pairwise prompting. Traversal-based prompts supply multi-variable context rather than evaluating isolated pairs, which helps avoid conflicting edge directions.
  • Data efficiency in limited-sample regimes: Classical algorithms like PC struggle on small sample sizes ($N=100$), sometimes needing 1,000 samples to match the quality of LLM-based discovery informed by domain priors and just 100 observations.

Key Results

  • Observational Data Gains: Adding observational data boosted F1 scores by up to +0.11 points for both Pairwise (0.47 to 0.58 on ASIA) and BFS prompting (0.66 to 0.77 on CANCER).
  • Outperforming Classical Baselines: BFS prompting with observational data outperformed the statistical PC baseline by +0.44 points in F1 on CANCER (0.77 vs. 0.33) and +0.40 points on ASIA (0.90 vs. 0.50). Compared to GES, gains ranged from +0.29 to +0.52 F1 across all datasets.
  • Top Performance: The highest scores were attained by BFS Prompting + Observational Data, achieving an F1 of 0.90 on ASIA, 0.77 on CANCER, and 0.54 on SURVEY, while achieving the lowest Normalized Hamming Distance (NHD).

Limitations and Future Work

  • Token Limitations and Sample Size: LLMs cannot ingest full datasets; data was capped at 100 samples due to prompt context constraints.
  • Prompt History Overhead: While BFS scales linearly in query count compared to pairwise checks, appending query history and multi-variable tabular samples quickly bloats the context window.
  • Dataset Scope and Size: Evaluations were conducted only on small networks (5–8 variables) from BNLearn; scalability to high-dimensional graphs remains unproven.
  • Model Dependence: Experiments only evaluated a single model (gpt-4-0125-preview), leaving open how open-weight or smaller LLMs handle raw data-driven causal reasoning.
  • Future Directions: Developing hybrid architectures that systematically combine formal statistical conditional independence tests with LLM reasoning agents, alongside more intelligent sample-selection strategies.

Summary updated

BibTeX
@inproceedings{susanti2025can,
  author = {Yuni Susanti and Michael Färber},
  title = {{Can LLMs Leverage Observational Data? Towards Data-Driven Causal Discovery with LLMs}},
  booktitle = {Causal-NeSy @ ESWC},
  year = {2025},
  url = {https://openreview.net/forum?id=Z8KNJf22O5},
}
Figure