SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Intuitively, suppose we generate pseudo-labels  $\widehat{Y}$  based on feature  $X_{S}$  and train a model to predict  $\widehat{Y}$  using feature  $X_{U}$ . For complementary  $X_{S}$  and  $X_{U}$ , Eq. (4.3) shows how to transform this into a prediction of the true label  $Y$ , correcting for differences between  $\widehat{Y}$  and  $Y$ . Crucially, given the conditional distribution  $P_{Y|X_S}$  and observations of  $X_{S}$ , we can estimate class-wise pseudo-label accuracies  $\epsilon_0$  and  $\epsilon_1$  in Eq. (4.3) even without new labels  $Y$  (see App. A.1, Eq. (A.2)). Finally, Eq. (4.4) shows how to weight predictions based on  $X_{S}$  and  $X_{U}$ , justifying the combination function
$$
C _ {p} \left(p _ {S}, p _ {U}\right) = \sigma (\operatorname {l o g i t} \left(p _ {S}\right) + \operatorname {l o g i t} \left(p _ {U}\right) - \operatorname {l o g i t} (p)) \tag {4.5}
$$
in Eq. (3.1), where  $p = \operatorname*{Pr}[Y = 1]$  is a constant independent of  $x_{S}$  and  $x_{U}$ . We now sketch the proof of Thm. 4.4, elucidating the roles of informativeness and complementarity (full proof in App. A.1).
Proof Sketch of Thm. 4.4. We prove Eq. (4.2), Eq. (4.3), and Eq. (4.4) in order.
Proof of Eq. (4.2): The informativeness condition (iii) is equivalent to the pseudo-labels having predictive accuracy above random chance; formally, App. A.1 shows:
Lemma 4.5.  $\epsilon_0 + \epsilon_1 > 1$  if and only if  $X_{S}$  is informative of  $Y$  (i.e.,  $X_{S} \not\perp Y$ ).
Together with Eq. (4.3), it follows that any dependence between  $X_S$  and  $Y$  allows us to fully learn the relationship between  $X_U$  and  $Y$ , affirmatively answering our question from § 3: Can the student outperform the teacher? While a stronger relationship between  $X_S$  and  $Y$  is still helpful, it only improves the (unlabeled) sample complexity of learning  $P_{Y|X_U}$  and not consistency (Thm. 4.6 below), mirroring related results in the literature on learning from noisy labels [44, 7]. In particular, a weak relationship corresponds to  $\epsilon_0 + \epsilon_1 \approx 1$ , increasing the variance of the bias-correction in Eq. (4.3). With a bit more work, one can formalize this intuition to show that our approach has a relative statistical efficiency of  $\epsilon_0 + \epsilon_1 - 1 \in [0,1]$ , compared to using true labels  $Y$ .
Proof of Eq. (4.3): The key observation behind the bias-correction (Eq. (4.3)) is that, due to complementarity  $(X_S \perp X_U|Y)$  and the fact that the pseudo-label  $\widehat{Y}$  depends only on  $X_S$ ,  $\widehat{Y}$  is conditionally independent of  $X_U$  given the true label  $Y$  ( $\widehat{Y} \perp X_U|Y$ ); formally:
$$
\begin{array}{l} \Pr [ \widehat {Y} = 1 | X _ {U} ] = \Pr [ \widehat {Y} = 1 | Y = 0, X _ {U} ] \Pr [ Y = 0 | X _ {U} ] \\ + \Pr [ \widehat {Y} = 1 | Y = 1, X _ {U} ] \Pr [ Y = 1 | X _ {U} ] \quad (\text {L a w o f T o t a l P r o b a b i l i t y}) \\ = \Pr [ \widehat {Y} = 1 | Y = 0 ] \Pr [ Y = 0 | X _ {U} ] \\ + \Pr [ \widehat {Y} = 1 | Y = 1 ] \Pr [ Y = 1 | X _ {U} ] \quad (\text {C o m p l e m e n t a r i t y}) \\ = \left(\epsilon_ {0} + \epsilon_ {1} - 1\right) \Pr [ Y = 1 | X _ {U} ] + 1 - \epsilon_ {0}. \quad \text {(D e f i n i t i o n s o f} \epsilon_ {0} \text {a n d} \epsilon_ {1}) \\ \end{array}
$$
3Our stochastic pseudo-labels differ from hard  $(\widehat{Y} = 1\{\mathrm{Pr}[Y = 1|X_S] > 1 / 2\})$  pseudo-labels often used in practice [20, 36, 52]. By capturing irreducible error in  $Y$ , stochastic pseudo-labels ensure  $\mathrm{Pr}[Y|X_U]$  is well-calibrated, allowing us to combine  $\mathrm{Pr}[Y|X_S]$  and  $\mathrm{Pr}[Y|X_U]$  in Eq. (4.4).
Algorithm 1: Bias-corrected adaptation procedure. Multi-class version given by Algorithm 2.
Input: Calibrated stable classifier  $f_{S}(x_{S}) = \operatorname{Pr}[Y = 1|X_{S} = x_{S}]$ , unlabelled data  $\{(X_{S,i},X_{U,i})\}_{i = 1}^{n}$   
Output: Joint classifier  $\widehat{f} (x_S,x_U)$  estimating  $\operatorname*{Pr}[Y = 1|X_S = x_S,X_U = x_U]$   
1 Compute soft pseudo-labels (PLs)  $\{\widehat{Y}_i\}_{i = 1}^n$  with  $\widehat{Y}_i = f_S(X_{S,i})$   
2 Compute soft class-1 count  $n_1 = \sum_{i = 1}^{n}\widehat{Y}_i$   
3 Estimate PL accuracies  $(\widehat{\epsilon}_0,\widehat{\epsilon}_1) = \left(\frac{1}{n - n_1}\sum_{i = 1}^{n}(1 - \widehat{Y}_i)(1 - f_S(X_{S,i})),\frac{1}{n_1}\sum_{i = 1}^{n}\widehat{Y}_if_S(X_{S,i})\right)$  // Eq. (4.1)  
4 Fit unstable classifier  $\widetilde{f}_U(x_U)$  to pseudo-labelled data  $\{(X_{U,i},\widehat{Y}_i)\}_{i = 1}^n$  //  $\approx \operatorname*{Pr}[\widehat{Y} = 1|X_U = x_U]$   
5 Bias-correct  $\widehat{f}_U(x_U)\mapsto \max \left\{0,\min \left\{1,\frac{\widetilde{f}_U(x_U) + \widehat{\epsilon}_0 - 1}{\widehat{\epsilon}_0 + \widehat{\epsilon}_1 - 1}\right\} \right\}$  // Eq. (4.3),  $\approx \operatorname*{Pr}[Y = 1|X_U = x_U]$   
6 return  $\widehat{f} (x_S,x_U)\mapsto C_{\frac{n_1}{n}}(f_S(x_S),\widehat{f}_U(x_U))$  // Eq. (4.4)/(4.5),  $\approx \operatorname*{Pr}[Y = 1|X_S = x_S,X_U = x_U]$
Here, complementarity allowed us to approximate the unknown  $\operatorname*{Pr}[\widehat{Y} = 1|Y = 0,X_U]$  by its average  $\operatorname*{Pr}[\widehat{Y} = 1|Y = 0] = \mathbb{E}_{X_U}[\operatorname*{Pr}[\widehat{Y} = 1|Y = 0,X_U]]$ , which depends only on the known distribution  $P_{X_S,Y}$ . By informativeness, Lemma 4.5 allows us to divide by  $\epsilon_0 + \epsilon_1 - 1$ , giving Eq. (4.3).
Proof of Eq. (4.4): While the exact proof of Eq. (4.4) is a bit more algebraically involved, the key idea is simply that complementarity allows us to decompose  $\operatorname*{Pr}[Y|X_S,X_U]$  into separately-estimatable terms  $\operatorname*{Pr}[Y|X_S]$  and  $\operatorname*{Pr}[Y|X_U]$ : for any  $y\in \mathcal{V}$ ,
$$
\begin{array}{l} \Pr \left[ Y = y \mid X _ {S}, X _ {U} \right] \propto_ {X _ {S}, X _ {U}} \Pr \left[ X _ {S}, X _ {U} \mid Y = y \right] \Pr \left[ Y = y \right] \tag {Bayes' Rule} \\ = \Pr \left[ X _ {S} \mid Y = y \right] \Pr \left[ X _ {U} \mid Y = 1 \right] \Pr \left[ Y = y \right] \quad (\text {C o m p l e m e n t a r i t y}) \\ \propto_ {X _ {S}, X _ {U}} \frac {\Pr [ Y = y \mid X _ {S} ] \Pr [ Y = 1 \mid X _ {U} ]}{\Pr [ Y = 1 ]}, \quad \text {(B a y e s ’ R u l e)} \\ \end{array}
$$
where,  $\propto_{X_S,X_U}$  denotes proportionality with a constant depending only on  $X_{S}$  and  $X_{U}$ , not on  $y$ . Directly estimating these constants involves estimating the density of  $(X_S,X_U)$ , which may be intractable without further assumptions. However, in the binary case, since  $1 - \operatorname*{Pr}[Y = 1|X_S,X_U] = \operatorname*{Pr}[Y = 0|X_S,X_U]$ , these proportionality constants conveniently cancel out when the above relationship is written in logit-space, as in Eq. (4.4). In the multi-class case, App. C shows how to use the constraint  $\sum_{y\in \mathcal{Y}}\operatorname*{Pr}[Y = y|X_S,X_U] = 1$  to avoid computing the proportionality constants.
4.2 A provably consistent algorithm for unsupervised test-domain adaptation
Having learned  $P_{Y|X_S}$  from the training domain(s), Thm. 4.4 implies we can learn  $P_{Y|X_S,X_U}$  in the test domain by learning  $P_{X_S,X_U}$  — the latter only requiring unlabeled test-domain data. This motivates our Alg. 1 for test-domain adaptation, which is a finite-sample version of the bias-correction and combination equations (Eqs. (4.3) and (4.4)) in Thm. 4.4. Alg. 1 comes with the following guarantee:
Theorem 4.6 (Consistency Guarantee, Informal). Assume (i)  $X_{S}$  is stable, (ii)  $X_{S}$  and  $X_{U}$  are complementary, and (iii)  $X_{S}$  is informative of  $Y$  in the test domain. As  $n\to \infty$ , if  $\widetilde{f}_U\rightarrow \operatorname *{Pr}[\widehat{Y} = 1|X_U]$  then  $\widehat{f}\rightarrow \operatorname *{Pr}[Y = 1|X_S,X_U]$ .
In words, as the amount of unlabeled data from the test domain increases, if the unstable classifier on Line 4 of Alg. 1 learns to predict the pseudo-label  $\widehat{Y}$ , then the joint classifier output by Alg. 1 learns to predict the true label  $Y$ . Convergence in Thm. 4.6 occurs  $P_{X_S,X_U}$ -a.e., both weakly (in prob.) and strongly (a.s.), depending on the convergence of  $\widetilde{f}_U$ . Formal statements and proofs are in Appendix B.
5 Algorithm: Stable Feature Boosting (SFB)
Using theoretical insights from § 4, we now propose Stable Feature Boosting (SFB): an algorithm for safely harnessing unstable features without test-domain labels. We first describe learning a stable predictor and extracting complementary unstable features from the training domains. We then describe how to use these with Alg. 1, adapting our use of the unstable features to the test domain.
Training domains: Learning stable and complementary features. Using the notation of Eq. (3.1), our goal on the training domains is to learn stable and unstable features  $\Phi_S$  and  $\Phi_U$ , a stable predictor  $f_S$ , and domain-specific unstable predictors  $f_U^e$  such that:
1.  $f_{S}$  is stable, informative, and calibrated (i.e.,  $f_{S}(x_{S}) = \operatorname{Pr}[Y = 1 | X_{S} = x_{S}]$ ).
2. In domain  $e$ ,  $f_U^e$  boosts  $f_s$ 's performance with complementary  $\Phi_U(X^e) \perp \Phi_S(X^e)|Y^e$ .
To achieve these learning goals, we propose the following objective:
$$
\begin{array}{l} \min  _ {\Phi_ {S}, \Phi_ {U}, h _ {S}, h _ {U} ^ {e}} \sum_ {e \in \mathcal {E} _ {\mathrm {t r}}} R ^ {e} \left(h _ {S} \circ \Phi_ {S}\right) + R ^ {e} \left(C \left(h _ {S} \circ \Phi_ {S}, h _ {U} ^ {e} \circ \Phi_ {U}\right)\right) \tag {5.1} \\ + \lambda_ {S} \cdot P _ {\text {S t a b i l i t y}} \left(\Phi_ {S}, h _ {S}, R ^ {e}\right) + \lambda_ {C} \cdot P _ {\text {C o n d I n d e p}} \left(\Phi_ {S} \left(X ^ {e}\right), \Phi_ {U} \left(X ^ {e}\right), Y ^ {e}\right) \\ \end{array}
$$
The first term encourages good stable predictions  $f_{S}(X) = h_{S}(\Phi_{S}(X))$  while the second encourages improved domain-specific joint predictions  $f^{e}(X^{e}) = C(h_{S}(\Phi_{S}(X^{e})),h_{U}^{e}(\Phi_{U}(X^{e})))$  via a domain-specific use  $h_U^e$  of the unstable features  $\Phi_U(X^e)$ . For binary  $Y$ , the combination function  $C$  takes the simplified form of Eq. (4.5). Otherwise,  $C$  takes the more general form of Eq. (C.1).  $P_{\mathrm{Stability}}$  is a penalty encouraging stability while  $P_{\mathrm{CondIndep}}$  is a penalty encouraging complementarity or conditional independence, i.e.,  $\Phi_U(X^e)\perp \Phi_S(X^e)|Y^e$ . Several approaches exist for enforcing stability [1, 35, 58, 47, 15, 67, 40, 77] (e.g., IRM [1]) and conditional independence (e.g., conditional HSIC [22]).  $\lambda_S\in [0,\infty)$  and  $\lambda_C\in [0,\infty)$  are regularization hyperparameters. While another hyperparameter  $\gamma \in [0,1]$  could control the relative weighting of stable and joint risks, i.e.,  $\gamma R^{e}(h_{S}\circ \Phi_{S})$  and  $(1 - \gamma)R^{e}(C(h_{S}\circ \Phi_{S},h_{U}^{e}\circ \Phi_{U}))$ , we found this unnecessary in practice. Finally, note that, in principle,  $h_U^e$  could take any form and we could learn completely separate  $\Phi_S,\Phi_U$ . In practice, we simply take  $h_U^e$  to be a linear classifier and split the output of a shared  $\Phi (X) = (\Phi_S(X),\Phi_U(X))$ .
Post-hoc calibration. As noted in § 4.2, the stable predictor  $f_{S}$  must be properly calibrated to (i) form unbiased unstable predictions (Line 5 of Alg. 1) and (ii) correctly combine the stable and unstable predictions (Line 6 of Alg. 1). Thus, after optimizing the objective (5.1), we apply a post-processing step (e.g., temperature scaling [25]) to calibrate  $f_{S}$ .
Test-domain adaptation without labels. Given a stable predictor  $f_{S} = h_{S} \circ \Phi_{S}$  and complementary features  $\Phi_U(X)$ , we now adapt the unstable classifier  $h_{U}^{e}$  in the test domain to safely harness (or make optimal use of)  $\Phi_U(X)$ . To do so, we use the bias-corrected adaptation algorithm of Alg. 1 (or Alg. 2 for the multi-class case) which takes as input the stable classifier  $h_{S}^{4}$  and unlabelled test-domain data  $\{\Phi_S(x_i), \Phi_U(x_i)\}_{i=1}^{n_e}$ , outputting a joint classifier adapted to the test domain.
We now evaluate the performance of our algorithm on synthetic and real-world datasets requiring out-of-distribution generalization. App. E contains full details on these datasets and a depiction of their samples (see Fig. 4). In the experiments below, SFB uses IRM [1] for  $P_{\mathrm{Stability}}$  and the conditional-independence proxy of Jiang and Veitch [31, §3.1] for  $P_{\mathrm{CondIndep}}$ , with App. F.1.2 giving results with other stability penalties. App. F contains further results, including ablation studies (F.1.1) and results on additional datasets (F.2). In particular, App. F.2 contains results on the Camelyon17 medical dataset [3] from the WILDS package [33], where we find that all methods perform similarly when properly tuned (see discussion in App. F.2). Code is available at: https://github.com/cianeastwood/sfb.
Synthetic data. We consider two synthetic datasets: anti-causal (AC) data and cause-effect data with direct  $X_{S} - X_{U}$  dependence (CE-DD). AC data satisfies the structural equations
$$
Y \leftarrow \operatorname {R a d} (0. 5);
$$
$$
X _ {S} \leftarrow Y \cdot \operatorname {R a d} (0. 7 5);
$$
$$
X _ {U} \leftarrow Y \cdot \operatorname {R a d} \left(\beta_ {e}\right),
$$
where the input  $X = (X_S, X_U)$  and  $\operatorname{Rad}(\beta)$  denotes a Rademacher random variable that
<sup>4</sup>Note: while Sections 3 and 5 use  $h$  for the classifier and  $f = h \circ \Phi$  for the classifier-representation composition, Section 4 and Alg. 1 use  $f$  for the classifier, since no representation  $\Phi$  is being learned.
Table 2: Synthetic & PACS test-domain accuracies over 100 & 5 seeds each.
Algorithm	Synthetic	PACS
AC	CE-DD	P	A	C	S
ERM	9.9 ± 0.1	11.6 ± 0.7	93.0 ± 0.7	79.3 ± 0.5	74.3 ± 0.7	65.4 ± 1.5
ERM + PL	9.9 ± 0.1	11.6 ± 0.7	93.7 ± 0.4	79.6 ± 1.5	74.1 ± 1.2	63.1 ± 3.1
IRM [1]	74.9 ± 0.1	69.6 ± 1.3	93.3 ± 0.3	78.7 ± 0.7	75.4 ± 1.5	65.6 ± 2.5
IRM + PL	74.9 ± 0.1	69.6 ± 1.3	94.1 ± 0.7	78.9 ± 2.9	75.1 ± 4.6	62.9 ± 4.9
ACTIR [31]	74.8 ± 0.4	43.5 ± 2.6	94.8 ± 0.1	82.5 ± 0.4	76.6 ± 0.6	62.1 ± 1.3
SFB no adpt.	74.7 ± 1.2	74.9 ± 3.6	93.7 ± 0.6	78.1 ± 1.1	73.7 ± 0.6	69.7 ± 2.3
SFB	89.2 ± 2.9	88.6 ± 1.4	95.8 ± 0.6	80.4 ± 1.3	76.6 ± 0.6	71.8 ± 2.0
Table 3: CMNIST test accuracies over 10 seeds.
Algorithm	Test Acc.
ERM	27.9 ± 1.5
IRM [1]	69.7 ± 0.9
SFB no adpt.	70.6 ± 1.8
SFB	88.1 ± 1.8
Oracle no adpt.	72.1 ± 0.7
Oracle	89.9 ± 0.1
Figure 2: CMNIST accuracies (y-axis) over test domains of decreasing color-label correlation (x-axis). Empirical versions of Fig. 1b. Left: SFB vs. baseline methods. Right: Ablations showing SFB without (w/o) bias correction (BC), calibration (CA) and multiple pseudo-labeling rounds (Rn). Numerical results in Table 7 of App. F.1.3.
is  $-1$  with probability  $1 - \beta$  and  $+1$  with probability  $\beta$ . Following [31, §6.1], we create two training domains with  $\beta_{e} \in \{0.95, 0.7\}$ , one validation domain with  $\beta_{e} = 0.6$  and one test domain with  $\beta_{e} = 0.1$ . CE-DD data is generated according to the structural equations
$$
X _ {S} \leftarrow \operatorname {B e r n} (0. 5);
$$
$$
Y \leftarrow \operatorname {X O R} \left(X _ {S}, \operatorname {B e r n} (0. 7 5)\right);
$$
$$
X _ {U} \leftarrow \operatorname {X O R} \left(\operatorname {X O R} \left(Y, \operatorname {B e r n} \left(\beta_ {e}\right)\right), X _ {S}\right),
$$
where  $\operatorname{Bern}(\beta)$  denotes a Bernoulli random variable that is 1 with probability  $\beta$  and 0 with probability  $1 - \beta$ . Note that  $X_{S} \nsubseteq X_{U}|Y$ , since  $X_{S}$  directly influences  $X_{U}$ . Following [31, App. B], we create two training domains with  $\beta_{e} \in \{0.95, 0.8\}$ , one validation domain with  $\beta_{e} = 0.2$ , and one test domain with  $\beta_{e} = 0.1$ . For both datasets, the idea is that, during training, prediction based on the stable  $X_{S}$  results in lower accuracy ( $75\%$ ) than prediction based on the unstable  $X_{U}$ . Thus, models optimizing for prediction accuracy only—and not stability—will use  $X_{U}$  and ultimately end up with only  $10\%$  in the test domain. Importantly, while the stable predictor achieves  $75\%$  accuracy in the test domain, this can be improved to  $90\%$  if  $X_{U}$  is used correctly. Following [31], we use a simple 3-layer network for both datasets and choose hyperparameters using the validation-domain performance: see App. G.2 for further implementation details.
On the AC dataset, Table 2 shows that ERM performs poorly as it misuses  $X_U$ , while IRM, ACTIR, and SFB-no-adpt. do well by using only  $X_S$ . Critically, only SFB (with adaptation) is able to harness  $X_U$  in the test domain without labels, leading to a near-optimal performance boost.
On the CE-DD dataset, Table 2 again shows that ERM performs poorly while IRM and SFB-no-adpt. do well by using only the stable  $X_{S}$ . However, we now see that ACTIR performs poorly since its assumption of anti-causal structure no longer holds. This highlights another key advantage of SFB over ACTIR: any stability penalty can be used, including those with weaker assumptions than ACTIR's anti-causal structure (e.g., IRM). Perhaps more surprisingly, SFB (with adaptation) performs well despite the complementarity assumption  $X_{S} \perp X_{U}|Y$  being violated. One explanation for this is that complementarity is only weakly violated in the test domain. Another is that complementarity is not necessary for SFB, with some weaker, yet-to-be-determined condition(s) sufficing. In App. I, we provide a more detailed explanation and discussion of this observation.
ColorMNIST. We now consider the ColorMNIST dataset [1], described in § 1 and Fig. 1a. We follow the experimental setup of Eastwood et al. [15, §6.1]; see App. G.3 for details. Table 3 shows that: (i) SFB learns a stable predictor ("no adpt.") with performance comparable to other stable/invariant
methods like IRM [1]; and (ii) only SFB (with adaptation) is capable of harnessing the spurious color feature in the test domain without labels, leading to a near-optimal boost in performance. Note that "Oracle no adapt." refers to an ERM model trained on grayscale images, while "Oracle" refers to an ERM model trained on labeled test-domain data. Table 6 of App. F.1.3 compares to additional baseline methods, including V-REx [35], EQRM [15], Fishr [48] and more. Fig. 2 gives more insight by showing performance across test domains of varying color-label correlation. On the left, we see that SFB outperforms ERM and IRM, as well as additional adaptive baseline methods in IRM + pseudo-labeling (PL, [36]) and IRM + T3A [30] (see App. G.1 for details). On the right, ablations show that: (i) bias-correction (BC), post-hoc calibration (CA), and multiple rounds of pseudo-labeling (Rn) improve adaptation performance; and (ii) without labels, SFB harnesses the spurious color feature near-optimally in test domains of varying color-label correlation—the original goal we set out to achieve in Fig. 1b. Further results and ablations are provided in App. F.1.
PACS. Table 2 shows that SFB's stable ("no adpt.") performance is comparable to that of the other stable/invariant methods (IRM, ACTIR). One exception is the sketch domain (S)—the most severe shift based on performance drop—where SFB's stable predictor performs best. Another is on domains A and C, where ACTIR performs better than SFB's stable predictor. Most notable, however, is: (i) the consistent performance boost that SFB gets from unsupervised adaptation; and (ii) SFB performing best or joint-best on 3 of the 4 domains. These results suggest SFB can be useful on real-world datasets where it is unclear if complementarity holds. In App. I, we discuss why this may be the case.
This work demonstrated, both theoretically and practically, how to adapt our usage of spurious features to new test domains using only a stable, complementary training signal. By using invariant predictions to safely harness complementary spurious features, our proposed Stable Feature Boosting algorithm can provide significant performance gains compared to only using invariant/stable features or using unadapted spurious features—without requiring any true labels in the test domain.
Stable and calibrated predictors. Perhaps the greatest challenge in applying SFB in practice is the need for a stable and calibrated predictor. While stable features may be directly observable in some cases (e.g., using prior knowledge of causal relationships between the domain, features, and label, as in Prop. D.2), they often need to be extracted from high-dimensional observations (e.g., images). Several methods for stable-feature extraction have recently been proposed [1, 35, 58, 70, 15], with future improvements likely to benefit SFB. Calibrating complex predictors like deep neural networks is also an active area of research [18, 25, 72, 59], with future improvements likely to benefit SFB.
Weakening the complementarity condition. SFB also assumes that stable and unstable features are complementarity, i.e., conditionally independent given the label. This assumption is implicit in the causal generative models assumed by prior work [49, 68, 31], and future work may look to weaken it. However, our experimental results suggest that SFB may be robust to violations of complementarity in practice: on our synthetic data where complementarity does not hold (CE-DD) and real data where we have no reason to believe it holds (PACS), SFB still outperformed baseline methods. We discuss potential reasons for this in App. I and hope that future work can identify weaker sufficient conditions.
Exploiting newly-available test-domain features without labels. While we focused on domain generalization (DG) and the goal of (re)learning how to use the same spurious features (e.g., color) in a new way, our solution to the "marginal problem" in  $\S 4.1$  can be used to exploit a completely new set of (complementary) features in the test domain that weren't available in the training domains. For example, given a stable predictor of diabetes based on causal features (e.g., age, genetics), SFB could exploit new unlabeled data containing previously-unseen effect features (e.g., glucose levels). We hope future work can explore such uses of SFB.
The authors thank Chris Williams and Ian Mason for providing feedback on an earlier draft, as well as the MPI Tübingen causality group for helpful discussions and comments. This work was supported by the Tübingen AI Center (FKZ: 01IS18039B) and by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) under Germany's Excellence Strategy – EXC number 2064/1 – Project number 390727645. The authors declare no competing interests.