Regularizing towards Causal Invariance: Linear Models with Proxies

Michael Oberst, Nikolaj Thams, Jonas Peters, David Sontag

TL;DR

This paper introduces a regularization method to train linear models that remain robust against dataset shifts caused by interventions on unobserved variables. By leveraging two noisy proxies of the hidden variable during training, the proposed "Cross-Proxy Anchor Regression" method recovers the exact robustness guarantees as if the hidden variable were perfectly observed.

What Problem Does This Paper Address?

Standard machine learning models assume that training and test data are drawn from the exact same distribution. When deployed in the real world, this assumption frequently fails due to "dataset shift," causing models to rely on unstable, spurious correlations that break down in new environments.

"Anchor Regression" is a recent technique designed to mitigate this by optimizing for the worst-case performance under bounded causal interventions on an "anchor" variable ($A$) that drives the distribution shift. However, standard Anchor Regression requires this anchor variable to be perfectly observed during training. In practice, the true drivers of domain shifts—such as socioeconomic status in medical data or shifting climate patterns in environmental data—are often unobserved or hidden, leaving us with only noisy, imperfect measurements (proxies). This paper addresses how to guarantee distributional robustness when the anchor variables are fundamentally unobserved.

Methods

The authors extend Anchor Regression to handle unobserved anchors by utilizing proxy variables. They analyze two main scenarios based on proxy availability:

  1. Proxy Anchor Regression (PAR): This approach uses a single noisy proxy ($W$). The authors show that while a single proxy can successfully identify absolute invariance (robustness to infinitely strong interventions), it provides a strictly weaker guarantee for bounded shifts. This is because the measurement noise shrinks the guaranteed robustness set in an unidentifiable way.
  2. Cross-Proxy Anchor Regression (xPAR): To overcome the limitations of a single proxy, the authors assume access to two distinct noisy proxies ($W$ and $Z$) of the unobserved anchor $A$ (as illustrated in the causal graph below). They introduce a novel "cross-proxy" regularization term: $$\ell_{\times}(W, Z; \gamma) := \mathbb{E}[R(\gamma)W^\top]\mathbb{E}[ZW^\top]^{-1}\mathbb{E}[ZR(\gamma)^\top]$$ where $R(\gamma)$ is the model residual. They mathematically prove that this cross-proxy term cancels out the measurement noise, perfectly recovering the population robustness guarantees of having observed the true anchor $A$.
Figure 2. In contrast to Rothenh¨ausler et al. (2021), we assume that anchor variables (denoted A) are unobserved, but that we have access to either one or two proxies W, Z. Observed variables are shown in dark grey and unobserved variables in light grey. We do not assume knowledge of the causal structure between A, X, H, Y (except that A has no causal parents). The relationship between X, H, Y could be cyclic, but all relationships are linear.

Additionally, the authors introduce Targeted Anchor Regression (TAR) and its proxy variant (xPTAR). This allows practitioners to incorporate prior knowledge about specific test-time shifts (e.g., a known shift in the mean or variance of the anchor), rather than optimizing against a generic, symmetric uncertainty set centered around the training data.

Datasets

The authors evaluate their methods using both simulated and real-world data:

  • Synthetic Datasets: Data generated from linear Structural Causal Models (SCMs) to precisely control and evaluate the impact of varying proxy noise levels (signal-to-variance ratios).
  • Real-World Pollution Dataset: A dataset consisting of hourly PM2.5 air pollution concentrations and weather features across five major cities in China. The authors treat temperature as the unobserved anchor variable, constructing noisy proxies for training. They evaluate the model's robustness to dataset shift by holding out entire seasons (e.g., training on Spring, Summer, and Autumn, then testing on Winter).

Key Insights and Ideas

  • The Single-Proxy Blindspot: If your goal is absolute invariance, one proxy is enough. However, forcing absolute invariance often severely damages predictive accuracy. If you want to optimize for bounded shifts to balance performance and robustness, a single proxy fails because you cannot distinguish true data variance from measurement noise.
  • The Power of Two Proxies: By introducing a second proxy, you do not need to identify the exact noise level. The cross-covariance between the two proxies acts similarly to an instrumental variable, allowing the regularization objective to bypass the unidentifiability of the noise.
  • Targeted Robustness Over Blind Invariance: Total invariance is often an over-correction. If you have prior knowledge about how the test distribution will shift (e.g., seasonal temperature changes), targeting the regularization envelope to that specific shift preserves significantly more predictive performance.

Key Results

  • Synthetic Validation: In simulation experiments, xPAR perfectly matched the performance of standard Anchor Regression across all proxy noise levels. In contrast, the single-proxy PAR degraded toward standard Ordinary Least Squares (OLS) as the proxy noise increased.
Figure 5. Mean squared prediction error (MSPE) under interven- tions do(A := ν) for estimators PAR and xPAR. We display population losses for the population parameters as dashed lines, and median empirical MSPE when fit from data as solid lines, with shaded regions covering the 25% to 75% quantiles.
  • Real-World Performance: On the Chinese pollution dataset across 20 seasonal shift scenarios, the targeted proxy method (PTAR) consistently outperformed standard OLS. PTAR reduced the overall average Mean Squared Error (MSE) from 0.457 to 0.450 while showing virtually no downside in worst-case environments.

Limitations and Future Work

  • Linearity Assumptions: The theoretical guarantees in this work rely strictly on linear structural causal models and linear predictors. Extending proxy-based causal regularization to non-linear models or neural network embeddings remains an open challenge.
  • Independent Noise: The cross-proxy method assumes that the measurement errors of the two proxies are mutually independent. If the proxies share correlated noise, the mathematical cancellation trick breaks down.
  • Proxy Requirements: Finding two distinct, valid proxies for an unobserved confounding factor may not always be feasible in standard tabular datasets.

Summary updated

BibTeX
@inproceedings{oberst2021regularizing,
  author = {Michael Oberst and Nikolaj Thams and Jonas Peters and David Sontag},
  title = {{Regularizing towards Causal Invariance: Linear Models with Proxies}},
  booktitle = {International Conference on Machine Learning},
  year = {2021},
  url = {https://openreview.net/forum?id=yuNks3tomjl},
}
Figure