A Fast and Flat Federated Learning Method via Weighted Momentum and Sharpness-Aware Minimization

Tianle Li, Yongzhi Huang, Linshan Jiang, Chang Liu, Qipeng Xie, Wenfeng Du, Lu Wang, Kaishun Wu · DOI

Abstract

Federated Learning (FL) faces significant challenges in balancing convergence speed and model generalization, particularly under conditions of high data heterogeneity. While momentum and Sharpness-Aware Minimization (SAM) are standard techniques for addressing these goals, their naive combination in FL leads to structural failures such as local-global curvature misalignment and momentum-echo oscillations. We present FedWMSAM, a novel optimizer that harmonizes these techniques. FedWMSAM utilizes server-aggregated momentum to guide local perturbations, implements personalized momentum with correction to mitigate client drift, and employs a cosine-similarity adaptive weighting rule to transition from fast momentum-driven updates to flat SAM-driven refinement. Empirical results on benchmarks like CIFAR-100 and OfficeHome demonstrate that FedWMSAM achieves superior generalization and significantly faster convergence with minimal computational overhead.

Introduction

In the landscape of Federated Learning (FL), the dual objectives of rapid convergence and robust generalization are often at odds. Standard optimization tools like momentum are employed to accelerate training by dampening oscillations, while Sharpness-Aware Minimization (SAM) is used to seek "flat" regions of the loss landscape to improve generalization. However, simply integrating these methods in a federated setting often results in failure due to data heterogeneity across decentralized clients.

Researchers from Shenzhen University and HKUST (Guangzhou) identify two primary failure modes:

  1. Local-Global Curvature Misalignment: Local SAM perturbations often contradict the global descent path because they are calculated based on biased local data.
  2. Momentum-Echo Oscillation: Accumulated momentum can cause the model to overshoot stable, flat optima in the late stages of training.

The FedWMSAM Framework

FedWMSAM introduces three core components to bridge the gap between local updates and global optimization goals:

  • Momentized Global Perturbation: Instead of a costly second backpropagation, FedWMSAM uses server-aggregated momentum as a "global geometric carrier." This aligns local updates with the global loss geometry while maintaining the computational efficiency of a single backpropagation.
  • Personalized Momentum with Correction: Utilizing a correction term to estimate bias from local data, this component effectively mitigates "client drift," ensuring local updates remain relevant to the global model.
  • Cosine-Similarity Adaptive Weighting: The algorithm dynamically adjusts the balance between momentum and SAM. Early in training, momentum dominates for speed; as updates become noisier, the weight shifts toward SAM to ensure the model settles into a robust, flat region.
Overview of the FedWMSAM components: Personalized Momentum, Momentum-based Perturbation, and Dynamic Weight Adjustment.

Experimental Evaluation

The authors evaluated FedWMSAM using standard benchmarks configured for high heterogeneity, including Fashion-MNIST, CIFAR-10, CIFAR-100, and the domain-diverse OfficeHome dataset.

Key Results

  • Accuracy and Generalization: On CIFAR-100 with high data imbalance, FedWMSAM reached 46.46% accuracy, an 8.31% improvement over the FedAvg baseline. t-SNE visualizations further confirmed that FedWMSAM produces more compact and clearly separated feature clusters.
  • Convergence Speed: FedWMSAM reached target accuracy levels significantly faster than competitors. For CIFAR-10, it required only 97 rounds to hit 0.70 accuracy, compared to 254 rounds for FedAvg.
  • Efficiency: Per-round training time remained nearly identical to FedAvg (~15 seconds), avoiding the ~27-second overhead typical of double-backprop SAM methods.
Comparison of test accuracy over communication rounds, highlighting the faster convergence and better performance of FedWMSAM compared to standard baselines.

Conclusion

FedWMSAM effectively addresses the structural incompatibilities between momentum and SAM in federated environments. By "recycling" momentum information to guide global perturbations and employing adaptive weighting, it achieves the "fast and flat" ideal with high efficiency. Future work will focus on refining hyperparameter tuning for the decay factor and extending the framework to Natural Language Processing and Graph Learning tasks.

Summary updated

BibTeX
@inproceedings{li2025fast,
  author = {Tianle Li and Yongzhi Huang and Linshan Jiang and Chang Liu and Qipeng Xie and Wenfeng Du and Lu Wang and Kaishun Wu},
  title = {{A Fast and Flat Federated Learning Method via Weighted Momentum and Sharpness-Aware Minimization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=75JiIa0fU1},
}
Figure