Learning Weighted Representations for Generalization Across Designs

Fredrik Johansson, Nathan Kallus, Uri Shalit, David SontagarXiv 2018 · DOI

Abstract

Predictive models that generalize well under distributional shift are often desirable and sometimes crucial to building robust and reliable machine learning applications. We focus on distributional shift that arises in causal inference from observational data and in unsupervised domain adaptation. We pose both of these problems as prediction under a shift in design. Popular methods for overcoming distributional shift make unrealistic assumptions such as having a well-specified model or knowing the policy that gave rise to the observed data. Other methods are hindered by their need for a pre-specified metric for comparing observations, or by poor asymptotic properties. We devise a bound on the generalization error under design shift, incorporating both representation learning and sample re-weighting. Based on the bound, we propose an algorithmic framework that does not require any of the above assumptions and which is asymptotically consistent. We empirically study the new framework using two synthetic datasets, and demonstrate its effectiveness compared to previous methods.

Introduction: Addressing Design Shift

In many real-world scenarios, randomized controlled trials are impractical or impossible. Researchers must instead rely on observational data, where treatment assignment is often biased. For instance, in healthcare, doctors prescribe medication based on patient needs rather than at random. This creates a distributional shift where the treated population differs significantly from the control group.

The authors define these challenges as design shift, which encompasses two primary factors:

  1. Shift in Policy: Changes in the rule for choosing actions or treatments.
  2. Shift in Domain: Changes in underlying population characteristics (e.g., applying models trained on data from one hospital to another).

Existing solutions typically choose between two extremes: re-weighting data to match the target distribution (which often suffers from high variance) or learning "invariant representations" (which may discard predictive information).

Methodology: Re-weighted CounterFactual Regression (RCFR)

The proposed framework seeks a middle ground by jointly learning a representation ($\Phi$) and a weighting function ($w$). This approach is grounded in a new generalization error bound, where target task error is bounded by the weighted source error plus a measure of distributional difference in the representation space. This difference is quantified using Integral Probability Metrics (IPM), such as Maximum Mean Discrepancy (MMD) or Wasserstein distance.

The RCFR framework jointly learns a representation $\Phi$, a hypothesis $h$, and a weighting function $w$.

The resulting algorithm, RCFR, employs an alternating optimization procedure:

  1. Predictor and Representation Update: The network is trained to minimize weighted loss and group imbalance.
  2. Weight Update: The weighting function $w$ is adjusted to align source and target distributions while maintaining stability.

By learning weights as a function of the representation, the model prioritizes balancing features relevant to the outcome, effectively ignoring background noise.

Experimental Evaluation

The framework was rigorously tested on two benchmarks:

  • Synthetic Domain Adaptation: A controlled 10-dimensional Gaussian experiment used to compare learned weights against ground-truth importance sampling weights.
  • Infant Health and Development Program (IHDP): A standard semi-synthetic benchmark for causal inference. It utilizes real randomized experiment data with synthesized outcomes to calculate true counterfactual errors.

Key Results and Insights

The RCFR framework demonstrated several advantages over traditional methods:

  • Robustness to Small Samples: In synthetic tests, RCFR significantly outperformed exact Importance Sampling (IS) when data was scarce. While IS weights often lead to high variance, RCFR's learned weights provide a smoother, more reliable signal.
  • State-of-the-Art Performance: On the IHDP dataset, RCFR achieved the lowest error in predicting Conditional Average Treatment Effects (CATE) compared to established methods like Causal Forests and BART.
Performance comparison on the IHDP dataset showing RCFR achieving state-of-the-art results.
  • Predictive Balancing: By operating in the representation space, the model avoids wasting effort balancing features that do not contribute to the prediction.
  • Asymptotic Consistency: Unlike some biased representation learning methods, RCFR is proven to converge to the true risk as sample size increases.

Conclusion and Future Directions

While RCFR offers a robust solution for design shift, it introduces optimization complexities due to its non-convex nature. Future work may explore enforcing representation invertibility more strictly or integrating variable selection to handle high-dimensional sparsity. Nevertheless, the joint learning of weights and representations represents a significant step toward more reliable causal inference and domain adaptation.

Summary updated

BibTeX
@misc{johansson2018learning,
  author = {Fredrik Johansson and Nathan Kallus and Uri Shalit and David Sontag},
  title = {{Learning Weighted Representations for Generalization Across Designs}},
  year = {2018},
  eprint = {1802.08598},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1802.08598},
}
Figure