Causal Order: The Key to Leveraging Imperfect Experts in Causal Inference

Aniket Vashishtha, Abbavaram Gowtham Reddy, Abhinav Kumar, Saketh Bachu, Vineeth N Balasubramanian, Amit Sharma

TL;DR

Using Large Language Models (LLMs) to build causal graphs via pairwise questions ("Does A cause B?") often fails because they cannot distinguish direct from indirect effects, leading to logical contradictions and cycles. This paper proposes eliciting causal order (topological sorting) instead of full graphs, introducing a novel "triplet prompting" method that enforces local acyclicity. This approach significantly reduces structural errors, allowing smaller open-source models like Llama-3 to outperform GPT-4 on causal discovery tasks.

What Problem Does This Paper Address?

Causal discovery—identifying the web of cause-and-effect relationships within a system—is a foundational challenge in data science. Recently, researchers have attempted to use LLMs as virtual domain experts by asking them pairwise questions like "Does variable A cause variable B?".

However, the authors highlight a fundamental limitation: given just a pair of variables, even a perfect human expert cannot reliably distinguish between a direct effect ($A \rightarrow B$) and an indirect effect ($A \rightarrow C \rightarrow B$) without knowing the full context of the other variables in the system. When forced to construct a full graph from isolated pairwise queries, LLMs frequently introduce erroneous edges and create illegal causal cycles (e.g., A causes B, B causes C, and C causes A), rendering the resulting graph useless for downstream causal inference.

Methods

The authors introduce two core innovations to solve this problem:

  1. Causal Order as the Output Interface: Instead of trying to map out every single direct edge, they shift the goal to finding the causal order (the topological ordering of variables). Causal order is highly stable because it doesn't care if an effect is direct or indirect; it simply establishes that a cause must precede its effect.
  2. The Triplet Method: Instead of querying pairs, the algorithm queries triplets of variables $(A, B, C)$. The LLM is instructed to determine the causal relationships among all three while strictly avoiding cycles within that local triplet.
Figure 2: Top: Using the pairwise prompt, even under a perfect expert (e.g., domain expert), the estimated graph may not be correct (SHD = 1). Causal order, however, is correct (Dtop = 0) and hence a better metric. Bottom: under imperfect experts such as LLMs, pairwise prompts may not lead to valid order, creating cycles. The proposed triplet prompting strategy alleviates this issue to provide better estimates of causal order (Dtop = 0).

Because each pair appears in multiple triplets alongside different auxiliary variables, the method generates multiple overlapping perspectives. A majority-voting ensemble aggregates these triplet responses, resolves conflicts, and extracts a clean, global causal order.

Datasets

The method was evaluated across two categories of benchmarks:

  • Standard Causal Graphs (BNLearn): Earthquake, Cancer, Survey, Asia, and Child.
  • Real-World Medical Graphs: To address potential LLM memorization concerns, the authors tested on complex, expert-curated medical datasets created after the training cutoff dates of the models: Neuropathic Pain Diagnosis, Alzheimers Dataset, and Covid-19 Dataset.

Key Insights and Ideas

  • Graphs are the wrong interface for imperfect experts: Evaluating an LLM's causal knowledge using standard graph metrics like Structural Hamming Distance (SHD) unfairly penalizes them for mixing up direct and indirect paths, even if their underlying causal logic is sound. Causal order provides a much fairer, more stable metric.
  • Local context prevents global failure: Introducing a third "auxiliary" variable provides just enough context for the LLM to self-correct and maintain acyclicity.
  • Prompting geometry beats model scale: Clever structuring of the prompt space (triplets + ensembling) allows lightweight, open-source models (like Phi-3 3.8B and Llama-3 8B) to beat massive proprietary models (GPT-4) running naive pairwise prompts.

Key Results

  • Drastic Cycle Reduction: On the 20-node Child dataset, standard pairwise prompting with GPT-3.5 produced over 3,000 causal cycles. The triplet method reduced this to exactly zero.
  • Smaller Models Win: Llama-3 8B using the triplet method achieved a topological divergence ($D_{top}$) of 12 on the Child dataset, completely outclassing GPT-4's pairwise baseline, which failed to compute a valid order due to generating over 10,000 cycles.
  • Downstream Utility: Feeding the triplet-derived causal order as a prior constraint into classical causal discovery algorithms (like PC or CaMML) consistently reduced structural errors and significantly improved the accuracy of Average Causal Effect (ACE) estimations.

Limitations and Future Work

  • Computational Complexity: Iterating over all triplets scales at $O(n^3)$. While the authors propose a localized variant that bounds this to $O(k \cdot n^2)$ using a fixed number of neighbors $k$, it remains more expensive than simple pairwise querying.
  • Boundaries of LLM Knowledge: This method relies entirely on the domain knowledge latent within the LLM's weights. It cannot discover entirely novel causal relationships or handle variables with completely anonymous names.
  • Counterfactual Limitations: While causal order is sufficient for identifying valid backdoor adjustment sets, it is insufficient for counterfactual estimation, which still strictly requires a fully specified structural equation graph.

Summary updated

Abstract

Large Language Models (LLMs) have been used as experts to infer causal graphs, often by repeatedly applying a pairwise prompt that asks about the causal relationship of each variable pair. However, such experts, including human domain experts, cannot distinguish between direct and indirect effects given a pairwise prompt. Therefore, instead of the graph, we propose that causal order be used as a more stable output interface for utilizing expert knowledge. Even when querying a perfect expert with a pairwise prompt, we show that the inferred graph can have significant errors whereas the causal order is always correct. In practice, however, LLMs are imperfect experts and we find that pairwise prompts lead to multiple cycles. Hence, we propose the triplet method, a novel querying strategy that introduces an auxiliary variable for every variable pair and instructs the LLM to avoid cycles within this triplet. It then uses a voting-based ensemble method that results in higher accuracy and fewer cycles while ensuring cost efficiency. Across multiple real-world graphs, such a triplet-based method yields a more accurate order than the pairwise prompt, using both LLMs and human annotators. The triplet method enhances robustness by repeatedly querying an expert with different auxiliary variables, enabling smaller models like Phi-3 and Llama-3 8B Instruct to surpass GPT-4 with pairwise prompting. For practical usage, we show how the expert-provided causal order from the triplet method can be used to reduce error in downstream graph discovery and effect inference tasks.
BibTeX
@inproceedings{vashishtha2025causal,
  author = {Aniket Vashishtha and Abbavaram Gowtham Reddy and Abhinav Kumar and Saketh Bachu and Vineeth N Balasubramanian and Amit Sharma},
  title = {{Causal Order: The Key to Leveraging Imperfect Experts in Causal Inference}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=9juyeCqL0u},
}
Figure