Understanding and Improving Model Averaging in Federated Learning on Heterogeneous Data

Tailin Zhou, Zehong Lin, Jun Zhang, Danny H. K. Tsang
5/13/2023
36 citations
cs.LGcs.AI
federated

Official code: TailinZhou/FedIMA (9 stars, Python, last commit 2024-06-28).

Abstract

Model averaging is a widely adopted technique in federated learning (FL) that aggregates multiple client models to obtain a global model. Remarkably, model averaging in FL yields a superior global model, even when client models are trained with non-convex objective functions and on heterogeneous local datasets.

Show full abstract

However, the rationale behind its success remains poorly understood. To shed light on this issue, we first visualize the loss landscape of FL over client and global models to illustrate their geometric properties. The visualization shows that the client models encompass the global model within a common basin, and interestingly, the global model may deviate from the basin's center while still outperforming the client models. To gain further insights into model averaging in FL, we decompose the expected loss of the global model into five factors related to the client models. Specifically, our analysis reveals that the global model loss after early training mainly arises from \textit{i)} the client model's loss on non-overlapping data between client datasets and the global dataset and \textit{ii)} the maximum distance between the global and client models. Based on the findings from our loss landscape visualization and loss decomposition, we propose utilizing iterative moving averaging (IMA) on the global model at the late training phase to reduce its deviation from the expected minimum, while constraining client exploration to limit the maximum distance between the global and client models. Our experiments demonstrate that incorporating IMA into existing FL methods significantly improves their accuracy and training speed on various heterogeneous data setups of benchmark datasets. Code is available at \url{https://github.com/TailinZhou/FedIMA}.

View on arXivView PDF

Code Implementations(1)

TailinZhou/FedIMAOfficial100%

The open-source code of our paper: ''Understanding and Improving Model Averaging in Federated Learning on Heterogeneous Data'', accepted by IEEE TMC.

91Python, Jupyter NotebookJan 30, 20242 years ago

Similar Papers

Cite this paper

@article{zhou2023understanding,
  title  = {Understanding and Improving Model Averaging in Federated Learning on Heterogeneous Data},
  author = {Tailin Zhou and Zehong Lin and Jun Zhang and Danny H. K. Tsang},
  year   = {2023},
  eprint = {2305.07845},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.07845v4}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2305.07845.svg)](https://codeofpaper.com/paper/2305.07845)

Discussion