py-why/pywhyllm

Experimental library integrating LLM capabilities to support causal analyses

What it solves

PyWhy-LLM addresses the difficulty of obtaining domain expertise during causal analysis. It uses Large Language Models (LLMs) to suggest potential causal relationships, confounders, and validation strategies, reducing the reliance on human experts for initial model building.

How it works

The library provides specialized "suggesters" that interface with LLMs (like GPT-4) to assist in different stages of the causal inference pipeline:

  • Modeler: Suggests domain expertise, potential confounders, and pairwise relationships between variables to build a Directed Acyclic Graph (DAG).
  • Identifier: Suggests backdoor sets, mediator sets, and instrumental variables (IVs).
  • Validator: Critiques existing DAGs, suggests latent confounders, and identifies negative controls.
  • Augmented Modeler: Uses Retrieval Augmented Generation (RAG) via CauseNet to provide more grounded causal suggestions.

Who it’s for

Data scientists and researchers performing causal inference who need a starting point for their causal models or a way to validate their assumptions using LLM-derived knowledge.

Highlights

  • Causal Pipeline Integration: Covers modeling, identification, and validation phases.
  • RAG Capabilities: Includes an augmented modeler that leverages CauseNet for improved accuracy.
  • Domain Expertise Simulation: Automatically suggests relevant domain expertises to guide the LLM's reasoning.

Related

  • Project
  • Project
  • Project
  • Project