Introduction
Federated Learning (FL) is a transformative framework that allows multiple clients—such as smartphones, IoT devices, or hospitals—to collaboratively train a shared global model without exposing their private data. Despite its privacy-preserving benefits, FL faces a significant hurdle: data heterogeneity. Because data across clients is typically non-Independent and Identically Distributed (non-IID), local models tend to drift apart during training.
Standard FL algorithms rely on Empirical Risk Minimization (ERM), which often converges to "sharp" minima. In these sharp valleys, the training loss is low, but even a minor shift in the data distribution can cause the test error to skyrocket. Consequently, a global model that lands in a sharp minimum for one client might perform poorly for another, leading to poor overall generalization and high performance variance across the network.
Proposed Methods: FedSAM and MoFedSAM
To combat the vulnerabilities of sharp minima in heterogeneous environments, this paper introduces two novel algorithms: FedSAM and MoFedSAM.
1. FedSAM (Federated Sharpness Aware Minimization)
Instead of relying on standard Stochastic Gradient Descent (SGD) for local client updates, FedSAM employs the Sharpness Aware Minimization (SAM) optimizer. SAM does not merely seek the lowest loss point; it actively searches for a neighborhood of low loss. It achieves this by adding a small perturbation ($\delta$) to the model weights in the direction of the steepest gradient ascent. By calculating the gradient at this nearby "worst-case" point, SAM forces the model to settle into flatter regions of the loss landscape.
2. MoFedSAM (Momentum FedSAM)
While FedSAM effectively smooths the local models, MoFedSAM takes this a step further by smoothing the global model directly. It incorporates a momentum term derived from the server’s previous updates into the local training process. This momentum acts as a correction term that bridges the gap between disparate local client objectives and the overarching global goal, effectively smoothing the global loss surface.
Furthermore, the authors provide rigorous theoretical proofs for the convergence rates of both algorithms, establishing a generalization bound for FedSAM using spectral norm analysis and introducing a tighter assumption for the variance of stochastic gradients.
Experimental Setup and Key Insights
The researchers evaluated their algorithms on three standard computer vision benchmarks modified to simulate non-IID federated environments: EMNIST (62 classes), CIFAR-10 (10 classes), and CIFAR-100 (100 classes). To mimic real-world data heterogeneity, they partitioned the data among 100 clients using a Dirichlet distribution, ensuring each client received a unique, unbalanced mix of classes.
Key Insights: * Flatness Drives Generalization: The core insight is that in a highly heterogeneous system, the global model must reside in a "flat" minimum to accommodate distribution shifts between clients. Robustness to small weight perturbations translates directly to robustness against data variations. * Bridging the Local-Global Gap: MoFedSAM’s server-side momentum allows local clients to align with the global trajectory, preventing them from overfitting into sharp, localized minima.
Results
The proposed methods demonstrated significant improvements over existing baselines.
- Superior Accuracy and Convergence: MoFedSAM consistently outperformed benchmarks like FedAvg, SCAFFOLD, and FedCM. For instance, on CIFAR-100, MoFedSAM reached the target accuracy in just 124 communication rounds, compared to 302 rounds for FedAvg and 893 for FedRobust.
- Robustness to Non-IID Data: As data heterogeneity increased, the performance gap between MoFedSAM and baseline methods widened, proving its efficacy in highly skewed scenarios.
- Reduced Client Deviation: The performance disparity between the best and worst local clients was significantly narrowed. In EMNIST trials, MoFedSAM notably reduced the standard deviation of validation accuracy across clients compared to FedAvg.
Limitations and Future Work
Despite its strong performance, the approach has a few limitations:
- Computational Overhead: The SAM optimizer requires two forward and backward passes per update step—one to find the perturbation and one to calculate the final gradient. This essentially doubles the local computation time, which could bottleneck battery-constrained edge devices.
- Hyperparameter Sensitivity: The perturbation radius ($\rho$) and momentum rate ($\beta$) require careful tuning. The optimal $\rho$ varied across datasets, suggesting that developing an adaptive $\rho$ mechanism is a promising direction for future research.
- Communication Costs: While it does not introduce new communication overhead compared to other momentum-based FL methods, MoFedSAM still requires transmitting momentum buffers, making it more data-intensive than standard FedAvg.
Summary updated