[Paper Review] Gradient Masked Averaging for Federated Learning
This paper proposes Gradient Masked Averaging (GMA), a novel aggregation method for federated learning that improves generalization in non-i.i.d. settings by emphasizing gradient components with consistent direction across clients while downweighting inconsistent ones. GMA outperforms standard averaging, especially under data heterogeneity and client participation imbalance, with consistent gains across multiple datasets and algorithms.
Federated learning (FL) is an emerging paradigm that permits a large number of clients with heterogeneous data to coordinate learning of a unified global model without the need to share data amongst each other. A major challenge in federated learning is the heterogeneity of data across client, which can degrade the performance of standard FL algorithms. Standard FL algorithms involve averaging of model parameters or gradient updates to approximate the global model at the server. However, we argue that in heterogeneous settings, averaging can result in information loss and lead to poor generalization due to the bias induced by dominant client gradients. We hypothesize that to generalize better across non-i.i.d datasets, the algorithms should focus on learning the invariant mechanism that is constant while ignoring spurious mechanisms that differ across clients. Inspired from recent works in Out-of-Distribution generalization, we propose a gradient masked averaging approach for FL as an alternative to the standard averaging of client updates. This aggregation technique for client updates can be adapted as a drop-in replacement in most existing federated algorithms. We perform extensive experiments on multiple FL algorithms with in-distribution, real-world, feature-skewed out-of-distribution, and quantity imbalanced datasets and show that it provides consistent improvements, particularly in the case of heterogeneous clients.
Motivation & Objective
- Address the challenge of model performance degradation in federated learning due to data heterogeneity across clients.
- Overcome the bias and information loss introduced by standard averaging of client model updates in non-i.i.d. settings.
- Improve generalization by focusing on invariant mechanisms across clients while suppressing spurious, client-specific patterns.
- Develop a plug-in aggregation method compatible with existing federated algorithms to enhance robustness without architectural changes.
- Demonstrate consistent performance gains across diverse datasets, including in-distribution, out-of-distribution, and quantity-imbalanced settings.
Proposed method
- Compute the sign of each gradient component across all clients to determine component-wise agreement on update direction.
- Construct a soft-masking matrix based on the agreement score, where higher agreement leads to higher weight in the final update.
- Apply the mask to client gradients before averaging, emphasizing directions where clients agree and attenuating conflicting updates.
- Use the masked gradient average as the global model update, replacing standard FedAvg-style averaging.
- Integrate GMA as a drop-in replacement in existing federated algorithms such as FedAvg, requiring no changes to client training procedures.
- The masking mechanism is differentiable and stable, with theoretical convergence and stability analysis provided in the supplementary materials.
Experimental results
Research questions
- RQ1Can gradient masking improve generalization in federated learning under non-i.i.d. data distributions compared to standard averaging?
- RQ2How does GMA perform under feature-skewed and quantity-imbalanced data distributions common in real-world FL settings?
- RQ3Does GMA provide stronger performance gains for non-participating clients in rounds with partial client participation?
- RQ4How does the performance of GMA scale with increasing numbers of clients and local training epochs?
- RQ5Can GMA enhance convergence and robustness in convex optimization settings like logistic regression on MNIST?
Key findings
- On FMNIST with 10 clients and non-i.i.d. data, GMA improved test accuracy by 2.4% on participating clients and 4.6% on non-participating clients compared to standard averaging.
- On CIFAR-10 with 100 clients and Dirichlet-based quantity skew (β=0.5), GMA outperformed standard averaging, demonstrating robustness under extreme data imbalance.
- In a convex setting with MNIST and logistic regression, GMA achieved 88.5% test accuracy under non-i.i.d. data, compared to 87.0% with standard averaging.
- GMA showed consistent improvements across multiple algorithms and datasets, with larger gains in heterogeneous and imbalanced settings.
- The ablation study confirmed that GMA’s advantage increases with higher client count and more local epochs, indicating stronger resilience to client drift and data heterogeneity.
- The method demonstrated enhanced stability and convergence, with theoretical analysis supporting its robustness and convergence properties.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.