Causal Transformer for Estimating Counterfactual Outcomes

Valentyn Melnychuk, Dennis Frauen, Stefan Feuerriegel
4/14/2022
cs.LGstat.ML
transformer-attention

Official code: Valentyn1997/CausalTransformer (198 stars, Python, MIT, last commit 2024-08-13).

Abstract

Estimating counterfactual outcomes over time from observational data is relevant for many applications (e.g., personalized medicine). Yet, state-of-the-art methods build upon simple long short-term memory (LSTM) networks, thus rendering inferences for complex, long-range dependencies challenging.

Show full abstract

In this paper, we develop a novel Causal Transformer for estimating counterfactual outcomes over time. Our model is specifically designed to capture complex, long-range dependencies among time-varying confounders. For this, we combine three transformer subnetworks with separate inputs for time-varying covariates, previous treatments, and previous outcomes into a joint network with in-between cross-attentions. We further develop a custom, end-to-end training procedure for our Causal Transformer. Specifically, we propose a novel counterfactual domain confusion loss to address confounding bias: it aims to learn adversarial balanced representations, so that they are predictive of the next outcome but non-predictive of the current treatment assignment. We evaluate our Causal Transformer based on synthetic and real-world datasets, where it achieves superior performance over current baselines. To the best of our knowledge, this is the first work proposing transformer-based architecture for estimating counterfactual outcomes from longitudinal data.

View on arXivView PDF

Code Implementations(1)

MIT

Code for the paper "Causal Transformer for Estimating Counterfactual Outcomes"

19846PythonMay 9, 20222 years agoMIT

Similar Papers

Cite this paper

@article{melnychuk2022causal,
  title  = {Causal Transformer for Estimating Counterfactual Outcomes},
  author = {Valentyn Melnychuk and Dennis Frauen and Stefan Feuerriegel},
  year   = {2022},
  eprint = {2204.07258},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2204.07258}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2204.07258.svg)](https://codeofpaper.com/paper/2204.07258)

Discussion