Context-Aware Reasoning On Parametric Knowledge for Inferring Causal Variables

Ivaxi Sheth, Sahar Abdelnabi, Mario Fritz

Abstract

Scientific discovery catalyzes human intellectual advances, driven by the cycle of hypothesis generation, experimental design, evaluation, and assumption refinement. Central to this process is causal inference, uncovering the mechanisms behind observed phenomena. While randomized experiments provide strong inferences, they are often infeasible due to ethical or practical constraints. However, observational studies are prone to confounding or mediating biases. While crucial, identifying such backdoor paths is expensive and heavily depends on scientists' domain knowledge to generate hypotheses. We introduce a novel benchmark where the objective is to complete a partial causal graph. We design a benchmark with varying difficulty levels with over 4000 queries. We show the strong ability of LLMs to hypothesize the backdoor variables between a cause and its effect. Unlike simple knowledge memorization of fixed associations, our task requires the LLM to reason according to the context of the entire graph.

Introduction

In the pursuit of scientific understanding, researchers strive to build causal models that explain the mechanisms of the natural world. These models are typically represented as Directed Acyclic Graphs (DAGs), where nodes represent variables and arrows represent causal relationships. However, these models are rarely complete in practice. Scientists often face the challenge of "hidden" variables: confounders (factors influencing both cause and effect) or mediators (intermediate steps in a causal chain).

Overview of the causal variable inference cycle where an LLM acts as a scientific co-pilot to hypothesize missing variables.

Identifying these missing pieces currently requires immense domain expertise and expensive, iterative experimentation. While Large Language Models (LLMs) have demonstrated an ability to identify relationships between known variables, this research explores a more complex frontier: Can an LLM analyze a partial causal map and hypothesize the missing links? By acting as a "scientific co-pilot," LLMs could significantly accelerate the hypothesis generation phase of the scientific method.

The Causal Inference Benchmark

To evaluate this capability, the authors formalized the task of LLM-assisted causal variable inference. They developed a multi-stage benchmark comprising four tasks of increasing complexity:

  1. Out-of-Context Identification: A multiple-choice task where the model selects the missing variable from a list containing the correct answer and unrelated distractors (e.g., "book sales" in a medical context).
  2. In-Context Identification: A more rigorous version where distractors are valid variables from the same domain, testing the model's understanding of specific local graph structures.
  3. Hypothesizing in Open World: The LLM is provided with a partial graph and must generate a ranked list of potential missing variables from scratch, without predefined options.
  4. Iterative Hypothesizing: The model must sequentially propose a chain of mediators that link a treatment to an outcome, simulating complex causal pathways.
Comparison of Task 1 (Out-of-Context) and Task 2 (In-Context) identification, showing how difficulty increases when distractors are drawn from the same domain.

The benchmark utilizes eight diverse causal graphs ranging from 5 to 37 nodes, covering domains such as neonatal health (Child), ICU monitoring (Alarm), car insurance risks (Insurance), and a specialized Alzheimer’s Disease graph. To ensure models weren't simply reciting training data, a "Neuropathic pain" graph was included as a validation set.

Key Insights and Results

The study reveals that for LLMs, context is king. Models perform significantly better when provided with the surrounding graph structure rather than just isolated pairs of variables. This suggests that the models are not merely performing a dictionary lookup but are using the presence of related nodes (like "Bronchitis" and "Dyspnea") to narrow down the most logical missing link.

Reasoning vs. Memorization

While top-tier models like GPT-4 and GPT-4o showed some ability to recall variables from well-known datasets, their performance remained robust even on lesser-known or newer graphs. This indicates a capacity for "parametric reasoning"—leveraging the deep knowledge embedded in their weights to solve structural puzzles. However, a "structural bias" was observed: models are generally better at identifying mediators and colliders than they are at identifying source nodes (root causes) or sink nodes (final outcomes).

Performance Metrics

  • Top Performers: GPT-4 and GPT-4o consistently outperformed open-source alternatives like Llama-3 and Mistral.
  • Multiple Choice: Top models achieved near-perfect accuracy on simpler graphs, though performance dipped to roughly 50% on highly complex graphs like "Insurance."
  • Generative Success: In open-world tasks, GPT-4 achieved an LLM-as-Judge score of ~0.73. Qualitative analysis showed that even when the model missed the exact "ground truth" variable, it often suggested scientifically plausible synonyms or alternatives.

Conclusion and Future Directions

This research demonstrates that LLMs can effectively hypothesize hidden confounders and mediators by reasoning over causal contexts. While current evaluations are limited to known ground-truth DAGs, the potential for LLMs to assist in "frontier" science is significant. Future work will focus on integrating these LLM hypotheses with statistical data for mathematical validation and developing human-in-the-loop systems to assist scientists in brainstorming potential confounders before data collection begins.

Summary updated

Abstract

Scientific discovery catalyzes human intellectual advances, driven by the cycle of hypothesis generation, experimental design, evaluation, and assumption refinement. Central to this process is causal inference, uncovering the mechanisms behind observed phenomena. While randomized experiments provide strong inferences, they are often infeasible due to ethical or practical constraints. However, observational studies are prone to confounding or mediating biases. While crucial, identifying such backdoor paths is expensive and heavily depends on scientists' domain knowledge to generate hypotheses. We introduce a novel benchmark where the objective is to complete a partial causal graph. We design a benchmark with varying difficulty levels with over 4000 queries. We show the strong ability of LLMs to hypothesize the backdoor variables between a cause and its effect. Unlike simple knowledge memorization of fixed associations, our task requires the LLM to reason according to the context of the entire graph.
BibTeX
@misc{sheth2024context,
  author = {Ivaxi Sheth and Sahar Abdelnabi and Mario Fritz},
  title = {{Context-Aware Reasoning On Parametric Knowledge for Inferring Causal Variables}},
  year = {2024},
  eprint = {2409.02604},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2409.02604},
}
Figure