AdamW has become one of the most effective optimizers for training large-scale models. We have also observed its effectiveness in the context of federated learning (FL). However, directly applying AdamW in federated learning settings poses significant challenges: (1) due to data heterogeneity, AdamW often yields high variance in the second-moment estimate ; (2) the local overfitting of AdamW may cause client drift; and (3) Reinitializing moment estimates (, ) at each round slows down convergence. To address these challenges, we propose the first \underline{Fed}erated \underline{AdamW} algorithm, called , for training and fine-tuning various large models. aligns local updates with the global update using both a and decoupled weight decay to mitigate local overfitting. efficiently aggregates the of the second-moment estimates to reduce their variance and reinitialize them. Theoretically, we prove that achieves a linear speedup convergence rate of without , where is the number of participating clients per round, is the number of local iterations, and is the total number of communication rounds. We also employ PAC-Bayesian generalization analysis to explain the effectiveness of decoupled weight decay in local training. Empirically, we validate the effectiveness of on language and vision Transformer models. Compared to several baselines, significantly reduces communication rounds and improves test accuracy. The code is available in https://github.com/junkangLiu0/FedAdamW.

生成讲解博客的中文版本

生成AI智能校验的中文版本