On the Limitations of General Purpose Domain Generalisation Methods

## Abstract

Abstract We investigate the fundamental performance limitations of learning algorithms in several Domain Generalisation (DG) settings. Motivated by the difficulty with which previously proposed methods have in reliably outperforming Empirical Risk Minimisation (ERM), we derive upper bounds on the excess risk of ERM, and lower bounds on the minimax excess risk. Our findings show that in all the DG settings we consider, it is not possible to significantly outperform ERM. Our conclusions are limited not only to the standard covariate shift setting, but also two other settings with additional restrictions on how domains can differ. The first constrains all domains to have a non-trivial bound on pairwise distances, as measured by a broad class of integral probability metrics. The second alternate setting considers a restricted class of DG problems where all domains have the same underlying support. Our analysis also suggests how different strategies can be used to optimise the performance of ERM in each of these DG setting. We also experimentally explore hypotheses suggested by our theoretical analysis.

## 1 Introduction

Machine learning systems have shown exceptional performance on numerous tasks in computer vision, natural language processing, and beyond. However performance drops rapidly when the standard assumption of identically distributed training and testing data is violated. This domain-shift phenomenon occurs widely in many applications of machine learning (Csurka, ; Zhou et al., ; Koh et al., ), and often leads to disappointing results in practical machine learning deployments, since data “in the wild” is almost inevitably different from training sets.
Given the practical significance of this issue, numerous methods have been proposed that aim to improve models’ robustness to deployment under train-test domain shift by leveraging several different training sets for the same task (Zhou et al., ), a problem setting known as Domain Generalisation (DG). These span diverse approaches including specialised neural architectures, data augmentation strategies, and regularisers. Nevertheless, determining the effectiveness of these methods has proven to be difficult. A large scale experimental investigation (Gulrajani and Lopez-Paz, ) determined that none of the previously proposed methods for addressing the DG problem could reliably outperform Empirical Risk Minimisation (ERM)—the method that simply ignores all of the domain structure in the data and trains a model as normal.

Meanwhile various theoretical analyses have tried to study the DG problem via the derivation of generalisation bounds, attempting to provide guarantees on the worst case performance of various learning methods in this setting. Usually these analyses make strong assumptions about either the structure of the model or the underlying data generation process. Algorithms based on kernel methods have received quite a bit of attention
(Muandet et al., ; Blanchard et al., ), and the behaviour of how well these approaches scale with the number of training examples and training domains is well-understood. There is also substantial work on investigating generalisation in other distribution shift settings
(Mansour et al., ; Kpotufe, ; Rosenfeld et al., ). However, there is a lack of work on exploring the theoretical properties of sensible baselines the fundamental limits of the problem setting.

In this paper we take a different direction to this existing body of theoretical work, and present the first study of: (i) excess risk bounds for ERM in the DG setting; and (ii) *minimax* excess risk bounds that determine the fundamental limit of the best possible algorithm for a particular setting. Surprisingly, we show that for several common DG settings, the minimax bounds and the worst case bounds for ERM have the same scaling behaviour, indicating that *it is not possible for any learning algorithm to do substantially better than ERM*. Our analysis covers both the most popular DG assumption of covariate shift, as well as two simpler (more constrained) scenarios where domains have bounded pairwise distance, and where all domains share the same support. Surprisingly, similar conclusions hold in each case. These results may go some way toward explaining why empirical analyses (Gulrajani and Lopez-Paz, ) have shown that the plethora of purpose designed methods (Zhou et al., ) struggle to beat ERM when carefully evaluated. We finally use the insights from this theoretical analysis to discuss what extra assumptions a DG algorithm would need to exploit to outperform ERM going forward.

In summary, we make the following contributions to knowledge:

- •
We derive upper bounds on the excess risk of ERM that show, as the quantity and variety of training data increases, ERM is able to better approximate the optimal model in the chosen class of models. This conclusion holds for all three of the DG settings that we consider.
- •
Lower bounds on the minimax excess risk are provided. By comparing these lower bounds with the upper bounds for ERM, we demonstrate that no method can perform substantially better than ERM in the three general purpose DG settings considered in this paper.
- •
Actionable insights are given for how one can optimise the performance of ERM in each of the DG settings via the choice of regularisation strength and ensuring the hypothesis class is well-suited to the underlying problem.

## 2 Related Work

The DG problem setting was first introduced and analysed by Blanchard et al. (), who also provided a learning theory motivated algorithm for addressing it based on kernel methods. Since then, several other works have also gone down the route of using statistical learning theory to derive kernel methods with performance guarantees for DG (Muandet et al., ; Blanchard et al., ). We note that a more general analysis of the performance of standard baselines and of fundamental limitations of methods developed for the standard DG setting is missing. However, some work has been undertaken for a variant where unseen domains are restricted to convex or affine combinations of those domains seen during training Rosenfeld et al. (), where it is shown that ERM is minimax optimal. In any case, empirical evidence suggests that these limitations might be closer than we would like. Gulrajani and Lopez-Paz () compared several state of the art methods using DomainBed, a common benchmark and hyper-parameter tuning protocol. They ultimately defend Empirical Risk Minimization (ERM) over more sophisticated alternatives on the grounds that no competitor consistently beats it. We also broadly defend ERM, and go a step further in claiming that one cannot construct a general purpose DG method that substantially outperforms ERM. However, we provide a deeper analysis into when and why ERM works, rooted in a theoretical analysis of generalisation qualities of ERM, unlike the prior purely empirical evaluation.

Methods based on Invariant Causal Prediction (ICP) (Peters et al., ) have also been developed for the DG setting, and often come with claims of guaranteed robustness in the face of distribution shifts due to leveraging the underlying causal structure of a problem. The most popular idea in this area is Invariant Risk Minimisation (IRM) (Arjovsky et al., ), and variants such as Krueger et al. (), which use an objective function inspired by ICP to train a deep neural network for DG. Some other prior work makes a similar observation to us, identifying that standard regularisation methods can improve robustness to distribution shift, albeit through a different lens (Janzing, ; Sagawa et al., ). However, methods based on IRM have been shown to be more fragile than expected in the face of real distribution shifts, rather than those considered in simplified causal diagrams (Gulrajani and Lopez-Paz, ; Rosenfeld et al., ).

Our work also takes inspiration from other transfer learning settings. In particular, there has been a lot of work analysing the supervised and unsupervised Domain Adaptation problems, where there are now a number of ways to relate the performance on training data from some source domain to new data drawn from some target domain (Mansour et al., , ; Ben-David et al., ; Kpotufe, ; Zhang et al., ; Kpotufe and Martinet, ). The focus of these works is typically to define some notion of distribution divergence and then develop a tractable method for estimating this divergence, or finding a model that best exploits the insights provided by such divergences. There have been some attempts to apply these ideas in the DG setting (e.g., Albuquerque et al. ()). However, in the domain adaptation settings, there is an emphasis on finding divergences that are capable of exploiting asymmetries in the direction of transfer (Kpotufe and Martinet, ). In contrast, the standard DG formulation assumes a domain is just as likely to appear at training time as it is at test time, so it is not clear that we should expect an asymmetric divergence to be well-suited to DG.

## 3 Domain Generalisation

Figure: Figure 1: A plate diagram describing an overview of the Domain Generalisation data generation process. The environment—a distribution over domains—is represented by $E$. During the training phase, $n$ domains, $P_{1}$ to $P_{n}$, are sampled from $E$. From each of these domains we sample $m$ training points, leading to a total of $mn$ training points. At test time, the model will encounter an indeterminate number of domains, so we do not index the $P$ nodes. From each of these domains, unlabelled points are sampled and the model is required to produce an estimate of the corresponding label.

##### Standard i.i.d. learning

To begin with, we establish some notation by introducing the standard independently and identically distributed (i.i.d.) learning setting. The risk of a model, $f\in{\mathcal{F}}$, on some distribution, $P$, for some loss, $\ell$, is defined as

$$ $L_{P}(f)=\mathop{\mathbb{E}}_{({\textnormal{x}},{\textnormal{y}})\sim P}\left[ \ell(f({\textnormal{x}}),{\textnormal{y}})\right].$ (1) $$

Examples of useful loss functions include the zero–one loss and ramp loss,

$$ $\ell_{01}(\hat{y},y)=\mathbf{1}(\operatorname{sign}(\hat{y})=y),\qquad\ell_{ ramp}(\hat{y},y)=\max(0,\min(1,1-\hat{y}y)).$ (2) $$

Note that the ramp loss is Lipschitz and upper bounds the zero–one loss. Similar to the risk, we can define the empirical risk on an i.i.d. sample, $S_{m}=\{({\textnormal{x}}_{i},{\textnormal{y}}_{i})\}_{i=1}^{m}$, from $P$ as

$$ $\hat{L}_{S_{m}}(f)=\frac{1}{m}\sum_{i=1}\ell(f({\textnormal{x}}_{i}),{ \textnormal{y}}_{i}).$ (3) $$

Throughout this paper we use Rademacher complexity ${\mathcal{R}}$, and its empirical analogue $\hat{{\mathcal{R}}}$, to characterise the capacity of the hypothesis class, ${\mathcal{F}}$,

$$ ${\mathcal{R}}_{P^{m}}({\mathcal{F}})=\mathop{\mathbb{E}}_{S_{m}}[\hat{{ \mathcal{R}}}_{S_{m}}({\mathcal{F}})],\qquad\hat{{\mathcal{R}}}_{S_{m}}({ \mathcal{F}})=\mathop{\mathbb{E}}_{\sigma}\left[\sup_{f\in{\mathcal{F}}}\frac{ 1}{m}\sum_{i=1}^{m}\sigma_{i}f({\mathbf{x}}_{i})\right],$ (4) $$

where $\sigma$ is a vector Rademacher random variables, so $\Pr(\sigma_{i}=1)=\Pr(\sigma_{i}=-1)=\frac{1}{2}$. In the case of linear models, these Rademacher complexity can be controlled by constraints on weight norms, while in the case of deep models they further depend on properties of the chosen network architecture. For typical choices of hypothesis class, the complexity scales as ${\mathcal{O}}(1/\sqrt{m})$. For simplicity, we avoid introducing multi-output generalisations of Rademacher complexity and therefore focus only on binary classification, with the sign of the model output indicating the predicted class. A typical generalisation bound using Rademacher complexity in the i.i.d. setting has the form given in the theorem below.

###### Theorem 1 ( Mohri et al. ( 2018 ) ) .

Suppose $\ell$ takes values in $[0,1]$ and $S_{m}$ is contains $m$ i.i.d. samples from $P$. The worst-case difference between the population risk and empirical risk for models selected from ${\mathcal{F}}$ is bounded, in expectation, by

$$ $\mathop{\mathbb{E}}_{S_{m}}\left[\sup_{f\in{\mathcal{F}}}L_{P}(f)-\hat{L}_{S_{ m}}(f)\right]\leq 2{\mathcal{R}}_{P^{m}}(\ell\circ{\mathcal{F}}),$ $$

and with probability at least $1-\delta$ over realisations of $S_{m}$, we have for all $f\in{\mathcal{F}}$ that

$$ $L_{P}(f)\leq\hat{L}_{S_{m}}(f)+2\hat{{\mathcal{R}}}_{S_{m}}(\ell\circ{\mathcal {F}})+3\sqrt{\frac{\ln 2/\delta}{2m}}.$ $$

where we have used $\ell\circ{\mathcal{F}}=\{({\bm{x}},y)\mapsto\ell(f({\bm{x}}),y)\,:\,f\in{
\mathcal{F}}\}$.

This is a variation of a classic result attributed to Bartlett and Mendelson ().

###### Theorem 1 ( Mohri et al. ( 2018 ) ) .

##### From i.i.d. to DG learning

In the Domain Generalisation setting we are interested in two layer hierarchical data generating processes, where the top level distribution is denoted by $E$. One can sample domain distributions from $E$, and subsequently sample data points from each domain distribution. The most common way to formulate the DG problem setting assumes that one has access to training data from $n$ domain distributions sampled i.i.d. from $E$. For ease of exposition we assume that we sample $m$ data points from each domain, but we note that similar versions of our results still hold in the case where a different number of data points are available for each domain. The task is then to build a model that can still perform well when applied to data drawn from novel domain distributions sampled from $E$ at test time. The DG data generation process is summarised by the plate diagram in Figure 1. Just as the risk is the central quantity of interest in the i.i.d. setting, in the DG setting we are concerned with the transfer risk,

$$ $L_{E}(f)=\mathop{\mathbb{E}}_{P\sim E}[L_{P}(f)],$ (5) $$

and the corresponding empirical risk is given by

$$ $\hat{L}_{S_{mn}}(f)=\frac{1}{n}\sum_{j=1}^{n}\hat{L}_{S_{m}^{j}}(f),$ (6) $$

where $S_{m}^{j}$ is the training data sampled from $P_{j}$ and $S_{mn}=\cup_{j=1}^{n}S_{m}^{j}$ is a set containing all the training data. One of our objectives is prove generalisation bounds along the same lines as Theorem 1. To do this, we extend the idea of Rademacher complexity to be defined for two-level distributions, $E$,

$$ ${\mathcal{R}}_{E^{n}}({\mathcal{F}})=\mathop{\mathbb{E}}_{P_{1:n}}\mathop{ \mathbb{E}}_{\sigma}\left[\sup_{f\in{\mathcal{F}}}\frac{1}{n}\sum_{j=1}^{n} \sigma_{j}\mathop{\mathbb{E}}_{{\mathbf{x}}\sim P_{j}}[f({\mathbf{x}})]\right].$ (7) $$

Two models that feature prominently in our analysis include the Empirical Risk Minimiser within the class of models, ${\mathcal{F}}$,

$$ $\hat{f}=\operatorname*{arg\,min}_{f\in{\mathcal{F}}}\hat{L}_{S_{mn}}(f),$ (8) $$

and the optimal model in ${\mathcal{F}}$,

$$ $f^{\ast}=\operatorname*{arg\,min}_{f\in{\mathcal{F}}}L_{E}(f).$ (9) $$

The difference in risk between a model built using some learning algorithm (e.g., ERM) and the optimal model, $f^{\ast}$, is referred to as the excess risk. Central to our analysis is the *minimax* excess risk for learning algorithms, $A$, that map from training sets to elements of ${\mathcal{F}}$. In the i.i.d. setting this is given by

$$ $M({\mathcal{F}},{\mathcal{P}},m)=\inf_{A}\sup_{P\in{\mathcal{P}}}\left\{ \mathop{\mathbb{E}}_{S_{m}}\left[L_{P}(A(S_{m}))\right]-L_{P}(f^{\ast})\right\},$ (10) $$

where ${\mathcal{P}}$ is the set of all i.i.d. distributions over the cartesian product of a feature space and label space, $X\times Y$. This definition can be straightforwardly extended to the DG setting by considering a set of distributions other than ${\mathcal{P}}$. For the remainder of this paper we consider various subsets of ${\mathcal{E}}$, the set of all possible DG distributions, $E$. With some abuse of notation, we will denote the minimax excess risk for selecting models from ${\mathcal{F}}$ for distributions in ${\mathcal{E}}$ using $m$ training examples from each of $n$ domains by $M({\mathcal{F}},{\mathcal{E}},mn)$.

The minimax excess risk is a lower bound on the best possible excess risk of any algorithm when applied to the hardest problem in ${\mathcal{E}}$. It can be thought of in a game-theoretic way: one player constructs an algorithm to minimise the excess risk; meanwhile, the other player selects a pathological distribution for this algorithm to maximise the excess risk. It provides an indication of how quickly the best possible learning algorithm is able to find the optimal model as a function of the amount of training data (and number of training domains) available. One could argue that ${\mathcal{E}}$ contains many DG problems that are not likely to be of interest in the real world, and that one of the uninteresting problems could be the maxmimiser in the minimax excess risk. In the remainder of the paper we consider three different restricted subsets of ${\mathcal{E}}$ that correspond to popular intuitions discussed in the transfer learning literature: covariate shift problems; covariate shift problems with bounded pairwise distance between domains; and covariate shift problems where the marginals for each domain have bounded density ratios.

## 4 How Much Can One Possibly Improve Over ERM?

We aim to determine the extent to which one can design algorithms that improve on the performance of ERM in different DG settings. We do this by deriving upper bounds on the excess risk of ERM in each setting, and lower bounds on the minimax risk for each setting. By looking at the gap between the upper and lower bounds in each setting, we are able to elucidate how much one can gain from improving the learning algorithm and objective, versus leveraging additional prior knowledge about specific DG tasks.

### 4.1 The Covariate Shift Setting

The covariate shift setting is the most general DG setting, and also the setting most commonly considered in the literature. The covariate shift assumption is that the conditional distribution of the label given the features is the same for all domains, and the distribution shift can therefore be explained by each domain potentially having different marginal feature distributions. We can formally define the set of covariance shift DG problems as

$$ ${\mathcal{E}}_{CS}=\{E\,|\,\forall P,P^{\prime}\in\textup{supp}\,E,\,P({ \textnormal{y}}|{\mathbf{x}})=P^{\prime}({\textnormal{y}}|{\mathbf{x}})\}.$ (11) $$

#### 4.1.1 The Excess Risk of ERM

To begin with, we provide a uniform convergence result for the generalisation error of methods developed for this setting. This theorem is used in the course of proving an upper bound on the excess risk of ERM, but is also interesting in its own right, as it applies to all DG algorithms developed for the covariate shift setting.

###### Theorem 2 .

Assume $\ell$ takes values in $[0,1]$. For a hypothesis class, ${\mathcal{F}}$, and any $E\in{\mathcal{E}}_{CS}$, we have that

$$ $\mathop{\mathbb{E}}_{S_{mn}}\left[\sup_{f\in{\mathcal{F}}}L_{E}(f)-\hat{L}_{S_ {mn}}(f)\right]\leq 2\mathop{\mathbb{E}}_{P_{1:n}}\left[{\mathcal{R}}_{P_{1:n} ^{m}}(\ell\circ{\mathcal{F}})\right]+2{\mathcal{R}}_{E^{n}}(\ell\circ{\mathcal {F}}).$ $$

Moreover, we have with confidence at least $1-\delta$ over the realisations of $S_{mn}$, for all $f\in{\mathcal{F}}$, that

$$ $L_{E}(f)\leq\hat{L}_{S_{mn}}(f)+2\hat{{\mathcal{R}}}_{S_{mn}}(\ell\circ{ \mathcal{F}})+\frac{2}{m}\sum_{i=1}^{m}\hat{{\mathcal{R}}}_{S_{n}^{i}}(\ell \circ{\mathcal{F}})+5\sqrt{\frac{\ln 3/\delta}{2mn}},$ $$

where we denote by $S_{n}^{i}$ the set containing the the $i$th example from each $S_{m}^{j}$.

The proof can be found in Appendix A.

Discussion Theorem 2 tells us that the expected gap between the transfer risk and empirical risk is bounded by two Rademacher complexity terms. The second part of the result provides an observable version of this bound that holds with high probability and has the same scaling behaviour, but is slightly looser due to the additional sampling error term. For typical hypothesis classes, the first term controls how much the model could have overfit to the specific points sampled in the trainingset and will scale as ${\mathcal{O}}(1/\sqrt{mn})$. The second term controls how much the model could have overfit to the domains included in the training set, and will scale as ${\mathcal{O}}(1/\sqrt{n})$. Mirroring conventional generalisation in standard i.i.d. learning, a very simple model may minimise the Rademacher terms while producing high empirical risk and vice-versa. Thus, good generalisation critically depends on a carefully chosen empirical risk versus model complexity trade-off.
The difference between Theorem 2 and single domain bounds (e.g., Theorem 1) is the additional dependence on the number of domains $n$ via the additional Rademacher complexity term. This highlights an important insight: when the goal is to generalise to new domains, the risk of overfitting is higher.
*Therefore a lower complexity model is better for held out domain performance compared for seen domain performance in standard i.i.d. learning.* Crucially, in-domain generalisation and cross-domain generalisation are both controlled by the same type of complexity term. This means that novel in-domain regularisation methods will automatically benefit cross-domain generalisation.

We next bound the excess risk between the ERM solution, $\hat{f}$, and the best possible model, $f^{*}$, within the function class ${\mathcal{F}}$.

###### Theorem 3 .

Under the same conditions as Theorem 2, the excess risk of ERM is bounded as

$$ $\mathop{\mathbb{E}}_{S_{mn}}[L_{E}(\hat{f})]-L_{E}(f^{\ast})\leq 2\mathop{ \mathbb{E}}_{P_{1:n}}\left[{\mathcal{R}}_{P_{1:n}^{m}}(\ell\circ{\mathcal{F}}) \right]+2{\mathcal{R}}_{E^{n}}(\ell\circ{\mathcal{F}}).$ $$

The proof can be found in Appendix B

Discussion Theorem 3 tells us that the gap between ERM and the *best possible* predictor in the function class depends on the same complexity terms observed in Theorem 2. This implies that, for any typical hypothesis class, ERM will find a near-optimal model if given sufficient data. In particular, the rate of convergences towards the optimal model will be $\mathcal{O}(1/\sqrt{mn}+1/\sqrt{n})$, indicating that it is not only the total volume of training data that is important, but also the number of training domains.

###### Theorem 2 .

###### Theorem 3 .

#### 4.1.2 A Lower Bound on the Minimax Excess Risk

We now turn to the problem of computing lower bounds on the minimax excess risk for covariate shift DG problems. We have already provided an upper bound on the excess risk for using ERM to select a model from ${\mathcal{F}}$ which holds for all problems in ${\mathcal{E}}_{CS}$. The goal of deriving the lower bound on the minimax risk, given below, is to determine how much room there is to improve upon ERM.

###### Theorem 4 .

Let ${\mathcal{F}}$ be a class of models producing predictions in $\{-1,1\}$ and let $\ell$ be the zero–one loss. We have that the minimax excess risk for problems in ${\mathcal{E}}_{CS}$ is bounded from below by

$$ $\displaystyle M({\mathcal{F}},{\mathcal{E}}_{CS},mn)$ $\displaystyle\geq\frac{\sup_{S_{2mn}}\hat{{\mathcal{R}}}_{S_{2mn}}({\mathcal{F }})+\sup_{S_{2n}}\hat{{\mathcal{R}}}_{S_{2n}}({\mathcal{F}})}{2}-\frac{\sup_{S _{mn}}\hat{{\mathcal{R}}}_{S_{mn}}({\mathcal{F}})+\sup_{S_{n}}\hat{{\mathcal{R }}}_{S_{n}}({\mathcal{F}})}{4}.$ $$

The proof is in Appendix C.

Discussion The results in Theorems 3 and 4 tell us that the gap between $f^{\ast}$ and a model trained by the best possible learning algorithm can be lower bounded by the same types of complexity terms used in the upper bound for ERM. For hypothesis classes of interest in machine learning we can say that the minimax excess risk scales as

$$ $\Omega\left(\frac{1}{\sqrt{mn}}+\frac{1}{\sqrt{n}}\right)-\Omega\left(\frac{1} {\sqrt{mn}}+\frac{1}{\sqrt{n}}\right)=\Omega\left(\frac{1}{\sqrt{mn}}+\frac{1} {\sqrt{n}}\right).$ (12) $$

Moreover, this best-case behaviour matches the worst-case scaling behaviour of ERM. As such, we can conclude that *ERM already has the optimal scaling behaviour for covariate shift DG problems.* This reasoning about asymptotic rates can obfuscate the impact of the constant factors, which becomes more important for smaller $n$. We note that the upper and lower bounds: (i) have relatively close constant factors; and (ii) the same function (i.e., Rademacher complexity) governs both in-domain generalisation and cross-domain generalisation, so the number of training examples are needed for generalisation in the i.i.d. setting will be indicative of the number of training domains needed to have good generalisation in the DG setting.

###### Theorem 4 .

### 4.2 The Bounded Integral Probability Metric Setting

The covariate shift setting analysed in Section 4.1 considers the case where $P({\textnormal{y}}|{\mathbf{x}})=P^{\prime}({\textnormal{y}}|{\mathbf{x}})$, but otherwise places no further constraints on the difference between the distributions $P({\mathbf{x}})$ and $P^{\prime}({\mathbf{x}})$. We next analyse whether making assumptions on their similarity could lead to stronger guarantees, and discuss whether this restriction enables algorithms to improve on ERM.

Integral Probability Metrics are a broad class of metrics for measuring distances between probability distributions. The generalised definition of an IPM is

$$ $d_{{\mathcal{G}}}(P,P^{\prime})=\sup_{g\in{\mathcal{G}}}\left|\mathop{\mathbb{ E}}_{{\mathbf{z}}\sim P}[g({\mathbf{z}})]-\mathop{\mathbb{E}}_{{\mathbf{z}} \sim P^{\prime}}[g({\mathbf{z}})]\right|,$ (13) $$

where different choices of ${\mathcal{G}}$ lead to different metrics, and ${\mathbf{z}}$ could also represent the tuple $({\mathbf{x}},{\textnormal{y}})$. For various choices of ${\mathcal{G}}$ one can recover distribution distances commonly found in the DG and domain adaptation literature, such as maximum mean discrepancy, $d_{H\Delta H}$-distance, discrepancy distance, total variation distance, and more. In this section we analyse a subset of covariance shift problems ${\mathcal{E}}_{{\mathcal{G}},\sigma}$ where the distance between different domains, as measured by some IPM $d_{\mathcal{G}}$, is bounded by $\sigma$,

$$ ${\mathcal{E}}_{{\mathcal{G}},\sigma}=\{E\,|E\in{\mathcal{E}}_{CS}\,\land\, \forall P,P^{\prime}\in\textup{supp}\,E,\,d_{\mathcal{G}}(P,P^{\prime})\leq \sigma\}.$ (14) $$

As in the covariate shift setting, we start with a uniform convergence result that will be useful in the subsequent analysis.

###### Theorem 5 .

Let $\ell$ be a loss function taking values in $[0,1]$. For a hypothesis class, ${\mathcal{F}}$, and any ${\mathcal{G}}$ such that $\ell\circ{\mathcal{F}}\subseteq{\mathcal{G}}$, then we have for any $E\in{\mathcal{E}}_{{\mathcal{G}},\sigma}$

$$ $\mathop{\mathbb{E}}_{S_{mn}}\left[\sup_{f\in{\mathcal{F}}}L_{E}(f)-\hat{L}_{S_ {mn}}(f)\right]\leq 2\mathop{\mathbb{E}}_{P_{1:n}}[{\mathcal{R}}_{P_{1:n}^{m}} (\ell\circ{\mathcal{F}})]+\sigma.$ $$

Moreover, we have with confidence at least $1-\delta$ over the realisations of $S_{mn}$, for all $f\in{\mathcal{F}}$, that

$$ $L_{E}(f)\leq\hat{L}_{S_{mn}}(f)+2\hat{{\mathcal{R}}}_{S_{mn}}(\ell\circ{ \mathcal{F}})+\sigma+3\sqrt{\frac{\ln 2/\delta}{2mn}}.$ $$

The proof is given in Appendix D. Similar to the more general covariate shift setting, we also obtain a bound on the excess risk of ERM.

###### Corollary 1 .

Under the same conditions as Theorem 5, the excess risk of ERM is bounded by

$$ $\mathop{\mathbb{E}}_{S_{mn}}[L_{E}(\hat{f})]-L_{E}(f^{\ast})\leq 2\mathop{ \mathbb{E}}_{P_{1:n}}[{\mathcal{R}}_{P_{1:n}^{m}}(\ell\circ{\mathcal{F}})]+\sigma.$ $$

The proof is essentially the same as for Theorem 3, except we apply Theorem 5 instead of Theorem 2.

Discussion This theorem tells us that if all domains associated with the DG problem exhibit a high degree of similarity, as measured by a sufficiently expressive IPM, the effect of the distribution shift is reduced and one mainly needs to consider the overfitting behaviour typically seen in i.i.d. problems. This result is of most interest when only a small number of training domains are available; if $\sigma$ is small, one can still guarantee that not too much additional error will be incurred in the DG setting, despite having seen little variety in training domains. It is also worth noting that ${\mathcal{E}}_{{\mathcal{G}},\sigma}\subseteq{\mathcal{E}}_{CS}$, so the guarantee from Theorem 3 still applies. This means that one can still expect the transfer risk to improve as more training domains are collected, and the asymptotic (i.e., large-$n$) scaling behaviour of ${\mathcal{O}}(1/\sqrt{mn}+1/\sqrt{n})$ is carried over.

###### Theorem 6 .

Let ${\mathcal{F}}$ be a class of models producing predictions in $\{-1,1\}$ and $\ell$ be the zero–one loss. For any ${\mathcal{G}}$ such that $d_{\mathcal{G}}$ takes values in $[0,1]$, we have that the minimax excess risk for problems in ${\mathcal{E}}_{{\mathcal{G}},\sigma}$ is bounded from below by

$$ $M({\mathcal{F}},{\mathcal{E}}_{{\mathcal{G}},\sigma},mn)\geq\frac{\sup_{S_{2mn }}\hat{{\mathcal{R}}}_{S_{2mn}}({\mathcal{F}})+\sup_{S_{2n}}\sigma\hat{{ \mathcal{R}}}_{S_{2n}}({\mathcal{F}})}{2}-\frac{\sup_{S_{mn}}\hat{{\mathcal{R} }}_{S_{mn}}({\mathcal{F}})+\sup_{S_{n}}\sigma\hat{{\mathcal{R}}}_{S_{n}}({ \mathcal{F}})}{4}.$ $$

The proof is given in Appendix E.

Discussion Because we have two upper bounds on the excess risk of ERM (Theorem 3 and Corollary 1), it is easiest to compare the upper and lower bounds separately for the large-$n$ (i.e., asymptotic) and small-$n$ (i.e., non-asymptotic) cases. Asymptotically, the ERM excess risk and this lower bound behave in the same way as Theorems 3 and 4, respectively, so we can conclude that in the large-$n$ case there is once again no substantial room for improvement over ERM. In the small-$n$ case, $\sup_{S_{n}}\hat{{\mathcal{R}}}_{S_{n}}({\mathcal{F}})$ and $\sup_{S_{2n}}\hat{{\mathcal{R}}}_{S_{2n}}({\mathcal{F}})$ will both be close to one, so the corresponding terms that they appear in will be approximately equal to $\sigma$. This implies that in the small-$n$ case, the lower bound in Theorem 6 will be close to the upper bound in Corollary 1, so we can again conclude that there is little room for improvement over ERM.

###### Theorem 5 .

###### Corollary 1 .

###### Theorem 6 .

#### 4.2.1 When can σ 𝜎 \sigma italic_σ be small?

Given the full generality of IPMs, it may not be obvious what kinds of DG problems are likely to have small bounds on the IPM between their domains. In this section we provide two examples of cases where one can expect a small value for $\sigma$.

Domains are mixtures with common components If every domain $P\in\textup{supp}\,E$ can be written as a mixture over a fixed set of components, $Q_{1:k}$, but with random mixture coefficients, $\alpha_{1:k}$,

$$ $P=\sum_{c=1}^{k}\alpha_{c}Q_{c},\qquad\sum_{c=1}^{k}\alpha_{j,c}=1,$ (15) $$

then the IPM with $TV$, the set of all functions mapping to $[0,1]$, between two domains is bounded by the sum of absolute differences in the corresponding $\alpha$ vectors, so

$$ $d_{TV}(P,P^{\prime})\leq\frac{1}{2}\sum_{c=1}^{k}|\alpha_{c}-\alpha_{c}^{ \prime}|.$ (16) $$

This follows because $d_{TV}$ is the total variation distance, which can also be expressed as half the $L^{1}$ distance between the densities. If there are non-trivial bounds on the support of the mixing coefficients then Equation 16 will be less than one and we will obtain a non-vacuous $\sigma$. An example of where this can appear in real-world setting is in the crossover between DG and fairness, where different domains can correspond to different mixtures of demographics between populations.

Invariant Hypothesis Classes Let $G$ be a group that acts on elements of $X$. Suppose that for all $P,P^{\prime}\in\textup{supp}\,E$ there exists $g\in G$ such that $P({\mathbf{x}},{\textnormal{y}})=P^{\prime}(g{\mathbf{x}},{\textnormal{y}})$. A hypothesis class can be said to be $(\epsilon,G)$-invariant w.r.t. $E$ if for $({\mathbf{x}},{\textnormal{y}})\sim P$

$$ $\left|\mathop{\mathbb{E}}_{({\mathbf{x}},{\textnormal{y}})}[\ell(f({\mathbf{x} }),{\textnormal{y}})-\ell(f(g{\mathbf{x}}),{\textnormal{y}})]\right|\leq \epsilon,\quad\forall g\in G,f\in{\mathcal{F}}.$ (17) $$

From this definition, it is clear that when ${\mathcal{F}}$ is $(\epsilon,G)$-invariant the IPM defined via $\ell\circ{\mathcal{F}}$, for any two domains $P,P^{\prime}\in\textup{supp}\,E$, the IPM is bounded as

$$ $d_{\ell\circ{\mathcal{F}}}(P,P^{\prime})\leq\epsilon.$ (18) $$

This style of invariance is commonly discussed in the geometric deep learning literature Bronstein et al. (), where this is a lot of work on developing hypothesis classes with specific group invariance properties. For example, in the design of machine learning models that operate on molecules to enable drug discovery pipelines (Igashov et al., ). Leveraging models with invariance properties also common in computer vision; we provide an empirical demonstration of how $(G,\epsilon$)-invariance can lead to good transfer risk in the image recognition context in Appendix H.

Note that this invariance property must hold for every model in the hypothesis class. One cannot use the training data, $S_{mn}$, to attempt to identify a subset of models that satisfy this condition and obtain this more favourable guarantee. However, there is a growing literature on using auxiliary unlabelled data to learn feature encoders with approximate invariances to various transformations Ericsson et al. (); Chavhan et al. ().

### 4.3 The Bounded Density Ratio Setting

The bounded IPM setting analysed in Section 4.2 assume there is some level of similarity between domains, in the sense that some data points could be observed in more than one domain. However, the possibility of some examples occuring exclusively in a single domain is still left open. In contrast, this Section considers the bounded density ratio setting, where each domain in a DG problem has identical support. This means that if an example can be observed in one domain, then it can also be observed in any other domain, albeit with a different probability. Formally, we define the class of $\rho$-bounded density ratio DG problems, for any $\rho\geq 1$, as a subset of ${\mathcal{E}}_{CS}$,

$$ ${\mathcal{E}}_{\rho}=\left\{E\,|\,E\in{\mathcal{E}}_{CS}\,\land\,\forall P,P^{ \prime}\in\textup{supp}\,E,\left\|\frac{dP}{dP^{\prime}}\right\|_{\infty}\leq \rho\right\},$ (19) $$

where we use $dP$ to denote the probability density function of $P$.

###### Theorem 7 .

Let $\ell$ be a loss function taking values in $[0,1]$. For a hypothesis class, ${\mathcal{F}}$, and any $E\in{\mathcal{E}}_{\rho}$, we have that

$$ $\mathop{\mathbb{E}}_{S_{mn}}[L_{E}(\hat{f})]-L_{E}(f^{\ast})]\leq 2\rho\mathop {\mathbb{E}}_{P_{1:n}}[{\mathcal{R}}_{P_{1:n}^{m}}({\mathcal{F}})]+(\rho-1) \mathop{\mathbb{E}}_{S_{mn}}[\hat{L}_{S_{mn}}(\hat{f})].$ $$

The proof is given in Appendix F.

Discussion One of the key differences between this setting and previous settings is that there is no term that scales as ${\mathcal{O}}(1/\sqrt{n})$, indicating that one could actually achieve good transfer risk with a small number of training domains. There are two ways to interpret this result in more detail. The first is that if one uses ERM to train an interpolating classifier (i.e., a classifier achieving zero training error) with sufficient data to make the Rademacher complexity term small, then the model will generalise well to new domains. Substantial empirical evidence exists to suggest that deep neural networks often interpolate the training data. We also note that this upper bound does not stipulate that training data must come from a wide variety of training domains; a substantial volume of data from one domain is enough. The second interpretation of this bound is arises from noting that $\mathop{\mathbb{E}}_{S_{mn}}[\hat{L}_{S_{mn}}(\hat{f})]\leq L_{E}(f^{\ast})$. This implies that if the hypothesis class is “well-specified”, in the sense that it contains the ground truth labelling function, then one only needs sufficient data from a single domain to find the best model via ERM.

###### Theorem 8 .

Let ${\mathcal{F}}$ be a class of models producing predictions in $\{-1,1\}$ and $\ell$ be the zero–one loss. We have that the minimax risk for problem in ${\mathcal{E}}_{\rho}$ is bounded from below by

$$ $M({\mathcal{F}},{\mathcal{E}}_{\rho},mn)\geq\sup_{S_{2mn}}\hat{{\mathcal{R}}}_ {S_{2mn}}({\mathcal{F}})-\frac{1}{2}\sup_{S_{mn}}\hat{{\mathcal{R}}}({\mathcal {F}}).$ $$

The proof is given in Appendix G.

Discussion Assuming a hypothesis class capable of obtaining low training error is chosen, the minimax excess risk lower bound scales at the same rate as the upper bound on the excess risk of ERM: $\Theta(1/\sqrt{mn})$.

###### Theorem 7 .

###### Theorem 8 .

## 5 Conclusion

This paper provides a theoretical analysis of several DG problem settings through the use of bounds on the excess risk of ERM and the minimax excess risk. Our results show that it is not possible to substantially outperform ERM in all three of the settings we consider—the covariate shift, bounded IPM, and bounded density ratio settings. We also provide several insights into how one can maximise performance in each of the different DG settings. When all that is known about the DG problem is that the covariance shift assumption holds, we are able to conclude that the best course of action is to heavily regularise the model, as the model complexity has a larger impact on the transfer risk than the usual i.i.d. risk. In the case of the bounded density ratio assumption holding, it is crucial to specify the “correct” model class—in the sense that the ground truth labelling function is well approximated by a function in the hypothesis class. The bounded IPM setting is unique in that the modeller can influence whether it holds or not by choosing an appropriate hypothesis class. We have provided two examples, along with an experimental demonstration in Appendix H, that carefully choosing a hypothesis class with the correct invariances for a problem can substantially reduce the number of domains required for good DG performance. Going forward, we anticipate that data-driven approaches to defining hypothesis classes via auxiliary data (e.g., through transfer learning or meta-learning) will enable appropriate hypothesis classes to be constructed with minimal manual labour.

### Acknowledgements

This project was supported by the Royal Academy of Engineering under the Research Fellowship programme. This work was supported by the Engineering and Physical Sciences Research Council (EPSRC) Grant number EP/S000631/1; and the MOD University Defence Research Collaboration (UDRC) in Signal Processing.

## Appendix A Proof of Theorem 2

See 2

###### Proof.

We can decompose the DG risk as

$$ $\displaystyle\mathop{\mathbb{E}}_{S_{mn}}\left[\sup_{f\in{\mathcal{F}}}L_{E}(f )-\hat{L}_{S_{mn}}(f)\right]$ (20) $\displaystyle=\mathop{\mathbb{E}}_{S_{mn}}\left[\sup_{f\in{\mathcal{F}}}L_{E}( f)-\frac{1}{n}\sum_{j=1}^{n}L_{P_{j}}(f)+\frac{1}{n}\sum_{j=1}^{n}L_{P_{j}}(f) -\hat{L}_{S_{mn}}(f)\right]$ (21) $\displaystyle\leq\mathop{\mathbb{E}}_{P_{1:n}}\left[\sup_{f\in{\mathcal{F}}}L_ {E}(f)-\frac{1}{n}\sum_{j=1}^{n}L_{P_{j}}(f)\right]+\mathop{\mathbb{E}}_{S_{mn }}\left[\sup_{f\in{\mathcal{F}}}\frac{1}{n}\sum_{j=1}^{n}L_{P_{j}}(f)-\hat{L}_ {S_{mn}}(f)\right],$ (22) $$

where the inequality arises from splitting the supremum into two terms. The theorem will follow by providing upper bounds on each of these expectations and plugging them back into this decomposition. The expectations are bounded using small variations of the symmetrisation argument typically used to prove Rademacher complexity-based generalisation bounds.

The first expectation is bounded by

$$ $\displaystyle\mathop{\mathbb{E}}_{P_{1:n}}\left[\sup_{f\in{\mathcal{F}}}L_{E}( f)-\frac{1}{n}\sum_{j=1}^{n}L_{P_{j}}(f)\right]$ (23) $\displaystyle=\mathop{\mathbb{E}}_{P_{1:n}}\left[\sup_{f\in{\mathcal{F}}} \mathop{\mathbb{E}}_{\tilde{P}_{1:n}}\left[\frac{1}{n}\sum_{j=1}^{n}L_{\tilde{ P}_{j}}(f)\right]-\frac{1}{n}\sum_{j=1}^{n}L_{P_{j}}(f)\right]$ (24) $\displaystyle\leq\mathop{\mathbb{E}}_{P_{1:n}}\mathop{\mathbb{E}}_{\tilde{P}_{ 1:n}}\left[\sup_{f\in{\mathcal{F}}}\frac{1}{n}\sum_{j=1}^{n}(L_{\tilde{P}_{j}} (f)-L_{P_{j}}(f))\right]$ (25) $\displaystyle=\mathop{\mathbb{E}}_{P_{1:n}}\mathop{\mathbb{E}}_{\tilde{P}_{1:n }}\mathop{\mathbb{E}}_{\sigma}\left[\sup_{f\in{\mathcal{F}}}\frac{1}{n}\sum_{j =1}^{n}\sigma_{j}(L_{\tilde{P}_{j}}(f)-L_{P_{j}}(f))\right]$ (26) $\displaystyle\leq\mathop{\mathbb{E}}_{P_{1:n}}\mathop{\mathbb{E}}_{\sigma} \left[\sup_{f\in{\mathcal{F}}}\frac{1}{n}\sum_{j=1}^{n}\sigma_{j}L_{P_{j}}(f) \right]+\mathop{\mathbb{E}}_{\tilde{P}_{1:n}}\left[\sup_{f\in{\mathcal{F}}} \frac{1}{n}\sum_{j=1}^{n}\sigma_{j}L_{\tilde{P}_{j}}(f)\right]$ (27) $\displaystyle=2{\mathcal{R}}_{E^{n}}(\ell\circ{\mathcal{F}}),$ (28) $$

where the first inequality comes from exchanging the supremum and expectations, and the second inequality comes from the subadditivity of suprema.

The second expectation in the decomposition is bounded via Theorem 1, yielding the first part of the result. It also allows us to conclude

$$ $L_{E}(f)\leq\hat{L}_{S_{mn}}(f)+2\hat{{\mathcal{R}}}_{S_{mn}}(\ell\circ{ \mathcal{F}})+2{\mathcal{R}}_{E^{n}}(\ell\circ{\mathcal{F}})+3\sqrt{\frac{\ln 2 /\delta}{2mn}}.$ (29) $$

To obtain the second part of the result, we proceed as follows,

$$ $\displaystyle{\mathcal{R}}_{E^{n}}(\ell\circ{\mathcal{F}})$ $\displaystyle=\mathop{\mathbb{E}}_{P_{1:n}}\left[\sup_{f\in{\mathcal{F}}}\frac {1}{n}\sum_{j=1}^{n}\sigma_{j}L_{P_{j}}(f)\right]$ (30) $\displaystyle\leq\mathop{\mathbb{E}}_{P_{1:n}}\mathop{\mathbb{E}}_{({\mathbf{x }}_{1:n},{\textnormal{y}}_{1:n})}\mathop{\mathbb{E}}_{\sigma}\left[\sup_{f\in{ \mathcal{F}}}\frac{1}{n}\sum_{j=1}^{n}\sigma_{j}\ell(f({\mathbf{x}}_{j}),{ \textnormal{y}}_{j})\right],$ (31) $$

which we observe is the expected value of

$$ $\frac{1}{m}\sum_{i=1}^{m}\hat{{\mathcal{R}}}_{S_{m}^{i}}(\ell\circ{\mathcal{F} }).$ (32) $$

This satisfies the bounded difference property with constant $\frac{1}{mn}$, so from McDiarmid’s inequality, we have for all $f\in{\mathcal{F}}$, with probability at least $1-\delta$,

$$ ${\mathcal{R}}_{E^{n}}(\ell\circ{\mathcal{F}})\leq\frac{1}{m}\sum_{i=1}^{m}\hat {{\mathcal{R}}}_{S_{n}^{i}}(\ell\circ{\mathcal{F}})+\sqrt{\frac{\ln 1/\delta}{ 2mn}}.$ (33) $$

The second part of the theorem follows from combining this with Equation 29 via the union bound.
∎

###### Proof.

## Appendix B Proof of Theorem 3

See 3

###### Proof.

$$ $\displaystyle\mathop{\mathbb{E}}_{S_{mn}}[L_{E}(\hat{f})]-L_{E}(f^{\ast})$ (34) $\displaystyle=\mathop{\mathbb{E}}_{S_{mn}}[L_{E}(\hat{f})-\hat{L}_{S_{mn}}( \hat{f})+\hat{L}_{S_{mn}}(\hat{f})-\hat{L}_{S_{mn}}(f^{\ast})+\hat{L}_{S_{mn}} (f^{\ast})]-L_{E}(f^{\ast})$ (35) $\displaystyle=\mathop{\mathbb{E}}_{S_{mn}}[L_{E}(\hat{f})-\hat{L}_{S_{mn}}( \hat{f})+\hat{L}_{S_{mn}}(\hat{f})-\hat{L}_{S_{mn}}(f^{\ast})]$ (36) $\displaystyle\leq\mathop{\mathbb{E}}_{S_{mn}}[L_{E}(\hat{f})-\hat{L}_{S_{mn}}( \hat{f})]$ (37) $\displaystyle\leq 2\mathop{\mathbb{E}}_{P_{1:n}}\left[{\mathcal{R}}_{P_{1:n}^{ m}}({\mathcal{F}})\right]+2{\mathcal{R}}_{E^{n}}({\mathcal{F}}),$ (38) $$

where the last inequality is due to Theorem 2
∎

###### Proof.

## Appendix C Proof of Theorem 4

We begin with a Theorem bounding the minimax excess risk in terms of Rademacher complexity for the case of i.i.d. learning. This Theorem is a generalisation of result from Sridharan [] that enables the use of the zero–one classification loss, instead of an absolute difference regression loss.

###### Theorem 9 .

Let ${\mathcal{F}}$ be a class of models producing predictions in $\{-1,1\}$, and let $\ell$ be the zero–one loss. We have that the minimax excess risk for problems in ${\mathcal{P}}$ is bounded from below by

$$ $M({\mathcal{F}},{\mathcal{P}},m)\geq\sup_{S_{2m}}\hat{{\mathcal{R}}}_{S_{2m}}( {\mathcal{F}})-\sup_{S_{m}}\frac{1}{2}\hat{{\mathcal{R}}}_{S_{m}}({\mathcal{F} }).$ $$

###### Proof.

Recall that the minimax excess risk is given by,

$$ $M({\mathcal{F}},{\mathcal{P}},m)=\inf_{A}\sup_{P\in{\mathcal{P}}}\left\{ \mathop{\mathbb{E}}_{S_{m}}\left[\mathop{\mathbb{E}}_{({\textnormal{x}},{ \textnormal{y}})}\left[\mathbf{1}({\textnormal{y}}A(S_{m})({\mathbf{x}})<0) \right]\right]-\inf_{f\in{\mathcal{F}}}\mathop{\mathbb{E}}_{({\textnormal{x}}, {\textnormal{y}})}\left[\mathbf{1}({\textnormal{y}}f({\mathbf{x}})<0)\right] \right\}.$ (39) $$

When models in ${\mathcal{F}}$ produce values in $\{-1,1\}$, we note that the zero–one loss can be rewritten as

$$ $\displaystyle\ell_{01}(\hat{y},y)$ $\displaystyle=\mathbf{1}(y\hat{y}<0)$ (40) $\displaystyle=1-\mathbf{1}(y\hat{y}\geq 0)$ (41) $\displaystyle=1-\frac{y\hat{y}+1}{2}.$ (42) $$

The minimax excess risk can therefore be expressed as

$$ $M({\mathcal{F}},{\mathcal{P}},m)=\inf_{A}\sup_{P\in{\mathcal{P}}}\left\{\sup_{ f\in{\mathcal{F}}}\mathop{\mathbb{E}}_{({\mathbf{x}},{\textnormal{y}})}[{ \textnormal{y}}f({\mathbf{x}})]-\mathop{\mathbb{E}}_{S_{m}}\left[\mathop{ \mathbb{E}}_{({\mathbf{x}},{\textnormal{y}})}[{\textnormal{y}}A(S_{m})({ \mathbf{x}})]\right]\right\},$ (43) $$

which can be bounded from below by

$$ $M({\mathcal{F}},{\mathcal{P}},m)\geq\inf_{A}\sup_{{\bm{x}}_{1},...,{\bm{x}}_{2 m}}\sup_{y_{1},...,y_{2m}}\left\{\sup_{f\in{\mathcal{F}}}\frac{1}{2m}\sum_{i=1 }^{2m}y_{i}f({\bm{x}}_{i})-\mathop{\mathbb{E}}_{S_{m}}\left[\frac{1}{2m}\sum_{ i=1}^{2m}y_{i}A(S_{m})({\bm{x}}_{i})\right]\right\},$ (44) $$

where elements in $S_{m}$ are distributed according to the uniform distribution over the $({\bm{x}}_{i},y_{i})$ pairs. We further observe

$$ $\displaystyle M({\mathcal{F}},{\mathcal{P}},m)$ $\displaystyle\geq\inf_{A}\sup_{{\bm{x}}_{1},...,{\bm{x}}_{2m}}\mathop{\mathbb{ E}}_{{\textnormal{y}}_{i}\sim R}\left[\sup_{f\in{\mathcal{F}}}\frac{1}{2m}\sum _{i=1}^{2m}{\textnormal{y}}_{i}f({\bm{x}}_{i})-\mathop{\mathbb{E}}_{S_{m}} \left[\frac{1}{2m}\sum_{i=1}^{2m}{\textnormal{y}}_{i}A(S_{m})({\bm{x}}_{i}) \right]\right]$ (45) $\displaystyle\geq\sup_{{\bm{x}}_{1},...,{\bm{x}}_{2m}}\mathop{\mathbb{E}}_{{ \textnormal{y}}_{i}\sim R}\left[\sup_{f\in{\mathcal{F}}}\frac{1}{2m}\sum_{i=1} ^{2m}{\textnormal{y}}_{i}f({\bm{x}}_{i})\right]$ (46) $\displaystyle\qquad-\sup_{A}\sup_{{\bm{x}}_{1},...,{\bm{x}}_{2m}}\mathop{ \mathbb{E}}_{{\textnormal{y}}_{i}\sim R}\left[\mathop{\mathbb{E}}_{S_{m}\sim P _{U}^{m}}\left[\frac{1}{2m}\sum_{i=1}^{2m}{\textnormal{y}}_{i}A(S_{m})({\bm{x} }_{i})\right]\right],$ (47) $$

where the first inequality arises because we replace the supremum taken over $y_{1},...,y_{2m}\in\{-1,1\}$ with an expectation over Rademacher random variables, ${\textnormal{y}}_{i}\sim R$. The second inequality comes from splitting the infimum and supremum across two terms and subsequently simplifying. The first term is just a worst-case Rademacher complexity, so

$$ $M({\mathcal{F}},{\mathcal{P}},m)\geq\sup_{S_{2m}}\hat{{\mathcal{R}}}_{S_{2m}}( {\mathcal{F}})-\sup_{A}\sup_{{\bm{x}}_{1},...,{\bm{x}}_{2m}}\mathop{\mathbb{E} }_{{\textnormal{y}}_{i}\sim R}\left[\mathop{\mathbb{E}}_{S_{m}}\left[\frac{1}{ 2m}\sum_{i=1}^{2m}{\textnormal{y}}_{i}A(S_{m})({\bm{x}}_{i})\right]\right].$ (48) $$

Denote by $I\subset{\mathbb{N}}^{2m}$ the set of indices determining the ${\bm{x}}_{i}$ in $S_{m}$. The second term can be rewritten as

$$ $\sup_{A}\sup_{{\bm{x}}_{1},...,{\bm{x}}_{2m}}\mathop{\mathbb{E}}_{I\sim U[2m]^ {m}}\left[\mathop{\mathbb{E}}_{{\textnormal{y}}_{i}\sim R}\left[\frac{1}{2m} \sum_{i\in I}{\textnormal{y}}_{i}A(S_{m})({\bm{x}}_{i})\right]\right],$ (49) $$

because the terms in the Rademacher sum corresponding to samples that do not appear in $S_{m}$ will evaluate to zero. This can then be bounded from above by

$$ $\displaystyle\sup_{A}\sup_{{\bm{x}}_{1},...,{\bm{x}}_{2m}}\mathop{\mathbb{E}}_ {I\sim U[2m]^{m}}\left[\mathop{\mathbb{E}}_{{\textnormal{y}}_{i}\sim R}\left[ \frac{1}{2m}\sum_{i\in I}{\textnormal{y}}_{i}A(S_{m})({\bm{x}}_{i})\right]\right]$ $\displaystyle\leq\sup_{S_{m}}\mathop{\mathbb{E}}_{{\textnormal{y}}_{i}\sim R} \left[\sup_{f\in{\mathcal{F}}}\frac{1}{2m}\sum_{{\bm{x}}\in S_{m}}{\textnormal {y}}_{i}f({\bm{x}})\right]$ (50) $\displaystyle=\sup_{S_{m}}\frac{1}{2}\hat{{\mathcal{R}}}_{S_{m}}({\mathcal{F}}),$ (51) $$

which concludes the proof.
∎

The key insight for proving Theorem 4 is encapsulated in the following lemma.

###### Lemma 1 .

For $\gamma\in[0,1]$ we have

$$ $M({\mathcal{F}},{\mathcal{E}},mn)\geq\gamma M({\mathcal{F}},{\mathcal{P}},mn)+ (1-\gamma)M({\mathcal{F}},{\mathcal{P}},n).$ $$

###### Proof.

Let ${\mathcal{E}}_{1}$ be the subset of ${\mathcal{E}}$ consisting of all environments containing only one domain each. Also, let ${\mathcal{E}}_{2}$ be the subset of ${\mathcal{E}}$ consisting of environments where each domain is a point mass. Let $\gamma_{1}=\gamma$ and $\gamma_{2}=1-\gamma$. The minimax excess risk can be lower bounded by

$$ $\displaystyle M({\mathcal{F}},{\mathcal{E}},mn)$ $\displaystyle\geq\inf_{A}\sum_{k=1}^{2}\gamma_{k}\left(\sup_{E\in{\mathcal{E}} _{k}}\left\{\mathop{\mathbb{E}}_{S_{mn}}[L^{01}_{E}(A(S_{mn})]-\inf_{f\in{ \mathcal{F}}}L^{01}_{E}(f)\right\}\right)$ (52) $\displaystyle\geq\sum_{k=1}^{2}\gamma_{k}\left(\inf_{A}\sup_{E\in{\mathcal{E}} _{k}}\left\{\mathop{\mathbb{E}}_{S_{mn}}[L^{01}_{E}(A(S_{mn})]-\inf_{f\in{ \mathcal{F}}}L^{01}_{E}(f)\right\}\right)$ (53) $\displaystyle=\gamma M({\mathcal{F}},{\mathcal{P}},mn)+(1-\gamma)\left(\inf_{A }\sup_{E\in{\mathcal{E}}_{2}}\left\{\mathop{\mathbb{E}}_{S_{mn}}[L^{01}_{E}(A( S_{mn})]-\inf_{f\in{\mathcal{F}}}L^{01}_{E}(f)\right\}\right),$ (54) $$

where the first inequality comes from the supremum of a set being lower bounded by supremum of a subset, the second inequality from a standard property of infima, and the final equality from the definition of ${\mathcal{E}}_{1}$.

We now turn our attention to the second term. Define the function,

$$ $C_{m}(S_{n})=\cup_{i=1}^{m}S_{n}$ (55) $$

Note that, because each $P\sim E\in{\mathcal{E}}$ is a point mass, we have that for every $S_{mn}$ there exists and $S_{n}$ such that $S_{mn}=C_{m}(S_{n})$. Therefore, for every learning algorithm, $A$, that maps from sets of size $mn$ to models, there exists an algorithm $\tilde{A}=A\circ C_{m}$ that maps from the corresponding set of size $n$ to the same model. Therefore,

$$ $\displaystyle\inf_{A}\sup_{E\in{\mathcal{E}}_{2}}\left\{\mathop{\mathbb{E}}_{S _{mn}}[L^{01}_{E}(A(S_{mn})]-\inf_{f\in{\mathcal{F}}}L^{01}_{E}(f)\right\}$ $\displaystyle=\inf_{A}\sup_{P\in{\mathcal{P}}}\left\{\mathop{\mathbb{E}}_{S_{n }}[L^{01}_{P}(A(S_{n})]-\inf_{f\in{\mathcal{F}}}L^{01}_{P}(f)\right\}$ (56) $\displaystyle=M({\mathcal{F}},{\mathcal{P}},n),$ (57) $$

from which the result follows.
∎

We now prove Theorem 4.

See 4

###### Proof.

This is an immediate consequence of Theorem 9 and Lemma 1 with $\gamma=\frac{1}{2}$.
∎

###### Theorem 9 .

###### Proof.

###### Lemma 1 .

###### Proof.

###### Proof.

## Appendix D Proof of Theorem 5

See 5

###### Proof.

First note that

$$ $\displaystyle\mathop{\mathbb{E}}_{S_{mn}}\left[\sup_{f\in{\mathcal{F}}}L_{E}(f )-\hat{L}_{S_{mn}}(f)\right]$ $\displaystyle=\mathop{\mathbb{E}}_{S_{mn}}\left[\sup_{f\in{\mathcal{F}}}L_{E}( f)-\frac{1}{n}\sum_{j=1}^{n}L_{P_{j}}(f)+\frac{1}{n}\sum_{j=1}^{n}L_{P_{j}}(f) -\hat{L}_{S_{mn}}(f)\right]$ (58) $\displaystyle\leq\mathop{\mathbb{E}}_{P_{1:n}}\left[\sup_{f\in{\mathcal{F}}}L_ {E}(f)-\frac{1}{n}\sum_{j=1}^{n}L_{P_{j}}(f)\right]+2{\mathcal{R}}_{P_{1:n}^{m }}({\mathcal{F}}),$ (59) $$

from Theorem 1. Further, we have

$$ $\displaystyle\mathop{\mathbb{E}}_{P_{1:n}}\left[\sup_{f\in{\mathcal{F}}}L_{E}( f)-\frac{1}{n}\sum_{j=1}^{n}L_{P_{j}}(f)\right]$ $\displaystyle\leq\mathop{\mathbb{E}}_{P_{1:n}}\mathop{\mathbb{E}}_{P^{\prime}_ {1:n}}\left[\sup_{f\in{\mathcal{F}}}\frac{1}{n}\sum_{j=1}^{n}(L_{P^{\prime}_{j }}(f)-L_{P_{j}}(f))\right]$ (60) $\displaystyle\leq\mathop{\mathbb{E}}_{P_{1:n}}\mathop{\mathbb{E}}_{P^{\prime}_ {1:n}}\left[\frac{1}{n}\sum_{j=1}^{n}\left(\sup_{f\in{\mathcal{F}}}L_{P^{ \prime}_{j}}(f)-L_{P_{j}}(f)\right)\right],$ (61) $\displaystyle\leq\sigma,$ (62) $$

which yields the first part of the result. The second part of the result follows from the same line of reasoning as used in Theorem 2.
∎

###### Proof.

## Appendix E Proof of Theorem 6

See 6

###### Proof.

For any $E^{\prime}\in{\mathcal{E}}_{CS}$ and $P_{0}\in{\mathcal{P}}$, we define $P\sim E$ as

$$ $P=(1-\sigma)P_{0}+\sigma P^{\prime},$ (63) $$

where $P^{\prime}\sim E^{\prime}$. Observe that $E\in{\mathcal{E}}_{{\mathcal{G}},\sigma}$,

$$ $\displaystyle d_{{\mathcal{G}}}(P_{1},P_{2})$ $\displaystyle=\sup_{g\in{\mathcal{G}}}|\mathop{\mathbb{E}}_{({\mathbf{x}},{ \textnormal{y}})\sim P_{1}}[g({\mathbf{x}},{\textnormal{y}})]-\mathop{\mathbb{ E}}_{({\mathbf{x}},{\textnormal{y}})\sim P_{2}}[g({\mathbf{x}},{\textnormal{y} })]|$ (64) $\displaystyle=\sup_{g\in{\mathcal{G}}}\left|\int_{X\times Y}g({\mathbf{x}},{ \textnormal{y}})\cdot((1-\sigma)dP_{0}+\sigma dP_{1}^{\prime})-\int_{X\times Y }g({\mathbf{x}},{\textnormal{y}})\cdot((1-\sigma)dP_{0}+\sigma dP_{2}^{\prime} )\right|$ (65) $\displaystyle=\sup_{g\in{\mathcal{G}}}\left|\int_{X\times Y}g({\mathbf{x}},{ \textnormal{y}})\cdot\sigma(dP_{1}^{\prime}-dP_{2}^{\prime})\right|$ (66) $\displaystyle=\sigma\sup_{g\in{\mathcal{G}}}\left|\mathop{\mathbb{E}}_{({ \mathbf{x}},{\textnormal{y}})\sim P_{1}^{\prime}}[g({\mathbf{x}},{\textnormal{ y}})]-\mathop{\mathbb{E}}_{({\mathbf{x}},{\textnormal{y}})\sim P_{2}^{\prime}} [g({\mathbf{x}},{\textnormal{y}})]\right|$ (67) $\displaystyle\leq\sigma.$ (68) $$

Let ${\mathcal{E}}_{1}$ be the set of all DG problems that contain only a single domain, and define

$$ ${\mathcal{E}}_{2}=\{E\,|\,E^{\prime}\in{\mathcal{E}}_{CS},\,P_{0}\in{\mathcal{ P}}\}.$ (69) $$

Then we apply the same decomposition used in the proof for Lemma 1,

$$ $\displaystyle M({\mathcal{F}},{\mathcal{E}}_{{\mathcal{G}},\sigma},mn)$ $\displaystyle\geq\inf_{A}\frac{1}{2}\sum_{k=1}^{2}\left(\sup_{E\in{\mathcal{E} }_{k}}\left\{\mathop{\mathbb{E}}_{S_{mn}}[L_{E}^{01}(A(S_{mn}))]-\inf_{f\in{ \mathcal{F}}}L_{E}^{01}(f)\right\}\right)$ (70) $\displaystyle\geq\frac{1}{2}\sum_{k=1}^{2}\left(\inf_{A}\sup_{E\in{\mathcal{E} }_{k}}\left\{\mathop{\mathbb{E}}_{S_{mn}}[L_{E}^{01}(A(S_{mn}))]-\inf_{f\in{ \mathcal{F}}}L_{E}^{01}(f)\right\}\right)$ (71) $\displaystyle=\frac{1}{2}M({\mathcal{F}},{\mathcal{P}},mn)+\frac{1}{2}\left( \inf_{A}\sup_{E\in{\mathcal{E}}_{2}}\left\{\mathop{\mathbb{E}}_{S_{mn}}[L_{E}^ {01}(A(S_{mn}))]-\inf_{f\in{\mathcal{F}}}L_{E}^{01}(f)\right\}\right).$ (72) $$

From the definition of ${\mathcal{E}}_{2}$, we can rewrite the second term as

$$ $\displaystyle\inf_{A}\sup_{E^{\prime},P_{0}}\Bigg{\{}\mathop{\mathbb{E}}_{S_{ mn}}[\sigma L_{E^{\prime}}(A(S_{mn}))+(1-\sigma)L_{P_{0}}(A(S_{mn}))]$ (73) $\displaystyle\qquad-\inf_{f\in{\mathcal{F}}}(\sigma L_{E^{\prime}}(f)+(1- \sigma)L_{P_{0}}(f))\Bigg{\}}$ (74) $\displaystyle\geq\inf_{A}\sup_{E^{\prime},P_{0}}\Bigg{\{}\mathop{\mathbb{E}}_{ P_{1:n}\sim E^{\prime n}}\mathop{\mathbb{E}}_{S_{mn}\sim P_{1:n}^{m}}[\sigma L _{E^{\prime}}(A(S_{mn}))]+\mathop{\mathbb{E}}_{S_{mn}\sim P_{0}^{mn}}[(1- \sigma)L_{P_{0}}(A(S_{mn}))]$ (75) $\displaystyle\qquad-\inf_{f\in{\mathcal{F}}}(\sigma L_{E^{\prime}}(f)+(1- \sigma)L_{P_{0}}(f))\Bigg{\}}$ (76) $$

We proceed by considering two cases. First, assume the optimal model for the worst-case covariate-shift DG problem, $E^{\prime}$, does not have a zero–one error of $1$. Choose $P_{0}$ to be a point mass on one of the points classified correctly by the optimal model. Then the optimal model for $E^{\prime}$ is also optimal for $P_{0}$ and achieves zero error. Noting also that the expected loss of any algorithm on $P_{0}$ is greater than or equal zero, we can further lower bound the above by

$$ $\sigma\inf_{A}\sup_{E^{\prime}\in{\mathcal{E}}_{CS}}\left\{\mathop{\mathbb{E}} _{S_{mn}}[L_{E^{\prime}}(A(S_{mn}))]-\inf_{f}L_{E^{\prime}}(f)\right\}.$ (78) $$

In the case where the optimal model for $E^{\prime}$ does classify every point incorrectly, choose $P_{0}$ to be any point that can be generated by a domain in $\textup{supp}\,E^{\prime}$. The expected loss of any algorithm and the loss of the optimal model are both one, and therefore cancel, yielding the same result as the first case. The main result follows from noting

$$ $\sigma\inf_{A}\sup_{E^{\prime}\in{\mathcal{E}}_{CS}}\left\{\mathop{\mathbb{E}} _{S_{mn}}[L_{E^{\prime}}(A(S_{mn}))]-\inf_{f}L_{E^{\prime}}(f)\right\}=\sigma M ({\mathcal{F}},{\mathcal{E}}_{CS},mn),$ (79) $$

and subsequently applying Lemma 1 with $\gamma=0$.
∎

###### Proof.

## Appendix F Proof of Theorem 7

See 7

###### Proof.

Follow the proof of Theorem 3 until

$$ $\displaystyle\mathop{\mathbb{E}}_{S_{mn}}[L_{E}(\hat{f})]-L_{E}(f^{\ast})$ $\displaystyle\leq 2\rho\mathop{\mathbb{E}}_{P_{1:n}}[{\mathcal{R}}_{P_{1:n}^{m }}(\ell\circ{\mathcal{F}})]+(\rho-1)\mathop{\mathbb{E}}_{S_{mn}}[\hat{L}_{S_{ mn}}(\hat{f})].$ (80) $$

The result follows from applying a change of measure and applying the definition of ${\mathcal{E}}_{\rho}$,

$$ $\displaystyle\mathop{\mathbb{E}}_{S_{mn}}[L_{E}(\hat{f})-\hat{L}_{S_{mn}}(\hat {f})]$ $\displaystyle\leq\mathop{\mathbb{E}}_{P_{1:n}}\mathop{\mathbb{E}}_{S_{mn}} \left[\frac{\rho}{n}\sum_{j=1}^{n}L_{P_{j}}(\hat{f})-\hat{L}_{S_{mn}}(\hat{f})\right]$ (81) $\displaystyle=\mathop{\mathbb{E}}_{P_{1:n}}\mathop{\mathbb{E}}_{S_{mn}}\left[ \frac{\rho}{n}\sum_{j=1}^{n}L_{P_{j}}(\hat{f})-\rho\hat{L}_{S_{mn}}(\hat{f})+ \rho\hat{L}_{S_{mn}}(\hat{f})-\hat{L}_{S_{mn}}(\hat{f})\right]$ (82) $\displaystyle\leq 2\rho\mathop{\mathbb{E}}_{P_{1:n}}[{\mathcal{R}}_{P_{1:n}^{m }}(\ell\circ{\mathcal{F}})]+(\rho-1)\mathop{\mathbb{E}}_{S_{mn}}[\hat{L}_{S_{ mn}}(\hat{f})].$ (83) $$

∎

###### Proof.

## Appendix G Proof of Theorem 8

See 8

###### Proof.

Notice that ${\mathcal{E}}_{1}$ is the set of all DG problems containing a single domain. From the definition of ${\mathcal{E}}_{\rho}$ we have ${\mathcal{E}}_{1}\subseteq{\mathcal{E}}_{\rho}$. So,

$$ $\displaystyle M({\mathcal{F}},{\mathcal{E}}_{\rho},mn)$ $\displaystyle\geq M({\mathcal{F}},{\mathcal{E}}_{1},mn)$ (84) $\displaystyle=M({\mathcal{F}},{\mathcal{P}},mn).$ (85) $$

The result follows by applying Theorem 9.
∎

###### Proof.

## Appendix H Experimental Illustration

We conduct small-scale experiments to illustrate the practical impact of our theoretical results. More specifically, we focus on a modification of the well-known MNIST hand-written digit classification task. We embed the original $28\times 28$ images into a larger $64\times 64$ grid, where each unique placement corresponds to a separate domain. In total there are 1,369 possible ways to place the digit, and from these we select uniformly at random 1,000 domains for training, 169 for validation, and 200 for testing. Additionally, each domain has an associated unique mixture component of rotating the digit, which is used with a probability $\epsilon$. The selected rotations are between $-45^{\circ}$ and $45^{\circ}$. In our experiments we vary the number of training domains to measure its impact on the generalization to new unseen domains. We control the total training set size to be the same across all numbers of domains, and we achieve this by associating each example in the dataset with a unique domain, with balancing the number of examples assigned to each domain. We repeat each experiment with three random seeds and calculate the average.

We use two models: a small Convolutional Neural Network (CNN) with global average pooling, and a Multi-Layer Perceptron (MLP). The purpose of these is to show that having a hypothesis class that includes suitable invariances leads to better excess risk. The CNN model consists of two convolutional layers followed by one dense layer, with global average pooling before the dense layer. The MLP model consists of three dense layers. Both models use ReLU non-linearity activation between the layers. We train each model for 10 epochs using Adam optimizer with learning rate of $0.001$, cross-entropy loss and training minibatch of 64 items. We use early stopping via checkpoint selection, where we evaluate the model on the validation set after each epoch.

Translations and rotations of images can both be represented at permutations of the pixels, so these transforms can therefore can be modelled as a finite group, $G$. The CNN is invariant to the position of the digit, due to the global average pooling layer, but will does not explicitly encode rotation invariance. As such, the class of CNNs we consider is $(G,\epsilon)$-invariant, because we only apply a rotation with probability $\epsilon$. In contrast, the MLP does not encode either of these invariances, so we can expect it will need to see a large number of training domains before being able to approach the optimal within-class risk.

We show the results in Figure 2, comparing the two models with different rotation probabilities, $\epsilon$. When $\epsilon$ is small, very few training domains are needed in order to minimise the excess risk, because the differences in domains is mainly explained by translations. As $\epsilon$ grows, the CNN requires more training domains to converge towards the best possible model for this corresponding DG problem. However, the MLP converges towards the optimal model considerably slower, and at the same rate for all values of $\epsilon$, because it does not have any of the correct built-in invariances.

Figure: Figure 2: The CNN model includes a suitable invariance that helps it generalize across domains better than the MLP model.

## Peer Reviews

confidence: 4
contribution: 2
initial_rating: 3
presentation: 3
questions: --
soundness: 3
strengths: The paper compiles several structural assumptions of "similarity" between the domains (overlap and IPM distance), and works out the upper and lower bounds on what is statistically achievable in both settings.
summary: The paper considers upper bounds for ERM, as well as min-max lower bounds for domain generalization, in settings in which we are given n total environments and m samples per environment. It considers a "fully worst-case" setting in which case no additional structure exists between environments; it also includes "somewhat benign" settings in which some notion of similarity between the environments is bounded (e.g. an IPM distance between the covariate distributions, or a bounded density ration between the covariate distributions). The main claim is that a Rademacher complexity-based upper bound of ERM matches (to leading order) the min-max lower bounds in these settings --- suggesting ERM is the "optimal" thing one can hope for.
weaknesses: On a technical front, the paper is fairly straightforward: since suprema in the Rademacher complexity nicely "split" by triangle inequality, the upper bounds boil down to two application of the standard Rademacher bound machinery. The min-max lower bounds also follow from fairly standard machinery and are fairly expected. 

This of course would be not a problem if the results were surprising or suggested interesting training interventions --- which unfortunately I don't think it's the case here: 
(1) The main reason for a lot of the developments mentioned in the related works and introduction (e.g. the causal modeling view in IRM) was introduced as a richer way to model distribution shift. In fact, in the a lot of the causality-inspired works (e.g. IRM), the goal is not to only do well *in expectation* over environments, but *in the worst case* over some set of environments (e.g. all possible sets of interventions). Because the paper commits to a metric of performance "in expectation" over the choice of environment, and takes a worst-case view over the set of predictors in some class --- the fact that the Rademacher complexity characterizes both the performance of ERM, and the information-theoretic optimum is not surprising. 
(2) The "actionable insights" suggested in the paper (amount of regularization to pick) are also predicated upon the "in-expectation" view of generalizing over a domain distribution. The more typical viewpoint in recent DG work is to focus on a "worst-case" notion of generalization in some set of domains (e.g. all interventions on a subset of variables in a causal graph) --- in which case choosing the regularization strength is much trickier. In fact, as Gulrajani-Lopez Paz show --- a "cheating way" to choose regularization strength in IRM, if allowed to "peek" in the test set, is why a lot of papers over-reported the performance of IRM. 

Overall, I think neither the technical ingredients in the proofs, nor the results themselves stand well on their own.

---

confidence: 3
contribution: 2
initial_rating: 5
presentation: 2
questions: My questions are mainly related to the weaknesses. 
1. Can you provide further explanation of why $\Omega(\frac{1}{\sqrt{mn}} + \frac{1}{\sqrt{n}}) - \Omega(\frac{1}{\sqrt{mn}} + \frac{1}{\sqrt{n}})$ scales as $\Omega(\frac{1}{\sqrt{mn}} + \frac{1}{\sqrt{n}})$ is true?
2. What terms are hiding in $\Omega$?
soundness: 2
strengths: This paper considers the important problem of domain generalization, which is pervasive in modern machine learning. The authors give an interpretation of why ERM performs well under domain generalization setup, which matches the observation in reality.
summary: This paper considers the domain generalization problem, where a model trained on some domain is required to generalize to new domains.  This paper derives upper bounds on the excess risk of ERM, as long as minimax lower bounds for the excess risk. Three settings with different restrictions on the difference of the domains are considered. For all three settings, the authors demonstrate that ERM has an optimal rate of convergence towards the best possible model.
weaknesses: My main concern is that some of this papers' claim is not rigorous. For example, in the discussion of Theorem 4 (equation (11)), the authors claim that the minimax excess risk scales as $\Omega(\frac{1}{\sqrt{mn}} + \frac{1}{\sqrt{n}})$, since the two terms in lower bound are both $\Omega(\frac{1}{\sqrt{mn}} + \frac{1}{\sqrt{n}})$, and $\Omega(\frac{1}{\sqrt{mn}} + \frac{1}{\sqrt{n}}) - \Omega(\frac{1}{\sqrt{mn}} + \frac{1}{\sqrt{n}})$ scales as $\Omega(\frac{1}{\sqrt{mn}} + \frac{1}{\sqrt{n}})$. This claim is not true in general. 

Also, the authors claim that the risk "scales as" something, where many related quantities are hiding in the "$\Omega$". Then they claim that this best-case behaviour matches the worst-case scaling behaviour of ERM, so that ERM already has the optimal scaling behaviour for general DG problems. However, since many things are hiding in the "$\Omega$", I do not think this claim is valuable enough.

---

confidence: 4
contribution: 2
initial_rating: 5
presentation: 3
questions: 1. Suppose we assume that the best predictor $E[Y | X]$ remains the same across all the domains. Can we estimate the predictor at a better rate?  

2. Does the upper bound in Theorem 5 match the lower bound in Theorem 6? 

3. Can we have some understanding/simplification of the result when we have covariate shift (i.e. distribution of $X$ changes but the distribution of $Y|X$ remains same)? 

4. Could we interpret the $\sigma$ parameter as representing the variance of the distribution over domains ($E$), rather than using an IPM? For instance, if $E$ has a very low variance, this would imply that the domains are highly similar, which should lead to an improved rate of convergence. Is this perspective something that can be derived from the paper’s methodology?
soundness: 3
strengths: This paper presents some theoretical results that quantify the difficulty of generalizing to some unseen domain.
summary: This paper presents a theoretical analysis related to the challenges of domain generalization (DG) methods that can reliably perform across varied data distributions. Despite numerous empirical efforts, existing DG methods consistently struggle to outperform empirical risk minimization (ERM). The authors uses tools from empirical process theory and minimax theory to provide upper and lower bounds on the excess risk depending on the number of domains, number of samples per domains and some properties on the distribution of the domains.
weaknesses: The setup of this paper is quite broad, with very general theorems, making it challenging to assess the precise difficulty of the domain generalization problem. One popular approach in domain generalization is invariant risk minimization (IRM), introduced by Arjovsky et al., and subsequently explored in other studies. This line of research aims to identify patterns that are consistent across multiple domains, thereby disregarding spurious correlations that vary across domains. This approach aligns with (and is motivated by) causal inference, which assumes that only the causal components of correlations remain stable across domains.


In this paper, the authors begin with a general setup (Section 3), assuming that distributions are generated i.i.d. from a distribution over the space of distributions. This aligns well with the Bayesian framework, where such a setup is known as a hierarchical prior. However, in the context of domain generalization, if all domains are generated independently and identically, it becomes unclear what form of similarity the model is expected to learn across domains. If there is no notion of similarity we expect to learn from domains, what is the motivation behind borrowing information from various domains? The theorems in Section 3 are fairly basic, applying standard symmetrization techniques, which leads to general but uninformative convergence rates. For instance, the derived rate, $1/\sqrt{mn} + 1/\sqrt{n}$, essentially simplifies to $1/\sqrt{n}$ (as $m > 1$), meaning that the rate depends primarily on the number of domains. This result is unsurprising, given the independence assumed across all domains.

In Section 4, the authors introduce conditions that allow for potentially faster rates, with these conditions depending on the distance between domains. However, it remains unclear whether the upper and lower bounds align precisely or if the dependence on $\sigma$ in the upper bound is optimal.

Additionally, the current presentation of the results may be challenging for readers less familiar with empirical process theory. I suggest assuming a specific complexity measure for the underlying function class (such as covering number) and then expressing the results in terms of $(m, n, \sigma)$ for both the upper and lower bounds.

---

confidence: 5
contribution: 2
initial_rating: 3
presentation: 3
questions: * Please discuss how will the result change under the minimax formulation.
* Please discuss how Theorem 4 will change when $\mathcal{P}$ is altered.
* Please explain the counter example in [2].
soundness: 1
strengths: The paper is generally well-written and easy to follow. Multiple new generalization bounds for the domain generalization problem are derived, which to some extent explain the competitive performance of ERM on DG benchmarks e.g. DomainBed. Several insights are also given based on the theoretical results that can help to improve the performance of ERM under some DG settings.
summary: This paper conducts generalization analysis for the domain generalization problem under the Rademacher complexity framework. The authors derive upper bounds for the domain generalization error and excess risk, and lower bounds for the minimax excess risk. They further extend the results under the bounded Integral Probability Metrics and bounded density ratio settings. Based on their main theoretical results, the authors claim that ERM better approximates the optimal model and no model can substantially outperform ERM under general purpose DG settings.
weaknesses: Given the current results presented by the authors, I have to disagree with the main claims of the paper that no model substantially outperforms ERM. Here are the reasons:

* The problem formulation of DG deviates from the mainstream settings. This paper focuses on minimizing the expected population risk of the model on randomly sampled target domains (eq. 5). This objective is equivalent to ERM on i.i.d sampled domains, but is already shown to be vulnerable to OOD data. Instead, DG is usually formalized as a minimax optimization problem [1] e.g. $\min_f \max_P L_P(f)$, which is not covered in this paper. This results in a different optimal model $f^*$.

* It is consensus that Rademacher complexity is not sufficient to explain generalization of deep learning. To let $\mathcal{R}_m(\mathcal{F})$ scale with $1/\sqrt{m}$, one require $m$ to be significantly larger than the capacity of the models, which is hardly met for modern deep networks. Instead, they can easily fit the given random labeled datasets and we will get $\mathcal{R}_m(\mathcal{F}) \approx 1$ in most cases which invalidates the bounds.

* In the definition of minimax excess risk, $\mathcal{P}$ is considered to be the set of all possible sample distributions over $X \times Y$. This is rarely the case in practice since $X$ and $Y$ always share some common causal relationships among different domains. The authors claim that $\mathcal{P}$ can be easily extended to a certain set of distributions, but to my understanding the proof of Theorem 4 relies on this condition. At (eq. 42 $\to$ eq.43), the labels $y_1$ to $y_{2m}$ can no longer be arbitrarily selected when $\mathcal{P}$ has changed. Thus, the lower bounds may not apply to practical learning settings.

* There is strong evidence that ERM results in poor generalization under certain conditions, e.g. [2]. I do not see conflicts between the settings of [2] and this paper. Explanations on why the results in this paper do not apply to Colored MNIST in [2] should be included.

[1] Sagawa S, Koh PW, Hashimoto TB, Liang P. Distributionally Robust Neural Networks. InInternational Conference on Learning Representations 2019 Sep 25.
[2] Arjovsky M, Bottou L, Gulrajani I, Lopez-Paz D. Invariant risk minimization. arXiv preprint arXiv:1907.02893. 2019 Jul 5.

---

confidence: 1
contribution: 1
initial_rating: 3
presentation: 3
questions: Please refer to weakness
soundness: 2
strengths: - Present theoretical analysis on based on the **Rademacher** complexity measure.
- Lower bound on the minimax excess risk is given.
summary: This paper investigates the problem of DG methods fail to substantially outperform ERM on rigorous DG benchmarks from a learning theory viewpoint. Particularly, the authors show that all learning algorithms converge slowly w.r.t. the number of training domains. For the constrained settings, ERM can achieve optimal learning rate towards the oracle. Overall, the current theoretical findings do not capture the fundamental aspects of DG problem, with conclusions that appear overly assertive.
weaknesses: - The authors show that all learning algorithm converge slowly with respect to the number of training domains, implying lack of algorithmic progress.  Specifically, they  assert universal  ERM optimality under asymptotic conditions with finite domains and samples, potentially overlooking domain-specific invariance properties and structural assumptions. Such a claim is too assertive (A typical example is the CMNIST,  where ERM  consistently performs worse than well-motivated DG algorithms).  Without any specific characterizations on distribution shift [1]，it is unlikely to capture the key factors governing   generalization performance across domains.
    
    [1] **An Information-theoretic Approach to Distribution Shifts, NeurIPS 2021.**
    
- The theoretical results do not involve the algorithm architecture. For modern DNNs, the **Rademacher** complexity bounds are basically vacuous, we cannot gain meaningful insights from the current claims.
- In practical, the i.i.d. assumption of domain is too restrictive to apply. Besides, as shown in previous study [2,3],  proper assumptions about the problem statement and data-generating process plays a key role in characterize DG.
    
    [2] **On learning invariant representations for domain adaptation, ICML 2019.**
    
    [3] **The risks of invariant risk minimization, ICLR 2021.**
    
- The main results are basically rooted in the pioneering theoretical investigation on ERM [4, 5]. The technical contributions on theoretical prove are quite limited.
    
    [4] **Rademacher and Gaussian complexities: Risk bounds and structural results. *JMLR*, 2002**
    
    [5]  **Foundations of Machine Learning, MIT Press, 2018.**

Meta-review: This paper investigates domain generalization (DG) from a learning theory perspective, focusing on the performance of ERM. The authors provide upper and lower bounds for the excess risk in DG settings, considering different assumptions about domain similarity, and conclude that ERM is optimal under certain conditions. While the paper provides useful theoretical insights into domain generalization and ERM, the overall contribution and novelty of the paper are questioned across the reviews.

Decision: Reject