A precise mathematical framework is established for federated learning, addressing its fundamental workflow and challenges like data and systems heterogeneity. Defining the optimization problem precisely is essential for understanding, analyzing, and developing advanced federated algorithms.
Federated learning aims to train a single global model using data distributed across numerous clients without centralizing that data. The objective is typically formulated as minimizing a global loss function, which represents an aggregation of individual loss functions computed locally on each client's data.
The Global Objective Function
The standard goal in federated optimization is to find model parameters w that minimize a global objective function F(w). This function is usually defined as a weighted average of the local objective functions Fk(w) from each client k:
F(w)=k=1∑NpkFk(w)
Let's break down the components of this equation:
- w: Represents the parameters of the machine learning model (e.g., weights and biases of a neural network) that we aim to optimize. This is the global model shared across all clients.
- N: The total number of clients participating in the federated learning process (or a subset selected in a given round).
- k: An index identifying a specific client, ranging from 1 to N.
- Fk(w): The local objective function for client k. This function measures how well the current global parameters w perform on client k's local dataset, Dk. It quantifies the local empirical risk.
- pk: A weight assigned to client k, determining its influence on the global objective. A common choice is to weight clients proportionally to the amount of data they hold. If nk=∣Dk∣ is the number of data samples on client k, and n=∑k=1Nnk is the total number of samples across all clients, then a typical weighting is:
pk=nnk
This ensures that clients contributing more data have a proportionally larger impact on the final global model. Other weighting schemes exist, such as uniform weighting (pk=1/N), which might be preferred if data sizes are unknown or if equal contribution from each client is desired regardless of data quantity. Note that ∑k=1Npk=1 is usually required.
The Local Objective Function
The local objective function Fk(w) is typically the average loss of the model with parameters w over client k's local data Dk. For a supervised learning task with data points (xj,yj), where xj is the input feature vector and yj is the target label, Fk(w) can be expressed as:
Fk(w)=nk1j∈Dk∑ℓ(w;xj,yj)
Here, ℓ(w;xj,yj) is the loss function chosen for the specific task, such as cross-entropy loss for classification or mean squared error for regression. It measures the prediction error for a single data point.
A critical aspect, revisited from the challenges section, is that the data distributions across clients (Dk) are often not independent and identically distributed (Non-IID). This statistical heterogeneity means that the local objective functions Fk(w) can differ significantly from one another. The optimal parameters for one client's data might perform poorly for another's.
The Optimization Goal
The ultimate goal of the federated optimization process is to find the set of global parameters w∗ that minimizes the global objective function F(w):
w∗=argwminF(w)=argwmink=1∑NpkFk(w)
Solving this minimization problem presents unique difficulties compared to traditional centralized machine learning:
- Data Decentralization: The datasets Dk remain on the local clients and cannot be pooled together on a central server. Standard optimization algorithms that require direct access to the full dataset are inapplicable.
- Communication Constraints: Optimization must proceed via iterative communication between a central server (or coordinator) and the clients. Communication rounds are often slow and expensive, becoming a significant bottleneck.
- Heterogeneity: As mentioned, statistical heterogeneity (Non-IID data) means that ∇Fk(w) (the local gradient) can be a poor approximation of ∇F(w) (the global gradient). System heterogeneity (varying compute power, network speeds, availability) further complicates synchronous updates.
Federated optimization algorithms, like the widely used Federated Averaging (FedAvg), are specifically designed to find an approximate solution w∗ under these constraints. They typically involve rounds of local computation on clients (e.g., performing multiple steps of stochastic gradient descent on the local objective Fk(w)) followed by aggregation of updates (e.g., model parameters or gradients) at the server to update the global model w.
This mathematical formulation provides a clear objective for federated learning. Understanding this objective is the first step towards appreciating the design and analysis of the advanced algorithms discussed in subsequent chapters, which aim to solve this problem more efficiently, robustly, and privately.