Accounting for Unobserved Confounding in Domain Generalization

1 INTRODUCTION . Prediction algorithms use data , necessarily sampled under specific conditions , to learn correlations that extrapolate to new or related data . If successful , the performance gap between these two domains is small , and we say that algorithms generalize beyond their training data . Doing so is difficult however , some form of uncertainty about the distribution of new data is unavoidable . The set of potential distributional changes that we may encounter is mostly unknown and in many cases may be large and varied . Some examples include covariate shifts ( Bickel et al. , 2009 ) , interventions in the underlying causal system ( Pearl , 2009 ) , varying levels of noise ( Fuller , 2009 ) and confounding ( Pearl , 1998 ) . All of these feature in modern applications , and while learning systems are increasingly deployed in practice , generalization of predictions and their reliability in a broad sense remains an open question . A common approach to formalize learning with uncertain data is , instead of optimizing for correlations in a fixed distribution , to do so simultaneously for a range of different distributions in an uncertainty set P ( Ben-Tal et al. , 2009 ) . minimize f sup P∈P E ( x , y ) ∼P [ L ( f ( x ) , y ) ] ( 1 ) for some measure of error L of the function f that relates input and output examples ( x , y ) ∼ P . Choosing different sets P leads to estimators with different properties . It includes as special cases , for instance , many approaches in domain adaptation , covariate shift , robust statistics and optimization ( Kuhn et al. , 2019 ; Bickel et al. , 2009 ; Duchi et al. , 2016 ; 2019 ; Sinha et al. , 2017 ; Wozabal , 2012 ; Abadeh et al. , 2015 ; Duchi & Namkoong , 2018 ) . Robust solutions to problem ( 1 ) are said to generalize if potential shifted , test distributions are contained in P , but also larger sets P result in conservative solutions ( i.e . with sub-optimal performance ) on data sampled from distribution away from worst-case scenarios , in general . One formulation of causality is in fact also a version of this problem , for P defined as any distribution arising from arbitrary interventions on observed covariates x leading to shifts in their distribution Px ( see e.g . sections 3.2 and 3.3 in ( Meinshausen , 2018 ) ) . The invariance to changes in covariate distributions of causal solutions is powerful for generalization , but implicitly assumes that all covariates or other drivers of the outcome subject to change at test time are observed . Often shifts occur elsewhere , for example in the distribution of unobserved confounders , in which case also conditional distributions Py|x may shift . Perhaps surprisingly , in the presence of unobserved confounders , the goals of achieving robustness and learning a causal model can be different ( and similar behaviour also occurs with varying measurement noise ) . There is in general an inherent trade-off in generalization performance . In the presence of unobserved confounders , causal and correlation-based solutions are both optimal in different regimes , depending on the shift in the underlying generating mechanism from which new data is generated . Consider a simple example , illustrated in Figure 1 , to show this explicitly . We assume access to observations of variables ( X1 , X2 , Y ) in two training datasets , each dataset sampled with differing variances ( σ2 = 1 and σ2 = 2 ) from the following structural model F , X2 : = −H + EX2 , Y : = X2 + 3H + EY , X1 : = Y +X2 + EX1 , EX1 , EX2 ∼ N ( 0 , σ2 ) , EY ∼ N ( 0 , 1 ) are exogenous variables . In a first scenario ( leftmost panel ) we consider all data ( training and testing ) to be generated without unobserved confounders , H : = 0 ; and , in a second scenario ( remaining panels ) all data with unobserved confounders , H : = EH ∼ N ( 0 , 1 ) . Each panel of Figure 1 shows performance on new data obtained after manipulating the underlying data generating system ; the magnitude and type of intervention appears in the horizontal axis . We consider the following learning paradigms : Ordinary Least Squares ( OLS ) learns the linear mapping that minimizes average training risk , Domain Robust Optimization ( DRO ) minimizes the maximum training risk among the two available datasets , and the causal solution , assumed known , has fixed coefficients ( 0 , 1 ) for ( X1 , X2 ) . Two important observations motivate this paper . First , observe that Ordinary Least Squares ( OLS ) and Domain Robust Optimization ( DRO ) absorb spurious correlations ( due toH , and the fact thatX1 is caused by Y ) with unstable performance under shifts in p ( X1 , X2 ) but as a consequence good performance under shifts in p ( H ) . Causal solutions , by contrast , are robust to shifts in p ( X1 , X2 ) , even on new data with large shifts , but underperform substantially under changes in the distribution of unobserved confounders p ( H ) . Second , the presence of unobserved confounding hurts generalization performance in general with higher errors for all methods , e.g . contrast the middle and leftmost panel . To the best of our knowledge , the influence of unobserved confounders has been minimally explored in the context of generalization of learning algorithms , even though , as Figure 1 shows , in this context different shifts in distribution may have important consequences for predictive performance . Our Contributions . In this paper we provide a new choice of P and learning problem ( 1 ) that we show to be justified by certain statistical invariances across training and testing data , to be expected in the presence of unobserved confounders . This leads us to define a new differentiable , regularized objective for representation learning . Our proposal defines P as an affine combination of available training data distributions , and we show that solutions to this problem are robust to more general shifts in distribution than previously considered , spanning robustness to shifts in observed , unobserved , and target variables , depending on the properties of the available training data distributions . This approach has benefits for performance out-of-sample but also for tasks involving variable selection , where important features are consistently replicated across experiments with our objective . 2 INVARIANCES IN THE PRESENCE OF UNOBSERVED CONFOUNDERS . This section formally introduces the problem of out-of-distribution generalization . We describe in greater detail the reasons that popular learning principles , such as Empirical Risk Minimization ( ERM ) , underperform in general , and define certain invariances to recover solutions that generalize . We take the perspective that all potential distributions that may be observed over a system of variables arise from a causal modelM = ( F , V , U ) , characterized by endogenous variables , V ∈ V , representing all variables determined by the system , either observed or not ; exogenous variables , U ∈ U , in contrast imposed upon the model , and a sequence of structural equations F : U → V , describing how endogenous variables can be ( deterministically ) obtained from the exogenous variables ( Pearl , 2009 ) . An example is given in Figure 1 , V = ( X1 , X2 , H , Y ) are endogenous and U = ( EX1 , EX2 , EH , EY ) are exogenous variables . Unseen data is generated from such a systemM after manipulating the distribution of exogenous variables U , which propagates across the system shifting the joint distribution of all variables V , whether observed or unobserved , but keeping the causal mechanisms F unchanged . Representative examples include changes in data collection conditions , such as due to different measurement devices , or new data sources , such as patients in different hospitals or countries , among many others . Our goal is to learn a representation Z = φ ( X ) acting on a set observed variables X ⊂ V with the ability to extrapolate to new unseen data , and doing so acknowledging that all relevant variables in V are likely not observed . Unobserved confounders ( for the task at hand , say predicting Y ∈ V ) simultaneously cause X and Y , confounding or biasing the causal association between X and Y giving rise to spurious correlations that do not reproduce in general ( Pearl , 1998 ; 2009 ) . We present a brief argument below highlighting the systematic bias due to unobserved confounders in ERM . 2.1 THE BIASES OF UNOBSERVED CONFOUNDING . Consider the following structural equation for observed variables ( X , Y ) , Y : = f ◦ φ ( X ) + E ( 2 ) where f : = f ( · ; β0 ) is a predictor acting on a representation Z : = φ ( X ) and E stands for potential sources of mispecification and unexplained sources of variability . For a given sample of data ( x , y ) and z = φ ( x ) , the optimal prediction rule β̂ is often taken to minimize squared residuals , with β̂ the solution to the normal equations : ∇βf ( z ; β̂ ) y = ∇βf ( z ; β̂ ) f ( z ; β̂ ) , where ∇βf ( z ; β̂ ) denotes the column vector of gradients of f with respect to parameters β evaluated at β̂ . Consider the Taylor expansion of f ( z ; β0 ) around an estimate β̂ sufficiently close to β0 , f ( z ; β0 ) ≈ f ( z ; β̂ ) + ∇βf ( z ; β̂ ) T ( β0 − β̂ ) . Using this approximation in our first order optimality condition we find , ∇βf ( z ; β̂ ) ∇βf ( z ; β̂ ) T ( β0 − β̂ ) + v = ∇βf ( z ; β̂ ) ( 3 ) where v is a scaled disturbance term that includes the rest of the linear approximation of f and is small asymptotically ; : = y − f ( z ; β̂ ) is the residual . β̂ is consistent for the true β0 if and only if ∇βf ( z ; β̂ ) → 0 in probability . This assumption is satisfied if E ( all sources of variation in Y not captured by X ) are independent of X ( i.e . exogenous ) or in other words if all common causes or confounders to both X and Y have been observed . Conventional regression may assign significant associations to variables that are neither directly nor indirectly related to the outcome , and in this case , we have no performance guarantees on new data with changes in the distribution of these variables . Omitted variables are a common source of unobserved confounding but we note in Appendix B that similar biases also arise from other prevalent model mispecifications , such as measurement error ( Carroll et al. , 2006 ) . 2.2 INVARIANCES WITH MULTIPLE ENVIRONMENTS . The underlying structural mechanism F , that also relates unobserved with observed variables , even if unknown , is stable irrespective of manipulations in exogenous variables that may give rise to heterogeneous data sources . Under certain conditions , statistical footprints emerge from this structural invariance across different data sources , properties testable from data that have been exploited recently , for example ( Peters et al. , 2016 ; Ghassami et al. , 2017 ; Rothenhäusler et al. , 2019 ) . We assume that such a heterogeneous data scenario applies , input and output pairs ( X , Y ) are observed across heterogeneous data sources or environments e , defined as a probability distribution Pe over an observation space X × Y that arises , just like new unseen data , from manipulations in the distribution of exogenous variables in an underlying modelM . For the remainder of this section , consider restricting ourselves to data sources emerging from manipulations in exogenous EX , appearing in the structural equations of X only in an underlying additive noise model ( see Appendix C.1 for the precise statement of assumptions and more context ) . It may be shown by considering the distributions of error terms Y −f ◦φ ( X ) and its correlation with any function of X , that the inner product∇βf ( z ; β0 ) , even if non-zero due to unobserved confounding , converges to a fixed unknown value equal across training environments ( see Appendix C.1 for the derivation ) . With a similar decomposition to the one given in equation ( 3 ) , in the population case , it holds that up to disturbance terms , ( E ( x , y ) ∼Pi ∇βf ( z ; β ? ) ∇βf ( z ; β ? ) T − E ( x , y ) ∼Pj ∇βf ( z ; β ? ) ∇βf ( z ; β ? ) ) T ( β0 − β ? ) = ( E ( x , y ) ∼Pi ∇βf ( z ; β ? ) − E ( x , y ) ∼Pj ∇βf ( z ; β ? ) ) = 0 ( 4 ) where β ? is a solution to , E ( x , y ) ∼Pi ∇βf ( z ; β ) ( y − f ( z ; β ) ) − E ( x , y ) ∼Pj ∇βf ( z ; β ) ( y − f ( z ; β ) ) = 0 . ( 5 ) and is consistent for the causal parameters β0 if unique . i , j ∈ E are the indices of any two observed environments in an index set E . This invariance across environments must hold for causal parameters ( under certain conditions ) even in the presence of unobserved confounders . A few remarks are necessary concerning this relationship and its extrapolation properties . • The first is based on the observation that , up to a constant , each inner product in ( 5 ) is the gradient of the squared error with respect to β . This reveals that the optimal predictor , in the presence of unobserved confounding , is not one that produces minimum loss but one that produces a non-zero loss gradient equal across environments . Seeking minimum error solutions , even in the population case , produces estimators with necessarily unstable correlations because the variability due to unobserved confounders is not explainable from observed data . Forcing gradients to be zero then forces models to utilize artifacts of the specific data collection process that are not related to the input-output relationship ; and , for this reason , will not in general perform outside training data . • From ( 5 ) we may pose a sequence of moment conditions for each pair of available environments . We may then seek solutions β that make all of them small simultaneously . Solutions are unique if the set of moments is sufficient to identify β ? exactly ( and given our model assumptions may be interpreted as causal and robust to certain interventions ) . We revisit our introductory example to show in Appendix A that , in contrast to ERM and Invariant Risk Minimization ( IRM ) ( a related approach proposed in ( Arjovsky et al. , 2019 ) we discuss in more detail in later sections ) , this procedure does recover the underlying causal model correctly in the presence of unobserved confounding . • In practice however , only a set of solutions may be identified with no performance guarantees for any individual solutions , and no guarantees if assumptions fail to hold . Moreover , even if accessible , causal solutions , robust to certain distribution shifts , may not always be desirable under more general shifts ( recall for instance the experiments in the rightmost panel of Figure 1 ) .

Summary: This paper proposes a new regularizer that can be plugged in gradient-based learning algorithms, which aims at solving the problems induced by unobserved confounders. And the authors provide the upper bound for one specific kind of distributionally robust optimization problem, whose uncertainty set is defined as the affine combinations of training distributions. And based on this the algorithm is proposed to deal with the problem of unobserved confounders. Experiments on three medical datasets validate the effectiveness of the method.