Tackling the Non-IID Issue in Heterogeneous Federated Learning by Gradient Harmonization

Xinyu Zhang, Weiyu Sun, Ying Chen · DOI

Abstract: Federated Learning (FL) faces significant challenges when data is distributed non-identically and independently (non-IID) across clients, leading to "local drift" and conflicting updates. This paper proposes FedGH (Federated Gradient Harmonization), a server-side aggregation strategy that detects and resolves gradient conflicts through orthogonal projection. By aligning divergent client updates, FedGH achieves superior convergence rates and final model accuracy across diverse computer vision and NLP benchmarks without requiring additional hyperparameter tuning.

Introduction

In Federated Learning, a central server aggregates model updates from distributed clients to train a global model while preserving data privacy. However, real-world data is often highly heterogeneous (non-IID). This heterogeneity causes local models to optimize for their specific data distributions, leading to "local drift" where client updates point in divergent or even opposing directions. On the server side, these opposing updates manifest as gradient conflicts, where the aggregation process effectively cancels out valuable local knowledge, slowing down convergence and degrading global model performance.

The FedGH Framework

FedGH addresses the non-IID challenge by modifying the server-side aggregation step. Unlike existing methods that impose constraints on local client training (e.g., FedProx), FedGH is a "plug-and-play" module that operates solely on the server.

The core mechanism involves two steps:

  1. Conflict Detection: The server monitors the cosine similarity between pairs of client gradients. A negative similarity indicates an obtuse angle, signifying a fundamental conflict in the direction of optimization.
  2. Harmonization via Projection: When a conflict is detected between two gradients $g_i$ and $g_j$, FedGH projects $g_i$ onto the orthogonal plane of $g_j$. This process removes the component of $g_i$ that directly opposes $g_j$, effectively "harmonizing" the updates so they no longer work against each other while retaining the unique information provided by each client.
Figure 5: Visualization of the gradient harmonization process. Conflicting gradients are projected onto orthogonal planes to eliminate opposing components while preserving local knowledge.

Empirical Analysis of Gradient Conflict

The authors' research highlights a direct correlation between data heterogeneity and the severity of gradient conflicts. While minor conflicts can occur even in IID settings due to stochasticity, non-IID distributions lead to significantly more frequent and "violent" conflicts.

Figure 3: Conflict ratio across communication rounds for different data distributions. Non-IID settings (Dirichlet $\alpha=0.1$) exhibit much higher and more persistent conflict ratios compared to IID settings.

As shown in Figure 3, the conflict ratio in non-IID scenarios quickly rises and stabilizes at a high level (around 0.6-0.7), whereas IID training maintains a near-zero conflict ratio. FedGH mitigates this by discarding the "noise"—the components of updates that would cause the global model to deviate from the true global minimum—thereby facilitating a more stable path to consensus.

Experimental Evaluation

FedGH was evaluated on a comprehensive set of benchmarks, including CIFAR-10/100, Tiny-ImageNet, and the LEAF suite (Celeba, FEMNIST, Twitter, Shakespeare, Reddit).

Key findings include:

  • Performance Gains: FedGH consistently outperformed standard baselines like FedAvg and FedProx. Notably, it provided a >5% accuracy boost on the FEMNIST dataset.
  • Efficiency: The method demonstrated a 2.3x speedup in communication rounds on the Celeba benchmark, reaching target accuracy significantly faster than competing methods.
  • Practicality: A major advantage of FedGH is its lack of hyperparameters. While methods like FedProx require tuning a regularization term ($\mu$), FedGH works "out of the box," making it highly suitable for large-scale, real-world FL deployments.

Conclusion and Future Work

FedGH offers a robust, server-side solution to the persistent problem of non-IID data in Federated Learning. By mathematically harmonizing conflicting updates, it ensures that the global model benefits from the diverse knowledge of all clients without being derailed by local drift.

Future research directions include addressing the $O(K^2)$ computational complexity of pairwise gradient comparisons for very large client pools and exploring the interaction between gradient projection and privacy-preserving techniques like Differential Privacy.

Summary updated

BibTeX
@misc{zhang2023tackling,
  author = {Xinyu Zhang and Weiyu Sun and Ying Chen},
  title = {{Tackling the Non-IID Issue in Heterogeneous Federated Learning by Gradient Harmonization}},
  year = {2023},
  eprint = {2309.06692},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2309.06692},
}
Figure