Perfect Match: A Simple Method for Learning Representations For Counterfactual Inference With Neural Networks

Patrick Schwab, Lorenz Linhardt, Walter KarlenarXiv 2018

Abstract

Estimating individual treatment effects (ITE) from observational data is a fundamental challenge in causal inference due to selection bias and the lack of counterfactual observations. We introduce "Perfect Match" (PM), a straightforward training strategy that augments minibatches with propensity-matched nearest neighbors to create virtually randomized experiments. PM scales effectively to multiple treatment scenarios and significantly outperforms complex state-of-the-art methods without requiring additional hyperparameters.

Introduction

Answering counterfactual questions—such as "What would have happened if a patient received a different treatment?"—is essential for personalized medicine and public policy. However, observational data is plagued by selection bias: treatments are often assigned based on characteristics that also influence outcomes. This creates a distribution shift that causes standard machine learning models to overfit to the factual data and fail on counterfactual predictions. While many existing solutions involve complex adversarial networks or heavy regularization, they often struggle to scale beyond binary treatment cases.

Methodology

The Perfect Match (PM) Strategy

Perfect Match addresses selection bias at the data level during training. Instead of complex mathematical constraints, PM modifies the construction of training minibatches. For every individual in a minibatch, the algorithm identifies its "nearest neighbor" from every other possible treatment group in the training set, using propensity scores to define similarity. By adding these matched counterparts to the minibatch, the model is trained on a "virtually randomized" dataset where every individual appears to have received every available treatment.

Architecture: Multi-Head TARNET

To support multiple treatments, we extend the Treatment-Agnostic Representation Network (TARNET). The model consists of a shared base network that learns a common representation of the input features, followed by separate "heads" for each treatment option. This allows the model to share information across treatments while maintaining specialized prediction paths for each specific intervention.

The TARNET architecture extended for multiple treatments with shared layers and individual heads.

Model Selection and Evaluation

A critical insight of this work is that standard metrics like Mean Squared Error (MSE) on observed (factual) data are unreliable for selecting the best causal model. Because MSE only measures performance on the treatment actually received, it does not account for counterfactual accuracy.

Correlation analysis showing that NN-PEHE (right) is a much better proxy for true counterfactual error (PEHE) than standard MSE (left).

As demonstrated in the correlation analysis, the proposed Nearest Neighbor approximation (NN-PEHE) provides a far more reliable metric for model selection, showing a high correlation ($\rho=0.86$) with the true counterfactual error (PEHE), whereas MSE performs poorly ($\rho=0.34$).

Results and Discussion

Evaluations on the IHDP and News datasets (ranging from 2 to 16 treatments) show that PM's performance advantage increases as the number of treatments grows. On the 16-treatment News benchmark, PM outperformed all state-of-the-art methods, including complex generative models like GANITE.

While PM relies on the standard assumption of unconfoundedness (no hidden variables influencing both treatment and outcome), its simplicity and lack of new hyperparameters make it a robust tool for real-world causal inference. Future work includes applying PM to time-series data and exploring its performance with more complex recurrent architectures.

Summary updated

BibTeX
@misc{schwab2018perfect,
  author = {Patrick Schwab and Lorenz Linhardt and Walter Karlen},
  title = {{Perfect Match: A Simple Method for Learning Representations For Counterfactual Inference With Neural Networks}},
  year = {2018},
  eprint = {1810.00656},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1810.00656},
}
Figure