Mind the Graph When Balancing Data for Fairness or Robustness

Authors: jessica  schrouff
google  deepmind
alexis  bellot
amal  rannen-triki
alan  malek
arthur gretton google
deepmind  gatsby
alexander  d'amour
silvia  chiappa
Venue: NeurIPS_cc_2024_Conference
Published: 2024-05-09 16:28:49

Abstract: Failures of fairness or robustness in machine learning predictive settings can be due to undesired dependencies between covariates, outcomes and auxiliary factors of variation. A common strategy to mitigate these failures is data balancing, which attempts to remove those undesired dependencies. In this work, we define conditions on the training distribution for data balancing to lead to fair or robust models. Our results display that in many cases, the balanced distribution does not correspond to selectively removing the undesired dependencies in a causal graph of the task, leading to multiple failure modes and even interference with other mitigation techniques such as regularization. Overall, our results highlight the importance of taking the causal graph into account before performing data balancing.

Main paper: 
 introduction: 
 When training prediction models, practitioners often desire that the model's outputs display safety properties in addition to high performance, such as being fair across demographic subgroups [29, 51] or being robust to distribution shifts [e.g. 19, 59] . These objectives can be difficult to attain if there are undesired dependencies between covariates X, labels Y , and auxiliary factors of variation Z, such as confounding factors or hidden stratification [26, 27] . A commonly referenced example is that of an animal classification task from wildlife pictures [e.g. 64]: the model might identify patterns in the background of the images that are indicative of the type of animal (e.g. the presence of snow for polar bears or grass for cows), which might lead to the model failing to recognize the same animal when it is on another background. When the auxiliary factors relate to demographic attributes, the deployment of such models can have societal implications, e.g. patients not being assigned medical resources due to factors related to race [54] .Multiple mitigation strategies have been proposed to remove undesired dependencies pre-, in-or post-processing. Amongst them, balancing the training data is typically considered a straightforward approach and has been used or researched in various settings [e.g. 37, 39, 60, 8, 33, 40, 2] . This approach modifies the training distribution, indicated with P t (X, Y, Z), into a new, balanced distribution (which we refer to as Q(X, Y, Z)) that aims to approximate an 'idealized' training distribution in which the undesired dependencies are absent [48, 14, 77] . Models are then trained on this balanced distribution to attain different fairness or robustness criteria. A popular approach to construct a balanced distribution is by balancing classes (resp. groups), leading to a uniform distribution over Y (resp. Z). While successful for addressing failures of robustness [e.g. 33] or of fairness due to under-representation of certain groups [e.g. 75], this approach does not induce independence between Y and Z. To approximate independence, a 'joint' balancing on (Y, Z) is often performed [e.g. 48, 8] . Joint balancing can be implemented by matching the numbers of samples in all (y, z) groups (only feasible when Y and Z have small, discrete domains) via subsampling the majority groups [e.g. 8], upsampling the minority groups [e.g. 63], resampling the data with weights proportional to P t (Y )P t (Z)/P t (Y, Z), or reweighting the loss [9] . Our work focuses on joint balancing given its suitability to mitigate a marginal dependence between Y and Z. 1 While the choice of the method for jointly balancing can impact the results [11, 65, 33] , these methods can be all seen as modifying P t as described in Definition 1.1. Definition 1.1 (Jointly balanced distribution). We say that the distribution Q(X, Y, Z) is a jointly balanced version of P t (X, Y, Z) if Q(X, Y, Z) = P t (X, Y, Z) P t (Y )P t (Z) P t (Y,Z) .In some cases, data balancing has proven to be an effective mitigation strategy for undesired dependencies, performing on-par with other, more complex mitigation techniques [33] . Recently, data balancing has also shown promises for mitigation during fine-tuning or partial retraining [41, 44, 49, 79, 75] , which is relevant to the settings of training large-scale models and with large amounts of data. Nevertheless, data balancing has also displayed failure modes in which the obtained models were not fair, robust or optimal [76, 48, 58, 2] . These failure modes have not been thoroughly characterized and can be difficult to predict. Furthermore, the impact of data balancing on other mitigation strategies has not been studied extensively.Given data balancing's popularity as a baseline mitigation strategy for undesired dependencies, we aim to formalize some of its promises and pitfalls. Our analysis relies on a causal graphical framework, which allows investigating the impact of data balancing in different data generating processes. Our contributions can be summarized as follows: (1) we display failure modes of data balancing in semi-synthetic tasks and highlight how predicting these failures can be challenging; (2) we introduce conditions for data balancing to attain invariance to undesired dependencies as defined by fairness or robustness criteria; (3) we prove that data balancing does not correspond to 'removing' undesired dependencies from a causal perspective, and can negatively impact fairness or robustness criteria when combined with regularization strategies; and (4) we illustrate how our findings can be used to distinguish between failure modes and identify next steps. 
preliminaries: 
 Let X, Y , Z be discrete random variables with X ∈ X corresponding to a set of covariates (e.g. tabular, images or text), Y ∈ Y to an outcome to be predicted, and Z ∈ Z to an auxiliary factor of variation, such as a sensitive attribute or the type of background of an image, that displays statistical dependence with Y . We assume access to data sampled from distribution P t (X, Y, Z), where P t is the true data-generating distribution. We consider a family of models F ∈ X → Y that will be trained on data from P t (X, Y, Z) to minimize the risk R P t (f ) := E X,Y ∼P t [ (f ; X, Y )] where is a loss function. We define f * ∈ F to be the optimal model, i.e. one where the risk attains the minimum on P t . We assume that E Q [Y |X] = f * (X), which occurs, for example, if is the square loss or cross-entropy loss. Definition 2.1 (Optimality). A prediction model f ∈ F is optimal w.r.t. P t if f = argmin f ∈F R P t (f ).Due to undesired independencies, while a model may be optimal on P t , it might not be optimal on another distribution of interest P (X, Y, Z) (e.g. in deployment), and/or might display disparities across subsets of the data (e.g. P t (X, Y | Z = z)) [22] . To mitigate this issue, multiple safety criteria have been defined in the fields of fairness and robustness.Fairness: Fairness criteria can be defined in terms of the dependence between the model's output f (X) and the auxiliary factor of variation Z. We consider established fairness criteria [5, 51] , including demographic parity [f (X) ⊥ ⊥ Z, 23], equalized odds [f (X) ⊥ ⊥ Z | Y , 29] and predictive parity [Y ⊥ ⊥ Z | f (X) , 24] . Beyond fairness of f (X), we also consider fairness of intermediate representations φ(X), e.g. φ(X) ⊥ ⊥ Z [81] , for their usage in downstream tasks.Robustness: In this field, the focus is typically on finding models f θ parameterized by θ ∈ Θ that provide the lowest risk across a family of target distributions P. For instance, the 'worst group performance' criterion aims to select parameters such that the performance on a 'worst' distribution P is optimized, i.e. θ * = min θ∈Θ {sup P ∈P R P (f θ )} [6, 20] . P can be defined so that each distribution P represents a specific subpopulation [64] , to minimize the loss in each subgroup, or aiming for an invariance of R P across subgroups [risk-invariance, 48]. Definition 2.2 (Risk-invariance). A prediction model f is risk-invariant w.r.t. a family of distributionsP if R P (f ) = R P (f ) ∀P, P ∈ P.If a model is optimal on P t and risk-invariant w.r.t. P, it is also optimal w.r.t. P. The choice of P is context-specific and reflects some domain knowledge about shifts that are likely to arise in a given application. For instance, a plausible family of target distributions could imply a shift in the dependence between Y and Z, also known as a correlation shift [62] , and be expressed asP = {P (X, Y, Z) = P t (X | Y, Z)P (Z | Y )P t (Y ), ∀P (Z | Y )}.Alternatively, we can define P using a causal framework (see Section 2.2) when the data generation process is known [48] .We acknowledge that selecting amongst those criteria is context-dependent and do not advocate for a specific choice. We call a prediction model f invariant to undesired dependencies, denoted with f ∈ F inv , if it satisfies one of such criteria. For brevity, we focus on risk-invariance in the main text and consider fairness criteria in Appendix. Obtaining an invariant model can be performed in different ways, with data balancing being a popular approach.To understand the effects of data balancing, we need to investigate its impact on the distribution P t . A causal formalization is useful for studying how distributions change under different interventions.To analyse the implications of data balancing, we use the framework of causal Bayesian networks (CBNs) [e.g. 71, 13, 52, 74, 25, 48] . A Bayesian network [55, 56, 15, 42] is a pair G, P t , in which G is a directed acyclic graph whose nodes X 1 , . . . , X D represent random variables and in which P t is a joint distribution over the nodes. The absence of edges in G implies a set of statistical independence assumptions satisfied by P t that can be expressed by the factorizationP t (X 1 , . . . , X D ) = D d=1 P t (X d | pa(X d )), where pa(X d ) denote the parents of X d , namely the nodes with an edge into X d (we say that P t factorizes according to G). A CBN is a Bayesian network in which an edge expresses causal influence, so that pa(X d ) are direct causes of X d . A directed path between X i and X j in a CBN is also called a causal path. A non-directed path, also called non-causal path, expresses statistical dependence of non-causal nature. We refer to the statistical dependence between X i and X j that arises only due to the presence of non-causal paths as purely spurious. In our settingX 1 ∪ • • • ∪ X D = X ∪ Y ∪ Z ∪ U where U are unobserved variables.Inspired by prior work [74, 3, 70, 77] , we make a decomposition assumption on the form of the covariates X. Assumption 2.3 (Decomposition of X). The covariates X can be decomposed into three unobserved random variables X ⊥ Z , X ⊥ Y and X Y ∧Z such that: 1) X ⊥ Z does not have causal paths to/from Z but has causal paths to/from Y , 2) X ⊥ Y does not have causal paths to/from Y but has causal paths to/from Z, 3) X Y ∧Z has causal paths to/from both Y and Z, representing entangled signals, and 4) X is measurable w.r.t. σ(X ⊥ Z , X ⊥ Y , X Y ∧Z ), the joint σ-algebra. In particular, there exists a functiong such that X = g(X ⊥ Z , X ⊥ Y , X Y ∧Z ) almost everywhere and P t (X ⊥ Z , X ⊥ Y , X Y ∧Z , Y, Z, U) = P t (g(X ⊥ Z , X ⊥ Y , X Y ∧Z ), Y, Z, U).In the animal classification example, X ⊥ Z would correspond to the animal pixels, X ⊥ Y to the background pixels (e.g. snowy or grassy landscape), and X Y ∧Z to characteristics of the animal that depend on its environment (e.g. color of the fur pixels in bears). Intuitively, we want to build a prediction model f that only depends on the animal pixels. While the decomposition may be readily available when a causal graph of the application is available and the data is tabular, we typically do not have direct access to the different functions of X and these need to be isolated algorithmically.Following Schölkopf et al. [66] , we consider both the case in which X ⊥ Z ∪ X Y ∧Z are direct causes of the label Y (causal task) e.g. estimating the helpfulness of a text review, and the case in which Y is a direct cause of X ⊥ Z ∪ X Y ∧Z (anti-causal task) as in object detection tasks in computer vision. Figures 1(a-b ) display examples of anti-causal and causal tasks with a purely spurious dependence Graph Data Balancing Regularization Next steps(a) U Z Y X ⊥ Z X ⊥ Y risk-invariant optimal f (X) ⊥ ⊥ Z | Y risk-invariant optimal N.A. (b) U Z Y X ⊥ Z X ⊥ Y risk-invariant optimal f (X) ⊥ ⊥ Z risk-invariant optimalUse regularization, without prior balancing (as per Section 5) (c) Z Y X ⊥ Z X ⊥ Y V U1 U2 U3 XV risk-invariant optimal f (X) ⊥ ⊥ Z | Y risk-(d) U Z Y X ⊥ Z XY ∧Z risk-invariant optimal f (X) ⊥ ⊥ Z | Y risk-invariant optimalTable 1 : Examples of causal Bayesian networks with undesired dependencies between Y and Z displayed by red edges. Light gray indicates unobserved variables. XY ∧Z = ∅ in (a-b) and there is no entanglement between Y and Z via X. In (c), we expand the system to include V ∈ U and its influence on X, which is given by XV .For each Causal Bayesian Network considered, we display when data balancing leads to a risk-invariant and/or optimal model. We compare these with regularization following Veitch et al. [74] and suggest next steps.between Y and Z. It is important to note that statistical relationships between the different variables and functions of X are determined by the graph: for instance, in Figure 1 (a) X ⊥ Z ⊥ ⊥ Z | Y , while in Figure 1(b) X ⊥ Z ⊥ ⊥ Z.Based on a CBN of the task and Assumption 2.3, we characterize undesired dependencies as the presence of undesired paths between Z and Y , which we indicate through red edges (Figure 1 ). Based on this depiction of undesired dependencies, we can define the family of target distributions P such that black edges are preserved, but those in red may lead to changes in the distribution. For the anti-causal task in Figure 1 (a), we can hence writeP = {P (Y, Z, X) = P t (Y )P (Z | Y )P t (X ⊥ Z | Y )P t (X ⊥ Y | Z)} in which P (Z | Y )represents any distribution but all other causal mechanisms are fixed [48] , which corresponds to a correlation shift.3 Can we predict when data balancing fails?As reported previously, data balancing can display failure modes, e.g. due to the presence of other confounders [76, 2] , finite sampling effects [48] or a dependence between Y and Z when conditioning on X (Y ⊥ ⊥ Z | X) [58] . However, this list is non-exhaustive and, to the best of our knowledge, there is no unifying study of those failure modes or of how they could be mitigated. In this section, we perform joint data balancing on different tasks to illustrate that successes and failures of this approach can be difficult to predict (see Table 1 ). For details of the experiments, see Appendix D.Let's first consider semi-synthetic examples generated from the graphs in Figure 1(a, b ), i.e. an anti-causal and causal task with a purely spurious correlation. We aim to obtain a risk-invariant and optimal model on these tasks by training on the jointly balanced distribution Q.Anti-causal task: number detection in MNIST. Inspired by Brown et al. [8] , we modify MNIST images [45, 17] by adding a factor of variation Z such that the top of the image is replaced by red noise for Z = 0 and blue noise for Z = 1 (Figure 1 ). We sample a dataset in which the factor of variation and label are dependent (P t (Y = 0 | Z = 0) = 0.95, P t (Y = 1 | Z = 0) = 0.10, called the 'confounded' data), a jointly balanced dataset, and a dataset from a distribution P 0 in which the undesired dependency is absent (P 0 (Z = 0 | Y ) = 0.5). We train convolutional networks to predict whether the number in an image is smaller or larger than 5, assessing the models on their training distribution and on P 0 . Table 2 : Model performance on semi-synthetic data, for the tasks in Figure 1 . 'Acc' refers to accuracy, 'Worst Grp' to worst group accuracy, 'Encoding' to confounder encoding as measured by transfer learning and 'Equ. Odds' refers to equalized odds between Z subgroups. ↑ (resp. ↓) means the higher (resp. lower), the better. Models trained with confounded data (95/10) display biased outputs (Table 2 ), with low worst group performance and high equalized odds. Performance on P 0 is also lower compared to that on P t (0.937 ± 0.002), showing that these models are not risk-invariant w.r.t. P. Models trained from balanced data obtain high overall performance and worst group accuracy, as well as low equalized odds. In addition, we were not able to decode Z from the model representation φ(X) at the penultimate layer, suggesting that the model has not learned X ⊥ Y . Causal task: helpfulness of reviews with Amazon reviews [53] . Inspired by Veitch et al. [74] , we refer to the causal task of predicting the helpfulness rating of an Amazon review (thumbs up or down, Y ) from its text (X). We add a synthetic factor of variation Z such that words like 'the' or 'my' are replaced by 'thexxxx' and 'myxxxx' (Z = 0) or 'theyyyy' and 'myyyyy' (Z = 1). We train a BERT [34] model on a class-balanced version of the data for reference (due to high class imbalance), and compare to a model trained on jointly balanced data, both evaluated on their training distribution and on a distribution P 0 with no association.In this case, jointly balancing improves fairness and risk-invariance, with the model's performance on the training distribution (acc.: 0.574 ± 0.016) being similar to that on P 0 (Table 2 ). This however comes at a high performance cost when compared to the class balanced model's performance on P t (acc: 0.658 ± 0.015). Therefore, data balancing might not lead to optimality for this causal task.Using the same framework, we can replicate the failure modes due to another confounder described in Wang et al. [76] , Alabdulmohsin et al. [2] as well as that from Puli et al. [58] .Anti-causal task with another factor of variation V . It is common for multiple auxiliary factors to influence the data generating process, and they tend to correlate with each other [e.g. 21]. To emulate this case, we introduce more unobserved variables U 2 , U 3 as well as a factor of variation V which affects the data through X V (Figure 1(c) ). We modify the MNIST data generation to include X V depicted by a green cross on the top left or top right of the image and jointly balance the data on (Y, Z) before training the model. We evaluate the obtained predictor on a distribution where V and Z are not correlated with Y and observe (Table 2 ) a large gap between worst group accuracy and overall performance, as well as non-null equalized odds. These results suggest that the model is not fair or robust.Anti-causal task with entangled data. We map the work in Puli et al. [58] to our decomposition of X and propose the example graph in Figure 1(d) where X Y ∧Z represents an entangled function of X. To match this data generating process, the color of the noise in MNIST samples is defined by OR(Y, Z) and the evaluation distribution is the disentangled P 0 with no dependence between Y and Z. Once again, the obtained model is not fair, robust or optimal (Table 2 ). Appendix A.2 discusses this case further.Motivated by these examples of both success and failures, we define conditions for the success of data balancing, and highlight when the cases above fail to meet these conditions. 
conditions for data balancing to produce an invariant and optimal model: 
 In this section, we introduce a sufficient condition on the data generative process and a necessary condition on the trained model that, taken together, lead to a risk-invariant and optimal prediction model after training on Q (proofs in Appendix B.1). In Appendix B.2, we derive similar conditions for fairness criteria. Throughout the rest of the paper, we use an subscript to indicate under which of P t or Q a statistical independence holds, e.g. Y ⊥ ⊥ P t Z to indicate P t (Y | Z) = P t (Y ).We consider the criterion of risk-invariance (Definition 2.2) under correlation shift, i.e. P = {P (X, Y, X) = P t (X|Y, Z)P (Z|Y )P t (Y )}. According to our decomposition of X, the risk-minimizing function f (X) := E Q [Y | X] should only be a function of X ⊥ Z and not of X ⊥ Y or X Y ∧Z .To achieve this result with data balancing, we build on a prior result by Makar et al. [48] , which shows that a model trained on a balanced distribution only depends onX ⊥ Z if X ⊥ Z represents a sufficient statistic for Y , i.e. no other part of X influences Y . Definition 4.1. (Sufficient Statistic) We say that X ⊥ Z is a sufficient statistic for Y in Q if E Q [Y | X] = E Q [Y | X ⊥ Z ] (note that X ⊥ Z is a function of X).Definition 4.1 implies that the risk-minimizing function f for Q does not vary with X ⊥ Y , X Y ∧Z . However, this condition is not sufficient on its own to ensure that f is risk-invariant w.r.t. P, as X ⊥ Z or Y may have non-causal relationships with Z. To ensure optimality and risk-invariance w.r.t. P, we derive the sufficient condition in Proposition 4.2.Proposition 4.2. If X ⊥ Z ⊥ ⊥ Q Z | Y and X ⊥ Z is a sufficient statistic for Y in Q, then the risk-minimizer f (X) := E Q [Y | X]is risk-invariant and optimal w.r.t. P.The conditions of Proposition 4.2 concern Q. However, it would be of interest to express them in P t if it is possible to observe all covariates (e.g. in the case of tabular data). Based on our expression for Q, we can derive sufficient conditions on P t , expressed in Corollary 4.3. Let's denote {X ⊥ Y , X Y ∧Z } by R. Corollary 4.3. If R ⊥ ⊥ P t {Y, X ⊥ Z } | Z and X ⊥ Z ⊥ ⊥ P t Z | Y , then the risk-minimizer f (X) := E Q [Y | X]is risk-invariant and optimal w.r.t. P.In general, we can expect that anti-causal tasks with purely spurious correlations will satisfy these conditions, as per their definition. However, this would not be the case for most causal tasks asX ⊥ Z ⊥ ⊥ P t Z | Y .This result is in line with our findings in Section 3, as the MNIST data generated from the graph in Figure 1 It may be less obvious, but the conditions for a sufficient statistic are not met in Figures 1(c, d ) asX V ⊥ ⊥ P t {Y, X ⊥Z } | Z in the case of another factor of variation V , and X Y ∧Z ⊥ ⊥ P t {Y, X ⊥ Z } | Z in the case of entangled data. We hence see that when a causal graph of the application is available, Corollary 4.3 can provide indicators on when data balancing might succeed or fail, with the caveat that it is not a necessary condition. While Proposition 4.2 and Corollary 4.3 provide conditions on the data generating process, prior work [e.g. 10, 31] has demonstrated that the learning strategy also influences the model's fairness and robustness characteristics. Proposition 4.4. Let f ∈ F be some fitted model and > 0. Assume that, for all P , P ∈ P, we haveE P [Y | f (X, Y )] -E P [Y | X ⊥ Z ] ≤ 2 . Then f is -risk invariant, meaning that sup P ,P ∈P R P ( f ) -R P ( f ) ≤ .Proposition 4.4 states that the learned function f needs to be nearly optimal over P. This statement, while straightforward, implies that (i) f (X) needs to preserve all the information about the expectation of Y in X ⊥ Z , and that (ii) f (X) changes with X ⊥ Y or X Y ∧Z only marginally. Let's rewrite f (X) = h(φ(X)), where h is 'simple' function and φ(X) is a model representation. This case could correspond to the last layers of a neural network or when learning a model based on a representation φ(X) (e.g. embeddings, transfer learning). Based on Proposition 4.4, φ(X) must be disentangled in the sense that the simple function h eliminates any dependence on X ⊥ Y or X Y ∧Z . For example, if h is a linear function, it must be possible to linearly project out all dependence on X ⊥ Y and X Y ∧Z . We note that such a representation can be obtained even if the data is entangled, e.g. by dropping modes of variation during training. Unlike other strategies [4, 48, 58] , data balancing cannot enforce this property on its own and a disentangled representation would be necessary. This condition hence suggests another failure mode of data balancing when the conditions on the data are validated, but the representation is of low quality. We believe this failure mode is displayed in Kirichenko et al. [41] , as the success of their data balancing mitigation only holds when using models pre-trained on large datasets.In this section, we have identified conditions for data balancing to be successful. In the next section, we go one step further to understand how data balancing impacts the data generating process, and how it interacts with other mitigation strategies for undesired dependencies, focusing on regularization. 
impact of data balancing on the cbn: 
 Joint data balancing is assumed to remove statistical dependence between Y and Z while keeping other relationships in the CBN of the task unaffected [e.g. 48, 77, 14] . This could be interpreted as 'dropping' edges in the undesired paths in G, e.g. removing the influence of U on Y and/or Z in Figure 1 (a), leading to a new graph G 0 . While this interpretation is correct for joint balancing in the case of Figure 1 (a), Proposition 5.1 below (proof in Appendix C) shows that it can be erroneous in general: the distribution Q underlying the balanced data might not factorize according to G 0 and therefore might not obey the statistical dependence relationships implied by G 0 . Therefore, balancing data to make Z and Y statistically independent, i.e. selecting samples in proportion to P t (Z)P t (Y )/P t (Z, Y ), is not equivalent to generating data from a distribution that factorises according to G 0 in general. This factorization is important because downstream distributions P (X, Y, Z) are often assumed to follow this factorization; in fact, this assumption underlies a number recommendations for applying regularization methodologies such as in [74] . Proposition 5.1. Let G, P t be the CBN underlying the data, where G contains an undesired path between Z and Y , and let G 0 be a modification of G in which the undesired path has been removed. The distribution Q obtained by jointly balancing the data need not factorize according to G 0 . Proposition 5.1 shows that statistical (in)dependencies that we assumed would remain fixed (i.e. the black edges on the graph) can be modified by the process of joint balancing. As a consequence, further interventions on Q (e.g. the addition of a regularizer) should not be motivated by G 0 , and we show below that combining data balancing with other mitigation strategies can lead to unexpected results.When confronted with a failure mode, it is reasonable to ask whether an additional fairness or robustness regularizer on the training loss might be beneficial. Based on Proposition 5.1, we see that this question might have a different answer if we are in P t or in Q. Below, we consider each failure mode and ask whether performing an additional regularization motivated by the literature would mitigate the undesired dependencies in Q. The results are summarized in Table 1 , with suggested next steps. In Appendix C.1.2, we discuss when balancing with regularization is sufficient for different fairness criteria.Anti-causal task. In the case of an anti-causal task with a dependence between Y and Z (Figures 1(a, c, d )), Veitch et al. [74] recommend to impose an independence between f (X) and Z conditioned on Y . If we consider both the purely spurious correlation and the entangled case, we see that regularization and data balancing would have the same effects of blocking any dependence between {Y,X ⊥ Z } and {Z, X ⊥ Y , X Y ∧Z }. We demonstrate that X ⊥ Z ⊥ ⊥ Z | Y in both P t and Q (see Appendix C.1), and this regularization is sensible under both distributions. This means that performing the regularization provides the sufficient conditions for a risk-invariant model, whether or not joint data balancing is performed. In theory, data balancing is not needed but is also not harmful. In the case of an added confounder, we have that X V depends on both Y and Z due to non-causal paths through V . Therefore, imposing that f (X) ⊥ ⊥ Q Z | Y might lead to results whereby the model only depends on V or is trivial (e.g. predicts a constant) as the regularization encourages the removal of any dependence on Z, which is related to Y via X V . This behavior would be observed in both P t and Q, but data balancing on its own might be less detrimental than regularization in terms of predictive power even though it does not resolve all undesired dependencies. In this case, regularization hinders data balancing.Based on the balanced data from Section 3, we add a conditional Maximum Mean Discrepancy [MMD, 28] to encourage f (X) ⊥ ⊥ Q Z | Y during training, varying the strength of this regularizer via a hyper-parameter. In the case of the purely spurious statistical dependence between Y and Z (Figure 1 (a)), there is little variation between the metrics across MMD strengths, and the model is fair and robust (Figure 2 (left)). In the entangled case (Figure 2 (right)), the model's performance on Q and P 0 are close for medium values of the hyper-parameter (before MMD overpowers the training) and worst group performance improves markedly. This result suggests that, with the added regularizer, f only varies with X ⊥ Z ). Performing the same regularization in the presence of another confounder (Figure 2 (middle)) leads to a plateau in performance on Q, but low performance on P 0 and chance-level worst group performance. In this case, we posit that the model relies exclusively on X V for its predictions, and the regularizer is detrimental compared to data balancing on its own (MMD=0 on the plot).Causal task. Finally, let us consider the causal task in Figure 1(b) . In a similar case, Veitch et al. [74] suggests a regularizer such that f (X) ⊥ ⊥ P t Z, which would encourage the model f (X) to vary only with X ⊥ Z as X ⊥ Z ⊥ ⊥ P t Z. However, data balancing induces a dependence between X ⊥ Z and Z, as expressed below:Q(X ⊥ Z | Z) = X ⊥ Y ,Y P t (X ⊥ Z , X ⊥ Y | Z, Y )P t (Z)P t (Y ) X ⊥ Y ,X ⊥ Z ,Y P t (X ⊥ Z , X ⊥ Y | Z, Y )P t (Z)P t (Y ) = Y P t (X ⊥ Z | Z, Y )P t (Y ),The RHS cannot be simplified further because X ⊥ Z ⊥ ⊥ P t Z | Y , because Y is a collider under P t . Thus, the left hand side is a function of Z in general (see Appendix C.1 for further details and a numerical simulation). In this case, regularizing to enforce f (X) ⊥ ⊥ Q Z would destroy information in X ⊥ Z , whereas the same regularization under P t would have enabled f (X) to use all of the information in X ⊥ Z . Therefore, data balancing may hinder regularization. We illustrate this result on the Amazon reviews dataset from Section 3 by imposing a marginal MMD regularization f (X) ⊥ ⊥ Z during training and evaluating risk-invariance across multiple P ∈ P.When training on P t , we observe that the regularization allows to 'flatten' the curve, such that from medium to high values of MMD regularization, the model is risk-invariant (Figure 3 (a)). On the jointly balanced data, medium values of the regularization degrade risk-invariance (see green curves on Figure 3(b) ). Overall, model performance is also lower for the models trained on Q compared to models trained on P t across test sets from P ∈ P, at similar levels of regularization (see Figure 3 (c) for MMD=16). This result displays that X ⊥ Z is not a sufficient statistic for Y in Q.6 Case study: distinguishing between failure modes in CelebAIn this section, we show that when Y and Z are available at training time, we can try to distinguish between failure modes of data balancing by using our different observations, even in the absence of a full causal graph. We illustrate this using the benchmark task of detecting blond hair in pictures of celebrities in the CelebA [46] dataset. This label has a strong correlation with perceived gender: half of the non-males have blond hair, while only ∼ 7% of males do. We consider a balanced, subsampled dataset (train: n = 4, 096, test/valid: n = 400) and the original, confounded dataset. We train a VGG [68] and four Vision Transformer [ViT, 18] architectures, with number of parameters ranging from 17 to 690 millions.We observe that, while training with balanced data leads to higher worst group accuracy and lower equalized odds scores than training with the historical data (Table 3 ), an important gap remains between the overall and worst group performances. These results show that data balancing leads to improvements in downstream fairness and robustness metrics, but does not provide a risk-invariant or fair model on its own. Therefore, it is likely that one of the conditions for data balancing to be sufficient is not fulfilled and understanding which condition is violated can guide our selection of another technique.Distinguishing between failure modes. We first assume that the task is anti-causal. We then aim to understand whether there is another confounder, the data is entangled, or the representation is entangled (Proposition 4.4). As per Kirichenko et al. [41] , we first attempt to improve our representation by pre-training the VGG with ImageNet [16] . While we observe an increase in performance with pre-training, there is no clear decrease in equalized odds. This result suggests that the failure may lie elsewhere. We then train models with MMD on P t , with the expectation that we would observe a plateau for entangled data when the model learns f (X ⊥ Z ), or a stark decrease in worst group performance in the presence of another confounder. While there is no major pattern of correlation between Y and another attribute in the balanced data (see Appendix E.2.2), small effects might combine, or there might be other, unobserved attributes that influence Y . For a medium value of the regularization hyper-parameter, the model displays a plateau in performance and poor worst group performance. This result suggests an effect of another confounder and next steps can include methods such as Alabdulmohsin et al. [2] , which controls for all (observed) auxiliary factors of variation. 
related works: 
 Balanced data as mitigation for invariant models. Our results extend those of Makar et al. [48] which considered a single causal graph. Wang et al. [76] displayed that balancing data did not lead to a reduction in bias amplification. The authors posit that this failure of balanced data to correct for spurious signals is due to unobserved confounding factors which is confirmed in Alabdulmohsin et al. [2] . Rolf et al. [63] investigated upsampling by relying on a scaling law per group, focusing on the question of fairness vs performance trade-off [22] . Focusing on causal NLP settings, Joshi et al. [36] investigated causal and non-causal features, concluding that data balancing does not help in all cases. Closer to our work is that of Puli et al. [58] , in which the authors showed that having Y ⊥ ⊥ Q Z does not imply that Y ⊥ ⊥ Q Z | X and the model can learn signals related to Z. Puli et al. [58] propose a method to learn a representation r such that Y ⊥ ⊥ Z | r(X). Our work provides a framework to understand these different failure modes and proposes strategies to distinguish between them. While we focus on pre-processing mitigation with a fixed distribution Q(X, Y, Z), another line of work considers dynamic resampling in-processing [e.g. 35, 61, 12] . As the resampling converges towards a fixed distribution P (Z|Y ), we would expect failure modes in the presence of entangled data or of another confounder. Nevertheless, the variation in P (Z|Y ) at the early stages of training might be beneficial, e.g. by disentangling the representation. We leave this investigation for future work.Causal feature selection. Some works have used a causal framing to select features such that f (X) has robustness and/or fairness properties [e.g. 47, 71, 69, 25, 67, 38] . Similarly, our work defines independence conditions on covariates to obtain an optimal, invariant model, and can be used to select features. Two major distinctions between feature selection works and ours reside in the fact that we consider the case in which we do not observe X ⊥ Z explicitly and that we investigate the impact of data balancing. 
discussion: 
 In this work, we uncover important results to guide the use of data balancing for mitigating undesired dependencies between covariates, outcomes and auxiliary factors of variation. We first show (Section 3) that joint data balancing might not achieve the desired fairness or robustness criteria, and that the failures may seem difficult to predict. Motivated by these results, we introduce conditions under which data balancing leads to a robust or fair model (Sections 4, B.2). Importantly, we show that data balancing is not equivalent to 'dropping an edge' in the causal graph and can lead to distributions that do not factorize according to the desired graph (Section 5). This can have downstream consequences if further mitigation strategies are motivated by the causal graph and highlights why regularization and data balancing might not go 'hand in hand'. This last result shows that data balancing should not be performed as a 'default', and mitigation strategies should be based on the causal graph of the application. Finally, even in the absence of a causal graph, our findings may help to pinpoint which condition(s) are not fulfilled, and guide further mitigation (Section 6).Limitations. The conditions defined in Section 4 for risk-invariance depend on the expression of P as a correlation shift [48, 62] . Other expressions or shifts are likely to lead to other conditions. In our experiments, we have mostly subsampled datasets to obtain balanced distributions. We would expect similar results for other joint balancing methods. Variations are, however, possible due to the finite-set nature of the computations [48] , e.g. with reweighting displaying more variance [33] , potentially under-performing in overparametrized settings [11, 65] . We also note that, while we aimed to provide upper bounds for the effectiveness of data balancing, we did not use additional training strategies for mitigation beyond regularization. We believe that our causal framework can be a useful tool to analyze other pre-or in-processing methods that enforce independence between variables in the data generating process [e.g. 1, 58] . On the other hand, our framework might not be suited to analyze the effects of other mitigation strategies, e.g. hyper-parameter optimization [57] . We discuss the broader societal impacts of our work in Appendix E.2.2.Future work. This work considered a variety of causal graphs in order to provide general insights rather than task-specific conditions. However, investigating specific graphs could enable to leverage further strategies including other balancing techniques [e.g. 38, 72] . We believe that our causal framing could then be a useful resource to analyze the effect of these strategies on downstream fairness and robustness criteria. Finally, we illustrate our propositions with binary classification tasks and confounders. While our reasoning applies to more complex settings, there might be further considerations to account for when generalizing beyond binary variables, especially with respect to estimation. and we can conclude that the bias is worsened ifP t (Y = 1) -1 2 (E[Z | Y = 1] -E[Z | Y = 0]) < 0.Taking both statements together, we obtain the statement of the proposition.For example, if we haveP t (Y = 1) = 1 4 , E[Z | Y = 1] = 1 and E[Z | Y = 0] = 1 3 , then E[Z] = 1 2 but E[Z | S] -1 2 = 1 6; despite Z starting as unbiased, the data balancing induces a bias of 1 6 . There are a few implications of this derivation. First, we obtain an easy upper bound for the worsening of the bias of Z caused by data balancing: taking absolute values of both sizes and using the triangle inequality on the right yieldsE[Z] - 1 2 ≤ E[Z | S] - 1 2 + P t (Y = 1) - 1 2 |E[Z | Y = 1] -E[Z | Y = 0]| ,Bringing the second term over to the left hand side and applying the same logic producesE[Z | S] - 1 2 ≤ E[Z] - 1 2 + P t (Y = 1) - 1 2 |E[Z | Y = 1] -E[Z | Y = 0]| ,and combining both terms shows that the difference in bias of Z and Z | S is bounded byE[Z] - 2 -E[Z | S] - 1 2 ≤ P t (Y = 1) - 1 2 |E[Z | Y = 1] -E[Z | Y = 0]| .Simulation. We present a simple simulation to illustrate our reasoning: U ∼ N (0, 0.1) is a common cause to Z and Y . More specifically, the continuous distributions of Y and Z both have the form U + , with ∼ N (0.05, 0.02). We then binarize Y by thresholding at 0. This creates an imbalance in the marginal of Y , such that a random sample of 5,000 examples has ∼ 68% of positive labels. We then want to vary the marginal of Z, which also requires affecting their correlation. To this end, we vary the threshold for binarizing Z. This leads us to 2 main cases: for thresholds above 0 (i.e. Y 's threshold), the marginal of Z is imbalanced in the same direction as that of Y . For thresholds smaller than 0., we obtain the opposite, i.e. if Y = 1 is over-represented, Z = 1 is under-represented.We illustrate these 2 cases in Figure 5 . We observe that when the marginals are similar, balancing Y brings Z closer to a uniform distribution (top row). However, the marginal distribution of Z becomes more imbalanced after balancing on Y if the two distributions are reversed (bottom row). When the correlation is small, there is little change in the marginal of Z when balancing on Y , which is expected.For completeness, we perform 200 simulations with different thresholdings for Z and present the results in Figure 6 .In the case where X includes non-trivial intersection information X Y ∧Z , data balancing will in general be insufficient to ensure that there is no association bias. This is because a risk-minimizing predictor f (X) will condition on X Y ∧Z , and the distribution of these intersection features is influenced by Z. Specifically, we will give a case where Y is marginally independent of Z and there is no uncontrolled confounding, butE[f (X) | Z = 0] = E[f (X) | Z = 1].Suppose we have the following data generating process (DGP):P t (Y = 1) = 0.5 P t (Z = 1) = 0.5P t (Y = 1, Z = 1) = P t (Y = 1)P t (Z = 1), i.e., Y ⊥ Z P t (X = 1) = p if Y OR Z q o.w.Note that in this case the entirety of X would be classified as intersection information X Y ∧Z .In this setup, the Bayes-optimal probabilities for classification, f (X), are given by:f (1) := P t (Y = 1 | X = 1) = P t (X = 1 | Y = 1)P t (Y = 1) P t (X = 1) = p • 0.5 0.75p + 0.25q and f (0) := P t (Y = 1 | X = 0) = (1 -P t (X = 1 | Y = 1))P t (Y = 1) P t (X = 0) = (1 -p) • 0.5 1 -(0.75p + 0.25q)Note that when we condition on Z = 0, 1, the expectation of f (X) is different whenever (1) p = q, i.e., whenever the distribution of X actually depends on the function of Y and Z, and (2) f (1) = f (0), i.e., there is some information in X to predict Y :E[f (X) | Z = 1] = E[E[f (X) | X, Z = 1]] = pf (1) + (1 -p)f (0) E[f (X) | Z = 0] = E[E[f (X) | X, Z = 0]] = (0.5p + 0.5q)f (1) + (0.5(1 -p) + 0.5(1 -q))f (0)In the simple case where p = 1 and q = 0 (i.e., X = Y OR Z deterministically), we getf (X) := P t (Y = 1 | X) = 2/3 if X = 1 0 if X = 0. E[f (X) | Z] = 2/3 if Z = 1 1/3 if Z = 0.We first investigate the case of a risk-invariant model w.r.t P, and then discuss fairness criteria.In this section we provide proofs for Section 4.Recall that P = {P (X, Y, Z) = P t (X ⊥ Z |Y, Z)P t (X ⊥ Y |Y, Z)P t (X Z∧Y |Y, Z)P (Z|Y )P t (Y )} and that we assume a data balancing distribution Q(X, Y, Z) ∈ P of the form Q(X, Y, Z) = P t (X | Y, Z)P t (Z)P t (Y ). Also recall that we define X ⊥ Z to be a sufficient statistic forY in Q if E Q [Y | X] = E Q [Y | X ⊥ Z ]. Proposition 4.2. If X ⊥ Z ⊥ ⊥ Q Z | Y and X ⊥ Z is a sufficient statistic for Y in Q, then the risk-minimizer f (X) := E Q [Y | X]is risk-invariant and optimal w.r.t. P.Proof. Let P be an arbitrary distribution in P. We haveP (X ⊥ Z | Y ) = Z P (X ⊥ Z | Y, Z)P (Z | Y ) (1) = Z Q(X ⊥ Z | Y, Z)P (Z | Y ) = Q(X ⊥ Z | Y ),where (1) holds as P , Q ∈ P and by the independence assumption. AsP (Y ) = Q(Y ) we obtain P (X ⊥ Z , Y ) = Q(X ⊥ Z , Y ). As X ⊥ Z is a sufficient statistic for Y in Q, f (X) := E Q [Y | X] = E Q [Y | X ⊥ Z ], that is f (X) (and therefore the loss(f ; X, Y )) remains constant for different values of X ⊥ Y , X Y ∧Z , giving E X,Y ∼P [ (f ; X, Y )] = E X ⊥ Z ,Y ∼P [ (f ; X, Y )] = E X ⊥ Z ,Y ∼Q [ (f ; X, Y )].The same reasoning can be repeated for P∈ P, obtaining E X,Y ∼P [ (f ; X, Y )] = E X,Y ∼P [ (f ; X, Y )], which proves that f is risk-invariant w.r.t. P. As f = min f E X,Y ∼Q [ (f ; X, Y )] and E X,Y ∼P [ (f ; X, Y )] = E X,Y ∼Q [ (f ; X, Y ) ∀P ∈ P, we obtain f = min f E X,Y ∼P [ (f ; X, Y )] ,∀P ∈ P, which implies that f is optimal w.r.t. P.Corollary 4.3. Let R = {X ⊥ Y , X Y ∧Z }. If R ⊥ ⊥ P t {X ⊥ Z , Y } | Z and X ⊥ Z ⊥ ⊥ P t Z | Y , then f (X ⊥ Z ) = E Q [Y | X ⊥ Z ]is risk-invariant and optimal w.r.t. P.Proof. We haveEQUATIONEQUATION= Z P t (R |$ $ $ $ X ⊥ Z , Y , Z)P t (X ⊥ Z | Y, Z)P t (Z)P t (Y ) Z,Y P t (R |$ $ $ $ X ⊥ Z , Y , Z)P t (X ⊥ Z | Y, Z)P t (Z)P t (Y ) = P t (R)P t (X ⊥ Z | Y )P t (Y ) P t (R) Y P t (X ⊥ Z | Y )P t (Y ) = P t (Y | X ⊥ Z ), where (1) holds by the definition of the balanced distribution Q and (2) holds by the independence assumptions. This derivation shows that Y ⊥ ⊥ Q R | X ⊥ Z and therefore that X ⊥ Z is a sufficient statistic for Y in P t . We are in the same conditions as in Proposition 4.2, which implies that f is risk-invariant and optimal w.r.t. P. Proposition 4.4. Let f ∈ F be some fitted model and > 0. Assume that, for all P , P ∈ P, we haveE P [Y | f (X, Y )] -E P [Y | X ⊥ Z ] ≤ 2 .Then f is -risk invariant, meaning that supP ,P ∈P R P ( f ) -R P ( f ) ≤ .Proof. By definition, f * is risk-invariant w.r.t. P and optimal. By the triangle inequality, we can then write|R P ( f ) -R P ( f )| ≤ |R P ( f ) -R P (f * )| + |R P (f * ) -R P ( f )| ≤ |R P ( f ) -R P (f * )| + |R P (f * ) -R P ( f )| ≤ 2 + 2 .In this section, we focus on fairness definitions and provide sufficient conditions for data balancing to lead to a fair model. The results we describe do not address the case whereX ⊥ Z is not accessible directly. Proposition B.1 (Demographic parity). X ⊥ Z ⊥ ⊥ Q Z if X ⊥ Z ⊥ ⊥ P t Z | Y ; that is balancing successfully induces independence between X ⊥Z and Z if X ⊥ Z and Z are independent given Y in the original data distribution.Proof. First, note that, under the assumed conditional independences,Q(X ⊥ Z , Y, Z) = X ⊥ Y ,X Y ∧Z Q(X ⊥ Z , X ⊥ Y , X Y ∧Z , Y, Z) = X ⊥ Y ,X Y ∧Z P t (X ⊥ Z , X ⊥ Y , X Y ∧Z |Y, Z)P t (Y )P t (Z) = P t (X ⊥ Z |Y, Z)P t (Y )P t (Z) = P t (X ⊥ Z |Y )P t (Y )P t (Z), where the first equality is by applying the definition of Q and the last line follows from the assumed invariance. We can then deriveQ(X ⊥ Z | Z) = Y Q(X ⊥ Z , Y, Z) Y,X ⊥ Z Q(X ⊥ Z , Y, Z) = Y P t (X ⊥ Z |Y )P t (Y )P t (Z), Y,X ⊥ Z P t (X ⊥ Z |Y )P t (Y )P t (Z) = Y P t (X ⊥ Z | Z, Y )P t (Y ) = Y P t (X ⊥ Z | Y )P t (Y ) = P t (X ⊥ Z ).This equality implies that Q(X ⊥ Z | Z) does not depend on Z, verifying the conditional independence claim.Remark B.2. We would not expect X ⊥ Z and Z to be independent in Q if X ⊥ Z and Z are not independent given Y in P t . In the previous proof, we derivedQ(X ⊥ Z |Z) = Y P t (X ⊥ Z | Z, Y )P t (Y ).Except for some corner cases, we would expect thatP t (X ⊥ Z | Z, Y ) would not vary with Z if Q(X ⊥ Z |Z) does not. Proposition B.3 (Predictive parity). Y ⊥ ⊥ Q Z | X ⊥ Z if X ⊥ Z ⊥ ⊥ P t Z | Y ;that is, data balancing successfully induces independence between Y and Z given X ⊥ Z if X ⊥ Z and Z are independent given Y in the original data distribution. by joint balancing the data to make Z and Y statistically independent, i.e. Q(Y, X, Z) = P t (X | Y, Z)P t (Z)P t (Y ), might not factorize according to G 0 .G = {Z → X → Y, Z ← U → Y }, for unobserved U . We have Q(Y | X, Z) = Q(X, Y, Z) Y Q(X, Y, Z) = P t (X | Y, Z)P t (Z)P t (Y ) Y P t (X | Y, Z)P t (Z)P t (Y ) = P t (X | Z, Y )P t (Y ) Y P t (X | Z, Y )P t (Y ), where the r.h.s is a function of Z in general as X is not independent of Y given Z inP t . If Q were G 0 = {Z → X → Y }, then Y ⊥ ⊥ Z | X in Q.To show the claim it suffices therefore to construct a distribution P t such that X is not independent of Y given Z.Example 2: Causal task with non-causal path.Consider G = {X → Y, Z ← U → Y }. We have that, Q(X | Z) = Y Q(X, Y, Z) Y,X Q(X, Y, Z) = Y P t (X | Y, Z)P t (Z)P t (Y )) Y,X P t (X | Y, Z)P t (Z)P t (Y ) = Y P t (X | Y, Z)P t (Y ).The r.h.s is a function of Z in general as X is not independent of Z given Y in a distribution P t consistent with G. Therefore, one may not interpret the mutilated graph G 0 = {X → Y } as a correct representation of the conditional independences implied by the balanced distribution Q.Example 3: Causal task with causal path. Consider G = {Z → X → Y }. We have that,Q(Y | X, Z) = Q(X, Y, Z) Y Q(X, Y, Z) = P t (X | Y, Z)P t (Z)P t (Y ) Y P t (X | Y, Z)P t (Z)P t (Y ) = P t (X | Z, Y )P t (Y ) Y P t (X | Z, Y )P t (Y ) ,The r.h.s is a function of Z in general as X is not independent of Z given Y in P t . Therefore, one may not interpret the mutilated graph G 0 = {Z, X → Y } as a correct representation of the conditional independences implied by the balanced distribution Q.Example 4: Anti-causal task. Consider G = {Y → X, Z ← U → Y, Z → W → X}. We have that, Q(X | Z) = Y,W Q(X, Y, Z, W ) Y,X,W Q(X, Y, Z, W ) = Y,W P t (X, W | Y, Z)P t (Z)P t (Y )) Y,X,W P t (X, W | Y, Z)P t (Z)P t (Y ) = Y P t (X | Y, Z)P t (Y ).The r.h.s is a function of Z in general as X is not independent of Z given Y in a distribution P t consistent with G. Therefore, one may not interpret the mutilated graph G = {Y → X, Z → W → X} as a correct representation of the conditional independences implied by the balanced distribution Q.We first consider the graph in Figure 1 (d) and show that X ⊥ Z ⊥ ⊥ Z | Y in both Q, which justifies its use in addition to data balancing, although there might not be a benefit of using both techniques simultaneously (in theory). Proposition C.1. Consider the graph G in Figure 1(d) . Then X ⊥ Z ⊥ ⊥ Z | Y in both the training data distribution P t (consistent with G) and the distribution after balancing, namely Q.Z ⊥ ⊥ Z | Y holds in the training data distribution P t by d-separation. For the conditional independence in Q, consider the following derivation, The r.h.s is not a function of Z and thereforeQ(X ⊥ Z | Y, Z) = X Y ∧Z P t (X ⊥ Z , X Y ∧Z | Z, Y )P t (Z)P t (Y ) X Y ∧Z ,X ⊥ Z P t (X ⊥ Z , X Y ∧Z | Z, Y )P t (Z)P t (Y ) = P t (X ⊥ Z | Z, Y ) = P t (X ⊥ Z | Y ) = g(X ⊥ Z | Y )X ⊥ Z ⊥ ⊥ Z | Y holds in Q.However, when considering the graph in Figure 1 (b), we introduce a dependence between X ⊥ Z and Z, which can be easily checked by the simulation Figure 7 in which we consider the simplified graph Z → Y ← X. While we are able to obtain the marginal dependence between Y and Z (χ 2 : p = 0.34), we introduce a dependence between X and Z (χ 2 : p < 0.0001).This section gives several results to analyze the combination of data balancing implemented to generate independence between outcomes Y and sensitive attributes Z and regularization in two variants. First, regularizing to learn representationsW = φ(X ⊥ Z ) such that W ⊥ ⊥ Q Z | Y ; and second regularizing to learn representations W = φ(X ⊥ Z ) such that W ⊥ ⊥ Q Z. We write X ⊥ Z ⊥ ⊥ P t Y to state that X ⊥ Z and Y are independent in distribution P t . Regularization such that φ(X ⊥ Z ) ⊥ ⊥ Z | Y . Proposition C.2 (Demographic parity). Balancing and regularization such that W = φ(X ⊥ Z ) and W ⊥ ⊥ Q Z | Y is sufficient for demographic parity, i.e. W ⊥ ⊥ Q Z. Proof. Q(W | Z) = Y Q(W | Z, Y )Q(Y | Z) (1) = Y Q(W | Y )Q(Y ) = Q(W ),where (1) holds by the assumption of balancing in whichZ ⊥ ⊥ Q Y and regularization W ⊥ ⊥ Q Z | Y .W = φ(X ⊥ Z ) and W ⊥ ⊥ Q Z | Y is sufficient for predictive parity, i.e. Y ⊥ ⊥ Q Z | W . Proof. Q(Z | Y, W ) = Q(Z | Y ) = Q(Z),where both equalities hold by the assumption of balancing in whichZ ⊥ ⊥ Q Y and regularization W ⊥ ⊥ Q Z | Y .Proposition C.4 (Equalized odds). Balancing and regularization such that W = φ(X ⊥ Z ) andW ⊥ ⊥ Q Z | Y is sufficient for equalized odds, i.e. W ⊥ ⊥ Q Z | Y . Proof. Regularization induces W ⊥ ⊥ Q Z | Yand so equalized odds is satisfied by design.Remark: Note that balancing and regularization together are not always necessary, for example the section above shows that balancing on its own can be successful in some cases.Regularization such that φ(X ⊥ Z ) ⊥ ⊥ Z. Proposition C.5 (Demographic parity). Balancing and regularization such thatW = φ(X ⊥ Z ) and W ⊥ ⊥ Q Z is sufficient for demographic parity, i.e. W ⊥ ⊥ Q Z.Proof. Regularization induces W ⊥ ⊥ Q Z and so demographic parity is satisfied by design.W = φ(X ⊥ Z ) and W ⊥ ⊥ Q Z is not sufficient for predictive parity, i.e. Y ⊥ ⊥ Q Z | W does not hold.Proof. We give a counter-example. Let A, B, C be three independent variables with values in {0, 1}.Let X ⊥ Z = 1{A = B}, Y = 1{A = C}, Z = 1{B = C}. Let Q be a probability distribution over (X ⊥ Z , Y, Z).In particular, we could imagine Q to be generated after balancing and regularization since W ⊥ ⊥ Q Z and Y ⊥ ⊥ Q Z. However, conditioned on X ⊥ Z , Y and Z determine each other and so predictive parity does not hold in Q.Proposition C.7 (Equalized odds). Balancing and regularization such that W = φ(X ⊥ Z ) and W ⊥ ⊥ Q Z is not sufficient for equalized odds, i.e. W ⊥ ⊥ Q Z | Y does not hold.Proof. The counter-example above applies.This work uses the MNIST [45, 17, http://yann.lecun.com/exdb/mnist/], Amazon reviews [53] , ImageNet [16, https://image-net.org/] and CelebA [46, http://mmlab.ie.cuhk.edu.hk/projects/CelebA. html] datasets, which are all openly accessible and can be used for research purposes.MNIST semi-synthetic data: For simplicity, we binarize the digit recognition task to a label Y ∈ {0, 1} according to whether the number in the image is < 5 or ≥ 5 such that Y matches the ground truth with probability 0.98. The top of the image is replaced by noise coloured in red for Z = 0 and blue for Z = 1 (see Figure 1 ). We can relate the confounder and the label such that 95% (resp. 5%) of images with Y = 0 have a red (resp. blue) noise pattern, while 10% (resp. 90%) of the images with Y = 1 have a red (resp. blue) pattern, corresponding to our original distribution P t . In this distribution, the marginal distributions of Y and Z are (close to) uniform. We sample n = 30, 000 samples from P t , as well as a dataset jointly balanced on Y and Z (Q, n = 30, 000). We also sample test data based on a ground truth P 0 generated with P 0 (Z = 0|Y ) = 0.5 (n = 2, 000). Finally, we generate an X ⊥ Z dataset that contains white instead of colored noise. MNIST semi-synthetic data with added confounder: We add V and X V to our data generating process where X V is a green cross either on the left or right of the image, with a fixed vertical position. The horizontal position of the cross is given by V and V is correlated with Y (P t (V = 0|Y = 0) = 0.2, P t (V = 0|Y = 1) = 0.9). We generate a confounded dataset (95/10) as previously, which we balance jointly on Y and Z. We then train 5 replicates of the same architecture, and test our model on Q, as well as on the ground truth P 0 where P 0 (V = 0|Y = 0) = P 0 (V = 0|Y = 1) = P 0 (Z = 0|Y = 0) = P 0 (Z = 0|Y = 1) = 0.5.MNIST semi-synthetic data, entangled: We define the color of the noise based on an OR(Y, Z). We define Q by generating samples with Q(Z = 0|Y = 0) = Q(Z = 0|Y = 1) = 0.5, while P 0 is represented by the disentangled test dataset described above.Amazon reviews with confounder: We refer to Veitch et al. [74] and define a causal task based on Amazon reviews for the clothing category which predicts whether the review was found to be helpful (i.e. obtained 'thumbs up' votes) or not based on the review's text. We generate a random variable U as the unobserved confounder, and define Y as the binary helpfulness label, randomly flipping the label based on U (association: p=0.4). This leads to reviews with Y = 0 being more associated with U = 0. We define Z as Z = λ * U + (1 -λ) * U 2 , where U 2 is another random variable distributed uniformly and λ is a parameter that controls the relationship between U and Z, and by transitivity, between Z and Y . In P t , λ is selected to be 0.8, leading to a correlation of 0.35 between Y and Z.To create X ⊥ Y , we add perturbations to the text based on the value of Z that wouldn't (in theory) affect Y . We select the words {and, the, you, my, they} and add a suffix 'xxxx' (resp. 'yyyy') when Z = 0 (resp. Z = 1). Finally, Y is imbalanced, with only 5% of the dataset with Y = 1. We hence re-balance the classes before the modelling. This operation is also performed by the joint balancing.Our work focuses on statistical group fairness criteria [5] . These can be translated as independence criteria on the model's predictions. In our experiments, we estimate equalized odds as in Alabdulmohsin & Lučić [1] . For this metric, the lower, the better.EO = 0.5 * max z∈Z E X [f (X) | Z = z, Y = 0] -min z∈Z E X [f (X) | Z = z, Y = 0] + 0.5 * max z∈Z E X [f (X) | Z = z, Y = 1] -min z∈Z E X [f (X) | Z = z, Y = 1].In terms of robustness metrics, we evaluate a simplified version of risk-invariance by computing model performance on a test set sampled from P t , and contrasting this result with the model's performance on a test set sampled from P 0 (when known), or from Q. We also estimate worst-group performance [64] as:W G = min z ∈Z E X,y [1[f (X) = y] | z = z ]An invariant model that is optimal would hence display high performance on both P t and P 0 /Q, as well as high worst-group accuracy.Metrics like risk-invariance or equalized odds provide insights on the model's outputs, but do not probe the model's representation. As we are interested in large-scale models that might be further finetuned, it is important to understand whether the model's representation is invariant on P. Defining a representation as φ(X), we can write f (X) = h(φ(X)) in which we assume the representation to be fixed (i.e. frozen model weights) and h is a learnable function. In Zemel et al. [81] , the authors define a fair representation w.r.t. a binary Z as demographic parity on the representation:E X∈X Z=z φ(X) = E X∈X Z=z φ(X), ∀z, z ∈ Z,where X Z=z corresponds to the samples with Z = z. This is equivalent to assessing the 'encoding' of Z in φ(X), by training a linear layer h : φ(X) → Z [27, 8] . Chance level performance of h(φ(X)) would then suggest that the representation is independent of Z. In the present work, we estimate the encoding of Z using P 0 or Q such that assessing the encoding of Z is equivalent to assessing the encoding of Z|Y . Models that encode less of the auxiliary factor Z have been shown to reach a more 'global' optimum compared to models that encode the signal more strongly [independently of whether invariant predictions are obtained 80].We consider multiple architectures in this work, with an attempt to cover different model sizes and characteristics.• Small convolutional network, similar in spirit to AlexNet [43] . It includes 5 convolution blocks with kernel sizes (4, 3, 2, 2, 2, 2) and output channels (3, 6, 9, 12, 12, 9) , with max pooling after each convolution, as well as two dense layers with Relu non-linearity before the output head. • VGG network [68] with square kernels of size 3, output channels of dimensions (64, 64, 128, 128, 128, 256, 256, 256, 512, 512, 512) and strides (1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1). • Vision Transformers [18] of different sizes: ViT-micro (17M parameters), ViT-Tiny (44M),ViT-S (174M) and ViT-B (690M), with the Tiny sizes and up taken from [73] .• For text data, we use the BERT architecture, as defined in TensorFlow Hub.We use a stochastic gradient descent optimizer with Nesterov momentum of 0.9 for all models.We include a hyper-parameter search over the learning rate (5 values in log-scale between 9e -5 and 0.1) coupled with a batch size search between sizes of 128, 256 and 512 examples. In terms of regularization, the small convolutional network include dropout in the dense layers (search on 0.1, 0.2, 0.3), while VGG includes batch normalization in the dense layers (as per their original implementations). We impose an L2-regularization of 1e -4 during training for all architectures.We note that hyper-parameters did not seem to make a difference on the MNIST results. For VGG, there was a larger variation, as well as a larger variance across multiple seeds.When performing MMD conditional regularization, we vary the strength of the regularizer in [0.0, 0.1, 0.2, 0.5, 1., 2., 3., 4., 5., 6., 7., 8., 9., 10.], with 5 replicates for each value. To minimize computational expenses, we fix the learning rate to 0.001, dropout rate to 0.1 and batch size to 64 (for downsampled datasets) or 256.We use the BERT model bert_en_uncased_L-12_H768_A-12 from TensorFlow Hub. All other models are trained from scratch in our code infrastructure written in Python and JAX [7] . The results are then analyzed with Python and the numpy [30] , matplotlib [32, https://matplotlib.org/] and pandas [50, https://pandas.pydata.org/] packages. For the small convolutional networks, training was performed with 4 GPUs (V100) and evaluation used 1 GPU per model instance. BERT used 2 Tensor Processing Units (TPUs) for training and 1 TPU for evaluation. For all other models, we used 4 Tensor Processing Units for training and 1 TPU or GPU (P100) for evaluation. We note that, apart from ViT-B and BERT, all experiments could be run on CPU.Other confounder We notice that correlation between V and Z in Q is decreased (ρ = -0.16) compared to P t (ρ = -0.60) but is not null. In addition, we observe that the model relies on V (accuracy on Q: 0.769 ± 0.008, on P 0 : 0.647 ± 0.023). As a consequence, models trained on Q display a bias w.r.t. Z (see equalized odds and worst group performance). Model encoding and performance across different model sizes is displayed in Figure 8 . We show that all models trained on the subsampled data display an encoding of the auxiliary factor Z.Correlation patterns in balanced data We plot the Pearson correlation between Y and all other available attributes (39 in CelebA) in Figure 9 (left), and similarly for Z (right). We note that the correlation that increases most when balancing the data is between Y and the 'black hair' label. As this label has a low correlation with Z, this does not seem problematic. We also observe smaller changes in attributes related to hair ('bushy-eyebrows', 'bald') and accessories ('wearing-hat').Our work investigates a common mitigation strategy for failures of fairness or robustness in machine learning predictive settings. We aim to clearly highlight when data balancing is promising, and when it fails, hence advancing the field of trustworthy machine learning. As with most papers addressing fairness questions, we acknowledge that our mathematical formulations of fairness criteria might not correspond to the desired societal impact, e.g. in terms of equity. Specific considerations for our work include the use of the CelebA [46] dataset, and in particular the 'is-male' binary label provided.We acknowledge that a binary characterization of gender is not representative and can be harmful. In addition, it would be desirable to have self-reported instead of perceived gender. Our work considers cases for which auxiliary factors of variation Z are observed at train, test or fine-tuning time. This is a limitation of our investigation, as our insights might not be available when Z is unobserved. This is exemplified by the more difficult case of distinguishing between failure modes without a P 0 in the classification of CelebA images.• The factors of variability that the error bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, or overall run with given experimental conditions). • The method for calculating the error bars should be explained (closed form formula, call to a library function, bootstrap, etc.) • The assumptions made should be given (e.g., Normally distributed errors).• It should be clear whether the error bar is the standard deviation or the standard error of the mean. Justification: We provide these details in the Appendix. We note that the architecture or specific model used is not relevant to our message.• The answer NA means that the paper does not include experiments.• The paper should indicate the type of compute workers CPU or GPU, internal cluster, or cloud provider, including relevant memory and storage. • The paper should provide the amount of compute required for each of the individual experimental runs as well as estimate the total compute. • The paper should disclose whether the full research project required more compute than the experiments reported in the paper (e.g., preliminary or failed experiments that didn't make it into the paper). 
code of ethics: 
 Question: Does the research conducted in the paper conform, in every respect, with the NeurIPS Code of Ethics https://neurips.cc/public/EthicsGuidelines?Answer: [Yes] Justification: We do not include banned datasets and mention limitations of our data and methods clearly.Guidelines:• The answer NA means that the authors have not reviewed the NeurIPS Code of Ethics.• If the authors answer No, they should explain the special circumstances that require a deviation from the Code of Ethics. • The authors should make sure to preserve anonymity (e.g., if there is a special consideration due to laws or regulations in their jurisdiction). 
broader impacts: 
 Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?Answer: [Yes] Justification: We have included an additional section at the end of our paper to discuss Broader Impact of our work.Guidelines:• The answer NA means that there is no societal impact of the work performed.• If the authors answer NA or No, they should explain why their work has no societal impact or why the paper does not address societal impact. • Examples of negative societal impacts include potential malicious or unintended uses (e.g., disinformation, generating fake profiles, surveillance), fairness considerations (e.g., deployment of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations. • The conference expects that many papers will be foundational research and not tied to particular applications, let alone deployments. However, if there is a direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to generate deepfakes for disinformation. On the other hand, it is not needed to point out that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster. • The authors should consider possible harms that could arise when the technology is being used as intended and functioning correctly, harms that could arise when the technology is being used as intended but gives incorrect results, and harms following from (intentional or unintentional) misuse of the technology. • If there are negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms to monitor how a system learns from feedback over time, improving the efficiency and accessibility of ML). 
safeguards: 
 Question: Does the paper describe safeguards that have been put in place for responsible release of data or models that have a high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)?Answer: [NA] Justification: The paper poses no such risk.Guidelines:• The answer NA means that the paper poses no such risks.• Released models that have a high risk for misuse or dual-use should be released with necessary safeguards to allow for controlled use of the model, for example by requiring that users adhere to usage guidelines or restrictions to access the model or implementing safety filters. • Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images. • We recognize that providing effective safeguards is challenging, and many papers do not require this, but we encourage authors to take this into account and make a best faith effort.12. Licenses for existing assets Question: Are the creators or original owners of assets (e.g., code, data, models), used in the paper, properly credited and are the license and terms of use explicitly mentioned and properly respected?Answer: [Yes] Justification: We cite the authors of the datasets used and provide details on the infrastructure and terms of use in Appendix.Guidelines:• The answer NA means that the paper does not use existing assets.• The authors should cite the original paper that produced the code package or dataset.• The authors should state which version of the asset is used and, if possible, include a URL. • The name of the license (e.g., CC-BY 4.0) should be included for each asset.• For scraped data from a particular source (e.g., website), the copyright and terms of service of that source should be provided. • If assets are released, the license, copyright information, and terms of use in the package should be provided. For popular datasets, paperswithcode.com/datasets has curated licenses for some datasets. Their licensing guide can help determine the license of a dataset. • For existing datasets that are re-packaged, both the original license and the license of the derived asset (if it has changed) should be provided. • If this information is not available online, the authors are encouraged to reach out to the asset's creators. 
new assets: 
 Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets?Answer: [NA] Justification: We do not release new assets.Guidelines:• The answer NA means that the paper does not release new assets.• Researchers should communicate the details of the dataset/code/model as part of their submissions via structured templates. This includes details about training, license, limitations, etc. • The paper should discuss whether and how consent was obtained from people whose asset is used. • At submission time, remember to anonymize your assets (if applicable). You can either create an anonymized URL or include an anonymized zip file. 
crowdsourcing and research with human subjects: 
 Question: For crowdsourcing experiments and research with human subjects, does the paper include the full text of instructions given to participants and screenshots, if applicable, as well as details about compensation (if any)?Answer: [NA]Justification: The paper does not include crowdsourcing nor research with human subjects.Guidelines:• The answer NA means that the paper does not involve crowdsourcing nor research with human subjects. • Including this information in the supplemental material is fine, but if the main contribution of the paper involves human subjects, then as much detail as possible should be included in the main paper. • According to the NeurIPS Code of Ethics, workers involved in data collection, curation, or other labor should be paid at least the minimum wage in the country of the data collector. 
institutional review board (irb) approvals or equivalent for research with human subjects: 
 Question: Does the paper describe potential risks incurred by study participants, whether such risks were disclosed to the subjects, and whether Institutional Review Board (IRB) approvals (or an equivalent approval/review based on the requirements of your country or institution) were obtained?Answer: [NA]Justification: The paper does not include crowdsourcing nor research with human subjects.Guidelines:• The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.• Depending on the country in which research is conducted, IRB approval (or equivalent) may be required for any human subjects research. If you obtained IRB approval, you should clearly state this in the paper. • We recognize that the procedures for this may vary significantly between institutions and locations, and we expect authors to adhere to the NeurIPS Code of Ethics and the guidelines for their institution. • For initial submissions, do not include any information that would break anonymity (if applicable), such as the institution conducting the review.We briefly discuss group or class data balancing in Appendix A.1. 
 
 Appendix:  


Decision: The paper provides a critical take on data balancing for fairness. The main contribution is in identifying the conditions under which data balancing will/will not work using a causal graph formalism. Reviewers appreciated the technical depth and clarity in presentation. While some of the results may appear obvious in hindsight, the paper does a good job of providing a formal framework and connecting to existing empirical results. Based on the rebuttal responses, I suggest the authors to add the real-world experiment and a discussion of limitations wrt. other kinds of shifts (e.g., covariate shift), and provide guidance on use of data balancing.

Reviews: review: paper_summary: paper_summary: The paper studies the role of data balancing e.g. on sensitive attributes or class labels on obtaining fair or robust models. It identifies various causal graphs and corresponding independence conditions under which data balancing is expected to succeed (or may fail) to provide recommendations on when to use (or not to rely on) it. The main contributions are in deriving sufficient conditions for data balancing to yield invariance under correlation shifts and relating the conditions to observations made in prior work through extensive experiments.
strength_weakness: strength_weakness: 1. The writing can be clarified in places. For instance, I did not find a result which gives both necessary and sufficient condition contrary to the claim in Section 4 - please correct me if wrong.
2. (minor) Results can be summarized more concisely in a figure/table that shows the causal graphs or dependence structures where data balancing is fine and recommendations (e.g. on regularizers) for the other scenarios.
3. (minor) Some more recent works could be discussed. See comments below.
questions: questions: Please clarify which results are necessary, sufficient, and both.

Minor comments which do not require a response from the authors:

Although not necessary, please consider citing the original works for risk invariance under correlation shift for the claim in line 194, e.g. from Rojas-Carulla 2018 Invariant Models for Causal Transfer Learning https://arxiv.org/abs/1507.05333 or Peters et al. 2016 Causal inference using invariant prediction: identification and confidence intervals https://arxiv.org/abs/1501.01332.
Consider relating the findings to more recent work such as Kaur et al. 2023 Modeling the Data-Generating Process is Necessary for Out-of-Distribution Generalization https://arxiv.org/abs/2206.07837.

Please specify whether it is feasible and how to check if the sufficient conditions hold.

Consider commenting on data augmentation that might achieve the same conditions as data balancing in some scenarios.

I would suggest adding a footnote that the term sufficient statistic differs slightly from its traditional definition e.g. in line 198 it is more appropriate to say that E[Y|X_Z^\perp] is a sufficient statistic for the outcome risk function E[Y|X], not for Y.

---
After the response

Thanks for responding to the my concerns. I do not have any more questions and feel that the work is significant in that it presents a better understanding of data balancing (a commonly-used method in fairness or robustness problems). I have raised my score to 7 as a result.
limitations: limitations: Limitations are acknowledged in good amount of detail.
paper_summary: paper_summary: The paper focuses on the topic of data balancing for fairness and robustness and uses a causal graph as a tool to analyze the effects of data balancing. In the paper, the paper tries to show both the positive impacts and potential pitfalls of data balancing. For the fairness aspect, the paper focuses on the independence between groups and labels in the data. For the robustness aspect, the paper focuses on the lowest risk across a family of target distributions. The paper uses several synthetic and benchmark datasets to support their theoretical analyses on data balancing.
strength_weakness: strength_weakness: * W1. This paper examines both fairness and robustness, yet the relationship between these two aspects or the reason the paper focuses on these two remains somewhat obscure. The paper could benefit from giving a more in-depth discussion or intuition on why fairness and robustness are susceptible to similar issues. Potential discussions may include 1) how similar analysis can apply to these two different objectives and 2) why the paper focuses on fairness and robustness among various safety criteria.

* W2. While the paper employs synthetic and benchmark datasets to illustrate various failure cases, a more concrete real-world motivating examples would further highlight the importance of addressing these failure cases in both fair and robust training.

* Minor suggestion: It would be better to use full name of CBN in Figure 1.
questions: questions: The questions are included in the weakness section.
limitations: limitations: The paper has reasonable limitation, future work, and impact section.
paper_summary: paper_summary: The paper analyses training risk invariant models using data balancing. The authors consider the cases in which data balancing might help obtain risk-invariant models and the cases in which data balancing does not achieve the desired effect. The paper also considers the effect of regularization for robust model training, and how that compares to data balancing.
strength_weakness: strength_weakness: 1. The paper only considers risk invariance w.r.t. correlation shift. Can this be generalised to other forms of distribution shifts?
2. The paper only considers the question of joint balancing of Y, Z. As the authors show in Proposition 5.1, joint balancing will not effectively remove the undesirable paths in G in all cases. Can the conditions be generalised to other forms of balancing?
3. Obtaining a DAG for a real-world setup involves the decomposition of $X$ (and positing causal relationships between these components). This seems like a non-trivial task in general. The authors don't touch upon the practical aspects of obtaining the DAG in the real world. 
4. The paper does not provide a systematic methodology for determining whether data balancing is a good idea for a given real-world dataset. The experiment seems to be using a trial-and-error method to establish the failure modes, but this seems highly impractical. 
5. Overall, I think the presentation can be improved. Certain parts of the paper are a bit vague. (See the questions below for more details.)
questions: questions: 1. In line 161, does "performance" correspond to model accuracy? If so, how is the performance on $P^0$ lower than that on P? (where the latter has an overall accuracy of 0.717)
2. How do you try to decode $Z$ from the representation $\phi(X)$? This is an important piece of information that seems to be missing?
3. In Table 1, what is the test distribution on which the accuracy is measured? What is P(Z=1) for example, and is the test distribution of (X, Y, Z) fixed across the different tasks in Table 1? It seems that these test distributions differ across the different tasks. If so, the comparison of accuracy does not seem to be fair. 
4. There is no motivation behind the choice of the 4 cases in Figure 1. These seem somewhat arbitrary. Why were these chosen specifically? Is there a systematic way of considering the different cases?
5. Does the model f need to be a neural network necessarily? If so, this should be made clear.
6. What do "penulatimate representation" and "intermediate representation" mean? Are these referring to the hidden layers of the model? 
7. I found the paragraph starting on line 270 to be quite vague. For example, the authors talk about "regularization" without explicitly defining the regularization term.

> "If we consider both the purely spurious correlation and the entangled case, we see that regularization and data balancing would have the same effects of blocking any dependence..."

I am not sure I completely understand this statement either. The regularization is a methodology which would potentially modify the distribution of f(X), but the distribution of data (X, Y, Z) would still remain unchanged, so how does regularization change the DAG of data?

In figure 3 and table 2, the accuracy on the original data distribution P should also be logged. In fact, in real-world settings, the practitioners would care about the accuracy on the original data distribution (not Q or P^0).
limitations: limitations: The authors have addressed the limitations of their work in the final section.
paper_summary: paper_summary: This paper theoretically studies the applicability of data balancing in achieving fairness or robustness. The paper shows that data balancing may fail depending on the data generation mechanism. The paper introduces conditions for data balancing to produce invariant and optimal models. The paper also shows that data balancing can negatively impact fairness or robustness when combined with regularization strategies.
strength_weakness: strength_weakness: This theoretical work on data balancing for fairness and robustness in machine learning presents some valuable insights, but falls short in several key areas. The paper's main contribution lies in demonstrating cases where data balancing techniques fail to achieve fairness. However, it does not effectively synthesize these findings into clear principles or rules, lacking a clear, overarching takeaway message. A more effective approach might have been to distill the various cases and propositions into a set of guiding principles or a unified framework for approaching fairness using data balancing.

The authors present several propositions in Section 4, summarizing some of their results. While these propositions offer a formal structure to the paper, the conclusions they provide are relatively intuitive and do not significantly advance the field's understanding of data balancing.

Another limitation of the paper is its focus on negative results. The authors primarily demonstrate scenarios where data balancing techniques are ineffective ("CANNOT results"), without offering constructive solutions to these identified problems. This approach, while valuable for highlighting potential pitfalls, reduces the paper's overall significance and applicability.
questions: questions: In Assumption 2.3, does “a function of X” mean “a subset of X”?

Can the proposed method be applied to other types of distribution shift, like prior shift or concept shift?
limitations: limitations: N/A

Comments: title: Thanks for the response
comment: The response adequately addresses all of my concerns. I particularly appreciate the table summarizing the work and updates to the text on sufficient and necessary conditions. I feel that the work is significant in that it presents a better understanding of data balancing (a commonly-used method in fairness or robustness problems). I have raised my score to 7 as a result.