In a randomized controlled trial, the "gold standard" for science, we assign treatments by the flip of a coin. This ensures that the group receiving a drug and the group receiving a placebo are, on average, identical. Any difference in their outcomes can be confidently attributed to the drug itself.
In the real world, however, we usually have to rely on observational data. Doctors give treatments to patients they believe will benefit; marketers send coupons to customers most likely to churn. This creates selection bias: the treated and control groups are fundamentally different before the treatment even begins. If we simply train a model to predict outcomes from this data, the model will conflate the effect of the treatment with the pre-existing differences between the groups.
Causal Inference as Domain Adaptation
To solve this, researchers like Fredrik Johansson, Uri Shalit, and David Sontag reframed causal inference as a domain adaptation problem. In Learning Representations for Counterfactual Inference, they argue that the "treated" and "control" groups can be viewed as two different distributions (or domains).
The goal is to learn a latent representation—a transformation of the input features—where these two distributions become indistinguishable. If a neural network can no longer tell whether a data point came from the treated or control group based on its representation, then the selection bias has been "washed away." In this balanced latent space, the model can finally learn the true causal effect.
The Balancing Act: Integral Probability Metrics
The core mechanism for achieving this balance is a regularization term added to the model's loss function. This term penalizes the "distance" between the distributions of the treated and control groups in the learned representation space.
Commonly, researchers use Integral Probability Metrics (IPMs) to quantify this distance:
- Maximum Mean Discrepancy (MMD): Used by Sheng Li in Matching on Balanced Nonlinear Representations for Treatment Effects Estimation to align groups for more reliable nearest-neighbor matching.
- Wasserstein Distance: Employed by Ruocheng Guo in Learning Individual Causal Effects from Networked Observational Data to handle complex, high-dimensional data where groups might not overlap well in the original feature space.
- Energy Distance: Utilized by Kan Chen and colleagues in Covariate-Balancing-Aware Interpretable Deep Learning models for Treatment Effect Estimation to provide tighter mathematical bounds on estimation bias.
The intuition is a trade-off: the model wants to minimize prediction error (to be accurate) while also minimizing the IPM (to be unbiased). If the model only cares about accuracy, it will exploit the selection bias. If it only cares about balancing, it might throw away useful information. The "sweet spot" is a representation that retains enough information to predict the outcome but discards the information that identifies which group a person belongs to.
Expanding the Scope
While early work focused on binary treatments (Yes/No), the field has rapidly expanded to more complex scenarios:
- Continuous Dosages: Models like DoseSurv, developed by Moritz Gögl and Tingting Zhu, apply representation balancing to continuous treatments (like drug dosage) to predict personalized survival outcomes in DoseSurv: Predicting Personalized Survival Outcomes under Continuous-Valued Treatments.
- Networked Data: When individuals are connected (e.g., social networks), treatments can have "spillover effects." Wei Chen and Ruichu Cai use IPMs in Causal Effect Estimation under Networked Interference without Networked Unconfoundedness Assumption to ensure latent features are invariant to treatment even when interference exists.
- Survival Analysis: Estimating effects over time is difficult because "high-risk" individuals drop out of the data early. Alicia Curth and Mihaela van der Schaar address this in SurvITE: Learning Heterogeneous Treatment Effects from Time-to-Event Data by using Wasserstein distance to align the "at-risk" population with the original baseline.
Why It Works
Representation balancing works because it forces the neural network to find invariant features. In a biased dataset, some features are "spurious"—they correlate with the outcome only because they correlate with who gets the treatment. By penalizing the model for being able to distinguish between treatment groups, we effectively tell the model: "If you use a feature to predict the outcome, that feature must look the same for both the treated and the control."
This forces the model to ignore the quirks of the historical assignment policy and focus on the underlying causal mechanisms that are consistent across the entire population. As Serge Assaad and Fan Li demonstrate in Counterfactual Representation Learning with Balancing Weights, combining these learned representations with traditional statistical weights can lead to even more robust and doubly-protected causal estimates.