End-To-End Causal Effect Estimation from Unstructured Natural Language Data

Nikita Dhawan, Leonardo Cotta, Karen Ullrich, Rahul Krishnan, Chris J. Maddison

TL;DR

Researchers have developed NATURAL, a new framework that uses Large Language Models (LLMs) to estimate causal effects directly from unstructured text data, like patient forum posts. By treating LLMs as tools to extract conditional probability distributions from text, the system can produce results that match gold-standard clinical trials within just 3 percentage points—potentially saving millions of dollars and years of research time.

What Problem Does This Paper Address?

Causal inference—determining if "A caused B"—is the backbone of medicine and social science. Traditionally, this requires either expensive Randomized Controlled Trials (RCTs) or meticulously structured observational datasets where every variable is already defined and tabulated.

Comparison of experimental designs

However, a massive amount of "interventional" data lives in unstructured natural language: doctor’s notes, police reports, and online patient communities (like Reddit). Until now, tapping into this resource required massive manual effort to "structure" the data before any math could be done. The authors ask: Can we use LLMs to automate this entire pipeline, going straight from raw text to a causal effect estimate?

Methods

The authors introduce NATURAL (NATural language analysis to Understand ReAL effects), a family of estimators that leverages LLMs not as "black-box" reasoners, but as parametric approximators of conditional distributions.

The NATURAL pipeline

The pipeline consists of several key stages:

  1. Filtering: A multi-stage process (deterministic rules + LLM prompting) to find reports that are relevant to the study and meet specific "inclusion criteria" (e.g., a patient must have Type 2 Diabetes and be taking Metformin).
  2. Extraction and Imputation: The LLM extracts variables like treatment ($T$), outcome ($Y$), and covariates ($X$). Crucially, if a post is missing information (like a patient's age), the LLM is used to impute a likely value based on the context of the report.
  3. Conditional Inference: Instead of just asking the LLM "did this work?", they query the model for the probability of an outcome or treatment given the text.
  4. Causal Estimation: These probabilities are plugged into classical statistical estimators, specifically Inverse Propensity Score Weighting (IPW) and Outcome Imputation (OI), to calculate the Average Treatment Effect (ATE).

Datasets

The study evaluated NATURAL across six datasets:

  • Two Semi-synthetic Datasets: Based on marketing data (Hillstrom and Retail Hero). The authors used an LLM to "write" social media posts based on structured data, allowing them to test the pipeline against a known ground truth.
  • Four Real-world Clinical Datasets: Curated from Reddit (Pushshift collection) focusing on Migraine and Diabetes subreddits.
  • Diabetes: Semaglutide vs. Tirzepatide; Semaglutide vs. Liraglutide.
  • Migraine: Erenumab vs. Topiramate; OnabotulinumtoxinA vs. Topiramate.

The "ground truth" for the real-world sets were actual Phase 3/4 clinical trials (RCTs) published in medical journals.

Key Insights and Ideas

  • LLMs as Calibrated Observers: The core "aha moment" is that LLMs are surprisingly good at providing the conditional distributions ($P(X, T, Y | R)$) needed for causal math. They act as a bridge between messy human language and rigorous statistics.
  • The Importance of Scale: The researchers found a clear "scaling law" for causal inference. Larger models (like Llama 2-70B) were significantly better at "balancing" covariates—ensuring that the treated and control groups were actually comparable—than smaller models.
  • Zero-Shot Curation: Unlike previous methods, NATURAL doesn't require task-specific training data. It uses the LLM's pre-existing knowledge to identify relevant reports and extract data points.
  • Recovering Lost Value: The framework can "recover" information from posts that might be discarded in a manual study by using the LLM to infer missing but necessary context.

Key Results

The results are remarkably accurate for a fully automated system:

  • Accuracy: In all real-world clinical trial replications, NATURAL’s predicted ATEs fell within 3 percentage points of the ground truth RCT results.
  • Directionality: The model correctly identified which drug was more effective in every single test case.
  • Efficiency: While a clinical trial takes years and millions of dollars, the NATURAL pipeline can process thousands of reports in days for a few hundred dollars in compute costs.
  • Robustness: Sensitivity analysis showed that the results were robust to "unobserved confounding," meaning the estimated effects were strong enough that they weren't likely to be explained away by a hidden variable the model missed.

Limitations and Future Work

While promising, the authors highlight several hurdles:

  • Selection Bias: People who post on Reddit are not a representative sample of the global population. NATURAL estimates "local" effects for the population that writes the text.
  • LLM Calibration: The method relies on the LLM's internal probabilities being "calibrated." If a model is overconfident or biased by its training data, the causal estimates will drift.
  • Network Interference: On social media, users talk to each other. If one user's post influences another's treatment choice, it violates the standard "i.i.d." (independent and identically distributed) assumption of causal inference.
  • Future Directions: The authors suggest extending the method to handle real-valued variables (like exact weight loss numbers) and developing automated prompt tuning to make the extraction even more precise.

Summary updated

BibTeX
@inproceedings{dhawan2024end,
  author = {Nikita Dhawan and Leonardo Cotta and Karen Ullrich and Rahul Krishnan and Chris J. Maddison},
  title = {{End-To-End Causal Effect Estimation from Unstructured Natural Language Data}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=gzQARCgIsI},
}
Figure