LEGATO: A LayerwisE Gradient AggregaTiOn Algorithm for Mitigating Byzantine Attacks in Federated Learning

Kamala Varma, Yi Zhou, Nathalie Baracaldo, Ali AnwarCLOUD 2021

TL;DR

LEGATO is a novel aggregation algorithm for Federated Learning (FL) designed to protect global models from "Byzantine" (malicious or faulty) workers. By dynamically reweighting gradients at the layer level based on historical variance, LEGATO achieves superior robustness in non-IID (heterogeneous) data settings where traditional defenses often fail, all while maintaining linear computational efficiency.

The Challenge: Byzantine Attacks in Non-IID Federated Learning

Federated Learning allows multiple parties to train a shared model without exchanging raw data. However, this decentralized nature creates a significant security vulnerability: Byzantine attacks. A single malicious worker can send "poisoned" gradients to the central server, potentially derailing the training process or installing backdoors.

Existing defenses, such as Krum or Coordinate Median, rely on the assumption that "honest" gradients are similar. This assumption often fails in real-world non-IID (Independent and Identically Distributed) settings. For example, if different hospitals have distinct patient demographics, their honest gradients will naturally diverge. Traditional robust aggregators often mistake this natural diversity for an attack, leading to poor model performance. Furthermore, many current defenses are computationally expensive ($O(n^2)$), making them difficult to scale to thousands of workers.

The LEGATO Approach: Layer-wise Resilience

LEGATO (LayerwisE Gradient AggregatTiOn) shifts the focus from filtering out entire workers to dampening specific noisy layers. The core insight stems from a pilot study showing that Byzantine noise is not distributed equally across a neural network; bias layers and earlier layers tend to exhibit much higher variance under attack than weight layers or deeper layers.

Normalized L2 norms of different neural network layers under attack, showing that bias layers exhibit significantly higher variance than weight layers.

Methodology

  1. Dynamic Reweighting: LEGATO maintains a small log of recent gradients. For every training round, it calculates a "robustness factor" for each layer based on the reciprocal of the standard deviation of its normalized $\ell_2$ norms over time.
  2. The Aggregation Rule: Instead of simple averaging, LEGATO reconfigures updates. Layers identified as "vulnerable" (high historical variance) are dampened, relying more on the average of past gradients. "Robust" layers (low variance) are allowed to contribute more current information.
  3. Efficiency: Unlike algorithms that compare every worker to every other worker, LEGATO’s complexity is $O(dn)$, where $d$ is the number of parameters and $n$ is the number of workers. This linear scaling makes it as efficient as standard non-robust averaging.

Key Results

The authors evaluated LEGATO using MNIST and CIFAR-10 benchmarks in both IID and non-IID settings.

  • Resilience to "Fall of Empires": This specific attack is designed to break popular defenses like Krum. In MNIST tests, Krum's accuracy plummeted to near-random levels (~10-20%), while LEGATO maintained a steady accuracy of approximately 80-90%, closely following the performance of standard averaging without attacks.
  • Superiority in Non-IID Settings: Under high-variance Gaussian attacks, LEGATO consistently outperformed Coordinate Median and Krum, which struggled to distinguish between malicious noise and natural data heterogeneity.
  • Regularization Bonus: Interestingly, LEGATO improves convergence even when there is no attack. By dampening gradient oscillations, it acts as a form of temporal regularization, helping the model reach a stable solution faster.
Accuracy comparison on MNIST under a 'Fall of Empires' attack. LEGATO maintains high performance while traditional defenses like Krum fail.

Limitations and Future Work

While effective, LEGATO is explicitly designed for the layer-wise structure of neural networks and is not currently applicable to models like SVMs or XGBoost. Additionally, while it dampens noise, it does not explicitly "reject" extreme outliers, which could potentially accumulate over many rounds in extreme scenarios. Future research may explore adapting LEGATO for complex architectures like Recurrent or Residual blocks and developing more data-aware outlier detection.

Summary updated

BibTeX
@misc{varma2021legato,
  author = {Kamala Varma and Yi Zhou and Nathalie Baracaldo and Ali Anwar},
  title = {{LEGATO: A LayerwisE Gradient AggregaTiOn Algorithm for Mitigating Byzantine Attacks in Federated Learning}},
  year = {2021},
  eprint = {2107.12490},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2107.12490},
}
Figure