arXiv:2611.02254stat.MENov 2026

Manuscript Offprint

arXiv:2611.02254

Partial Invariance for Classification under Structural Causal Models

Austin Goddard, Yu Xiang

Abstract

Making predictions in an unseen environment from data collected across multiple training environments is challenging. This challenge is particularly pronounced when the target-generating mechanism varies across environments. In this work, we introduce environment-label separation, a form of partial environmental invariance that decomposes the target conditional distribution into an environment-invariant component and a label-invariant component. We show that this partial invariance enables estimation of the target conditional distribution in an unseen environment when using labeled training data together with unlabeled test features. Within the structural causal model framework, we provide sufficient conditions for environment-label separation. Building on these conditions, we develop an algorithm, dIMP-Classifier, which jointly minimizes an estimate of the test risk and encourages invariance across environments. We further provide finite-sample guarantees that characterize the test risk in terms of deviations from invariance, estimation error, and sample complexity. Experiments on simulated data and the real-world light tunnel Causal Chamber data demonstrate that the proposed approach can perform under interventions on the target mechanism and consistently outperforms the considered standard and invariance-based baselines.

1 Introduction and Problem Formulation

It is common practice to collect observations of a set of features and response from different environments to train a model. In this setting, the joint distribution of the features and the response may vary from environment to environment, particularly from the training environment to the test environment. Such distribution shifts pose a fundamental challenge to generalization, as statistical relationships learned in the training environments need not persist in the test environment. Consider the classification of a discrete random variable YeY^e given the set of features Xe={X1e,…,Xme}X^e = \{X_1^e, \ldots, X_m^e\} for different environmental conditions indexed by the set E:=Etrain∪{etest}\mathcal{E} := \mathcal{E}_{\text{train}} \cup \{e^{\text{test}}\}, which consists of all the training environments Etrain\mathcal{E}_{\text{train}} and one test environment eteste^{\text{test}}. In the test environment, let (X^t, Y^t) := (X^e^{\text{test}}, Y^e^{\text{test}}). While we observe the variables (Xe,Ye)(X^e, Y^e) for all e∈Etraine \in \mathcal{E}_{\text{train}}, only the variable XtX^t is observed in the test environment. The goal is to make predictions on YtY^t given {(Xe,Ye):e∈Etrain}∪{Xt}\{(X^e, Y^e) : e \in \mathcal{E}_{\text{train}}\} \cup \{X^t\}. We assume that the supports of XeX^e and YeY^e do not vary with environment and are X\mathcal{X} and Y\mathcal{Y}, respectively.

One principled way to address this problem is to model distribution shifts as changes in the underlying data-generating process using structural causal models (SCMs) ([1, 2]). This perspective makes it possible to characterize which mechanisms remain stable across environments and which invariant relationships may therefore be exploited for prediction. The pioneer work of invariant causal prediction (ICP) [3] initiated a rich line of results (e.g., [4, 5, 6, 7]) following the invariance principle (also see [8, 9, 1, 10]), which requires that P(Ye∣XSe)\mathsf{P}(Y^e | X_\mathcal{S}^e) be invariant with respect to ee, where XSeX_\mathcal{S}^e denotes a subset of the random variables in XeX^e. In practical settings, requiring the entire conditional distribution of the target to remain invariant across environments can be overly restrictive, particularly when the target mechanism is subject to change. This motivates the use of weaker forms of invariance that preserve only certain components or relationships across environments while allowing the target conditional distribution itself to vary.

In this work, we introduce a form of partial environmental invariance for classification tasks where the label YeY^e is discrete and takes on values from [1:L]:={1,...,L}[1 : L] := \{1, ..., L\}. We wish to identify a classifier

h:XS→Y∈Hh: \mathcal{X}_S \to \mathcal{Y} \in \mathcal{H}, for some S⊆[1:m]S \subseteq [1:m], such that the target risk is small, where the risk for a given environment e∈Ee \in \mathcal{E} is defined as

RSe(h):=E[1h(XSe)≠Ye]=P(h(XSe)≠Ye).(1)\mathsf{R}_{S}^{e}(h):=\mathsf{E}[\mathbf{1}_{h(X_{S}^{e})\neq Y^{e}}]=\mathsf{P}(h(X_{S}^{e})\neq Y^{e}). \tag{1}

The target risk (i.e., the risk for environment eteste^{\text{test}}) of a classifier hh is denoted by RSt(h)\mathsf{R}_S^t(h). Without further assumptions on the relationship between environments, there is no guarantee that the risk of any classifier constructed using training data from various environments will be close to that of horacle:=arg⁡min⁡h∈HRSt(h)h^{\text{oracle}} := \arg\min_{h \in \mathcal{H}} \mathsf{R}_S^t(h). In an attempt to remedy this, our objective is to identify consistent relationships between all environments such that we can successfully minimize the risk over the test environment. For this to be possible, we consider a form of partial environmental invariance in which the probability of YeY^e given XSeX_S^e can be separated into environmentally variant and invariant components. We call it environment-label separation or EY-separation for short.

Definition 1 (EY-Separation). For all (x,y)∈X×Y(x,y) \in \mathcal{X} \times \mathcal{Y} and e∈Ee \in \mathcal{E}, if there exist S⊆[1:m]S \subseteq [1:m], ψe:XS→W\psi^e : \mathcal{X}_S \to \mathcal{W}, and ρy:XS×W→[0,1]\rho_y : \mathcal{X}_S \times \mathcal{W} \to [0,1], such that P(Ye=y∣XSe=x)\mathsf{P}(Y^e = y \mid X_S^e = x) admits the following factorization,

P(Ye=y∣XSe=x)=ρy⏟invariant to e(x,ψe(x)⏟varying with e),(2)\mathsf{P}(Y^{e}=y\mid X_{S}^{e}=x)=\underbrace{\rho_{y}}_{\text{invariant to }e}\quad(x,\underbrace{\psi^{e}(x)}_{\text{varying with }e}), \tag{2}

we say that P(Ye=y∣XSe=x)\mathsf{P}(Y^{e}=y\mid X_{S}^{e}=x) is EY-separable1^{1}.

Note that ρy\rho_y is not dependent on ee and ψe\psi^e is not dependent on yy. We stress that only ψe\psi^e is allowed to change with environments, and it should not depend on yy since the label is not available in the test environment. This enables flexible domain adaptation in the test environment e=eteste = e^{\text{test}}, because ψt:=ψetest\psi^t := \psi^{e^{\text{test}}} does not rely on the test label YtY^t, making its estimation possible at test time (we will elaborate on this crucial point shortly in (3)). We thus only require partial invariance via ρy\rho_y, while keeping ψe\psi^e adaptive. This is in contrast to the existing works (e.g., [3]) that require invariance for the whole conditional distribution.

Remark 1. We note that the set SS that satisfies (2) is determined by the joint distribution of (X,Y)(X,Y). In general, the set SS is not unique, meaning that various SS can induce representations that permit EY-separation. We give examples of such settings in Section 2 and present specific sufficient conditions for SS in Condition 2 of Proposition 2.

How to make use of EY-separation? The identified EY-separable functions can lead to efficient classification in the test environment:

  1. As ρy\rho_y does not depend on ee, an estimate of ρy\rho_y trained on any (or all) training environments will extend to the test environment.

  2. As ψe\psi^e does not depend on yy, it is possible to estimate using only the test features, even though labels for the test environment are not available.

As a result, identifying EY-separable functions gives a path to estimate P(Yt∣XSt)\mathsf{P}(Y^t|X_S^t) without access to test labels. For each class label y∈[1:L]y \in [1:L], we can estimate P(Yt=y∣XSt=x)P(Y^t = y \mid X_S^t = x) in the test environment eteste^{\text{test}} using only the test features XStX_S^t as

P(Yt=y∣X^St=x)=ρy^⏟learned from Etrain(x,ψt(x)^⏟plug in test features XSt),(3)\mathsf{P}(Y^t=\widehat{y\mid X}_S^t=x)=\underbrace{\widehat{\rho_y}}_{\text{learned from } \mathcal{E}_{\text{train}}} \quad (x,\underbrace{\widehat{\psi^t(x)}}_{\text{plug in test features } X_S^t}), \tag{3}

which then leads to a natural classifier that chooses the label with the largest conditional probability.

Our main contributions are summarized as follows. We introduce a form of partial environmental invariance for classification called environment-label separation and show that it allows for estimation of the target without access to test labels. We provide sufficient conditions under the SCM framework that guarantee environment-label separation (Section 3). We then develop practical prediction and identification procedures using separable functions (Section 4) and provide finite-sample analysis of its

1^{1}We say that P(Ye=y∣XSe=x)\mathsf{P}(Y^{e}=y\mid X_{S}^{e}=x) is EY-separable and that ρy\rho_{y} and ψe\psi^{e} are EY-separable functions interchangeably, both referring to the factorization in Definition 1.

performance (Section 4.1). Finally, in Section 5, we evaluate the proposed approach on both simulated data and the real-world light tunnel Causal Chamber benchmark [11], a physically grounded optical system in which controlled interventions induce distribution shifts across environments. We show that the proposed method consistently outperforms the considered baselines, including existing invariant prediction approaches.

References (48)