Abstract
A key learning scenario in large-scale applications is that of federated learning, where a centralized model is trained based on data originating from a large number of clients. We argue that, with the existing training and inference, federated models can be biased towards different clients. Instead, we propose a new framework of agnostic federated learning, where the centralized model is optimized for any target distribution formed by a mixture of the client distributions. We further show that this framework naturally yields a notion of fairness. We present data-dependent Rademacher complexity guarantees for learning with this objective, which guide the definition of an algorithm for agnostic federated learning. We also give a fast stochastic optimization algorithm for solving the corresponding optimization problem, for which we prove convergence bounds, assuming a convex loss function and hypothesis set. We further empirically demonstrate the benefits of our approach in several datasets. Beyond federated learning, our framework and algorithm can be of interest to other learning scenarios such as cloud computing, domain adaptation, drifting, and other contexts where the training and test distributions do not coincide.
Introduction
In traditional Federated Learning (FL), a central server aggregates updates from thousands or millions of edge devices to train a global model. Typically, the objective is to minimize the uniform average loss across all available data. While effective for maximizing aggregate performance, this strategy is inherently risky.
In real-world deployments, the distribution of data seen during training (e.g., users with high-end devices and consistent connectivity) often fails to match the distribution at test time or across diverse demographics. If a model achieves 95% accuracy for a majority group but only 50% for a minority, the "average" performance remains high, yet the model is biased and potentially unusable for the underrepresented group. This paper introduces Agnostic Federated Learning (AFL) to address this disparity, ensuring models perform well regardless of the specific mixture of client distributions encountered at test time.
The Agnostic Framework
The core of AFL is a shift from simple empirical risk minimization to a minimax optimization problem. Instead of minimizing the average loss, the learner seeks a hypothesis $h$ that performs robustly even when an "adversary" selects the worst possible mixture ($\lambda$) of client distributions.
By defining an "agnostic loss," the framework ensures that the model is optimized for any target distribution formed by a mixture of the client domains. This approach effectively treats the target distribution as unknown, assuming only that it resides within the convex hull of the training distributions.
Methodology and Fairness
Good-Intent Fairness
A significant finding of this work is that the minimax framework naturally yields a form of fairness. By minimizing the maximum loss among different groups (e.g., different demographics or device types), the optimization process is forced to prioritize the groups where the model is currently performing worst. This makes fairness a structural component of the objective rather than a post-processing step.
The STOCHASTIC-AFL Algorithm
Solving minimax problems is notoriously difficult due to potential instabilities. The authors propose STOCHASTIC-AFL, an algorithm where the server maintains two sets of weights: the model parameters ($w$) and the mixture weights ($\lambda$). In each iteration, the algorithm updates the model to decrease loss while simultaneously updating the mixture weights to identify the domains where the model is struggling.
Theoretical Guarantees
The paper provides new generalization bounds using Rademacher complexity. These bounds introduce a "skewness" term that accounts for the deviation of the target distribution from the training sample sizes, providing a mathematical foundation for the algorithm's robustness.
Experimental Evaluation
The authors evaluated AFL across three distinct domains to demonstrate its versatility:
- Adult Dataset (UCI): Used to predict income levels. By splitting the data into "doctorate" and "non-doctorate" domains, the authors showed that while a uniform model had high overall accuracy, it failed the smaller "doctorate" group. AFL significantly improved worst-case performance, creating a more equitable model.
- Fashion MNIST: In a task involving clothing classification, AFL improved accuracy on the "shirt" class—the most difficult category—without significantly degrading performance on easier classes.
- Language Modeling: Simulating a mobile keyboard app using the Cornell Movie Dialogues and Penn Treebank datasets, AFL produced a model with superior perplexity on the worst-performing domain, proving more robust to shifts in writing styles (conversational vs. document-style).
Key Insights and Discussion
- Risk Aversion: AFL acts as a risk-averse version of FL. It may sacrifice a marginal amount of "average" performance to ensure that no single group suffers from a catastrophic error rate.
- Domain Clustering: In systems with millions of clients, treating every user as a separate domain is computationally intractable. The authors suggest clustering users into meaningful groups (e.g., by language or device type) to keep the agnostic optimization efficient.
- Limitations: While the theoretical proofs assume a convex loss function, empirical results show success with non-convex neural networks. However, formal guarantees for non-convex cases remain an open research area. Additionally, the minimax approach may require more iterations to converge than standard minimization, potentially increasing communication overhead in federated settings.
Conclusion
Agnostic Federated Learning provides a mathematically grounded framework for achieving fairness and robustness in distributed systems. By moving beyond the "average user" trap, AFL ensures that machine learning models remain reliable across diverse and shifting data distributions, making it a valuable tool for cloud computing, domain adaptation, and large-scale mobile applications.
Summary updated