Abstract
The domain generalization (DG) problem setting challenges a model trained on multiple known data distributions to generalise well on unseen data distributions. Due to its practical importance, a large number of methods have been proposed to address this challenge. However much of the work in general purpose DG is heuristically motivated, as the DG problem is hard to model formally; and recent evaluations have cast doubt on existing methods' practical efficacy -- in particular compared to a well tuned empirical risk minimisation baseline. We present a novel learning-theoretic generalisation bound for DG that bounds unseen domain generalisation performance in terms of the model's Rademacher complexity. Based on this, we conjecture that existing methods' efficacy or lack thereof is largely determined by an empirical risk vs predictor complexity trade-off, and demonstrate that their performance variability can be explained in these terms. Algorithmically, this analysis suggests that domain generalisation should be achieved by simply performing regularised ERM with a leave-one-domain-out cross-validation objective. Empirical results on the DomainBed benchmark corroborate this.
Introduction
Machine learning models are notoriously brittle; they perform well on training data but often fail when deployed "in the wild" where the data distribution shifts. The field of Domain Generalization (DG) aims to mitigate this by training on multiple source domains to create a model that generalizes to unseen target domains. However, recent large-scale empirical studies, such as the DomainBed benchmark, have shown that specialized DG algorithms rarely outperform simple Empirical Risk Minimization (ERM)—the baseline method of pooling all data and training normally. This paper provides a theoretical explanation for this observation, suggesting that ERM is often asymptotically optimal for the DG task.
The Domain Generalization Problem Setting
To understand why complex algorithms struggle to beat the baseline, we must first formalize the DG setting. In this framework, we assume an underlying environment $E$ that generates different domains. During the training phase, we observe $n$ domains $P_j$, each providing $m$ samples $(x_i, y_i)$. The goal is to learn a predictor that performs well on a new, unseen domain $P$ also sampled from $E$.
Theoretical Analysis: The Optimality of ERM
The authors utilize statistical learning theory—specifically Rademacher complexity—to analyze the "excess risk," which is the gap between a model's performance and the theoretical optimum. They derive upper bounds for ERM and lower bounds for minimax risk across several scenarios, including covariate shift and bounded density ratios.
A key finding is the $1/\sqrt{n}$ bottleneck. In general covariate shift, the error is limited by the total number of samples ($mn$) and the number of training domains ($n$). The risk scales with $O(1/\sqrt{mn} + 1/\sqrt{n})$. Because ERM already matches this scaling behavior, it is mathematically impossible for specialized algorithms to fundamentally improve the rate at which they approach the optimal model in these general settings. In short, ERM is minimax optimal for general-purpose DG.
The Role of Model Architecture
If the training algorithm (ERM) is already optimal, how can we improve generalization? The paper argues that the path forward lies in the hypothesis class (the model architecture) rather than the loss function.
If a model possesses built-in invariances—such as a Convolutional Neural Network (CNN) having translation invariance—it effectively reduces the perceived distance between domains. This architectural choice "shrinks" the hypothesis class in a way that makes the $1/\sqrt{n}$ term less punishing. This suggests that researchers should focus more on automated architecture search or meta-learning to find models that naturally possess the right inductive biases for a given problem.
Empirical Validation
While primarily theoretical, the paper includes experiments on a modified MNIST dataset to illustrate these concepts. By embedding 28x28 digits into a 64x64 grid at various positions (creating 1,369 possible domains), the authors compared a simple Multi-Layer Perceptron (MLP) against a CNN with global average pooling.
The results confirmed the theory: the CNN, which has built-in translation invariance, converged to the optimal risk significantly faster than the MLP. Crucially, the CNN required far fewer unique domains to reach a low error rate because its architecture already "understood" the nature of the domain shift (spatial translation).
Conclusion
This work explains the "missing" performance of complex DG algorithms by showing that ERM is already asymptotically optimal in terms of complexity scaling. The variability in performance seen in benchmarks like DomainBed can be explained by the trade-off between empirical risk and predictor complexity. Future progress in domain generalization is likely to come from designing architectures with appropriate invariances rather than inventing increasingly complex training objectives.
Summary updated