causality-lab  by IntelLabs

AI for causal discovery and explanation

Created 4 years ago
250 stars

Top 100.0% on SourcePulse

GitHubView on GitHub
Project Summary

This repository provides a research-oriented framework for causal discovery and reasoning, offering implementations of novel algorithms for learning causal structures from observational data, handling complexities like latent confounders, and generating causal explanations from neural networks. It is valuable for researchers and engineers seeking to develop, evaluate, and apply advanced causal inference techniques.

How It Works

The framework implements three core algorithm families: causal discovery under causal sufficiency (e.g., PC, RAI, B-RAI), causal discovery in the presence of latent confounders and selection bias (e.g., FCI, ICD, OrdICD, TS-ICD), and causal reasoning (e.g., CLEANN for neural networks, Causal World Model for next-token prediction). It provides a comprehensive toolkit for simulating data, learning causal structures across various graph types (DAG, PDAG, PAG/MAG), performing statistical conditional independence tests (CI tests, d-separation, BDeu score), and evaluating graph accuracy. Novelty is highlighted in OrdICD, which leverages causal order to significantly reduce computational CI tests, and CLEANN, which interprets BERT attention mechanisms for causal explanations.

Quick Start & Requirements

Installation involves setting up a Python 3 virtual environment (virtualenv), cloning the repository, and installing dependencies via pip install -r requirements.txt. The code has been tested on Ubuntu 18.04 LTS and macOS Catalina with Python 3.5.

Highlighted Details

  • Features OrdICD (ICML 2025), an iterative causal discovery algorithm that reduces CI tests by utilizing a given causal order.
  • Includes CLEANN (NeurIPS 2023), a novel approach for generating causal explanations by analyzing self-attention in pre-trained BERT models.
  • Offers a flexible, class-based structure for developing and testing new causal discovery algorithms, allowing inheritance from existing implementations.
  • Supports a range of graph representations (DAG, PDAG, PAG/MAG) and statistical tests, coupled with detailed performance evaluation metrics for accuracy and computational cost.
  • Explores causal discovery from GPT models by analyzing attention mechanisms, as presented in a paper at ICML 2025.

Maintenance & Community

No specific details on maintenance, active contributors, community channels (e.g., Discord, Slack), or a public roadmap were found in the provided text.

Licensing & Compatibility

The license type and any compatibility notes for commercial use or integration with closed-source projects are not specified in the provided text.

Limitations & Caveats

The code has been tested on older operating systems (Ubuntu 18.04 LTS, macOS Catalina) and Python 3.5; compatibility with newer environments is not explicitly detailed. No other specific limitations, known bugs, or alpha status were mentioned in the provided text.

Health Check
Last Commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
2 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.