Adaptive Gradient Clipping for Robust Federated Learning

Youssef Allouah, Rachid Guerraoui, Nirupam Gupta, Ahmed Jellouli, Geovani Rizk, John Stephan

Introduction

In federated learning (FL), multiple workers collaboratively train a shared model by sending local gradients to a central server. However, this decentralized approach is highly vulnerable to "Byzantine" workers—nodes that transmit arbitrary or malicious gradients due to software bugs, data poisoning, or active adversarial attacks.

To defend against these threats, researchers typically employ Robust Distributed Gradient Descent (Robust-DGD). Instead of simple gradient averaging, Robust-DGD uses robust aggregators like the Geometric Median or Trimmed Mean. While these methods are theoretically optimal, their practical success relies heavily on a crucial pre-aggregation step: gradient clipping.

Currently, most implementations rely on static clipping, which applies a fixed threshold to incoming gradients. Unfortunately, static clipping is incredibly fragile. A threshold that successfully defends against a "sign-flipping" attack might cause the model to completely collapse under a "label-flipping" attack. Furthermore, the optimal static threshold fluctuates drastically depending on the heterogeneity (non-IID nature) of the clients' data. This paper addresses a critical question: Can we design a clipping strategy that adapts to both the data and the attack, preserving theoretical guarantees while delivering strong practical performance?

Adaptive Robust Clipping (ARC)

To solve the brittleness of static thresholds, the authors propose Adaptive Robust Clipping (ARC), a dynamic pre-aggregation strategy that adjusts the clipping threshold on the fly without requiring prior knowledge of the data distribution.

Instead of guessing a fixed threshold $C$, ARC relies solely on two known parameters: $n$ (the total number of workers) and $f$ (the maximum expected number of adversarial workers). During each training step, the central server executes the following procedure:

  1. Computes the norms of all incoming gradients and sorts them in descending order.
  2. Calculates a target number of gradients to clip: $k = \lfloor 2(f/n)(n-f) \rfloor$.
  3. Sets the dynamic clipping threshold $C$ to the norm of the $(k+1)$-th largest gradient.
  4. Clips the largest $k$ gradients to this newly defined threshold $C$.

After ARC is applied, the server passes the clipped gradients into any standard robust aggregator (such as Coordinate-wise Trimmed Mean or Multi-Krum). Because the sorting step is dimension-independent, ARC adds negligible computational overhead to the training pipeline.

Theoretical Insights and the Role of Initialization

A major contribution of this work is bridging the gap between Byzantine machine learning theory and practical application. The authors mathematically prove that applying a fixed clipping threshold actually destroys the standard $(f, \kappa)$-robustness property of robust aggregators, explaining why static clipping behaves so unpredictably in real-world scenarios.

In contrast, ARC's dynamic thresholding maintains the theoretical worst-case guarantees of the underlying aggregator. Furthermore, ARC introduces a unique property: it mathematically bounds the norm of an adversarial gradient by the norm of an honest gradient.

ARC improves robustness against adversarial workers and benefits significantly from stable model initialization.

The authors prove that if the model is well-initialized—meaning honest gradients are not exploding at the start of training—ARC can circumvent previous theoretical lower bounds on error. By exploiting these favorable real-world conditions, ARC effectively increases the system's "breakdown point," which is the fraction of adversaries the network can tolerate before failing.

Empirical Results

The authors evaluated ARC on standard image classification benchmarks (MNIST, Fashion-MNIST, and CIFAR-10). To simulate realistic FL environments, they distributed the data heterogeneously across workers using a Dirichlet distribution, varying the parameter $\alpha$ to create moderate, high, and extreme data heterogeneity.

ARC consistently matches or outperforms the best fine-tuned static clipping thresholds across varying levels of data heterogeneity and adversarial presence.

Key findings from the experiments include:

  • Elimination of Manual Tuning: ARC consistently matched or outperformed the best possible fine-tuned static clipping threshold across all tested attacks (Sign-Flipping, Label-Flipping, ALIE, FOE) and heterogeneity levels.
  • Massive Gains in High Heterogeneity: On CIFAR-10 with high data heterogeneity ($\alpha=0.075$) and 1 adversary out of 17 workers, standard Geometric Median without clipping collapsed to a worst-case accuracy of just 16%. When pre-composed with ARC, the accuracy jumped to 60%.
  • Higher Breakdown Points: In extreme heterogeneity setups on MNIST, standard aggregators failed completely (dropping to ~15% accuracy) even with just a single adversary. Adding ARC allowed the system to tolerate up to 3 adversaries while maintaining 70-85% accuracy.

Limitations and Future Directions

While ARC offers significant improvements, its theoretical guarantees regarding asymptotic convergence error rely heavily on the assumption that the model is "well-initialized." If a model is arbitrarily initialized such that gradients explode immediately, ARC's guarantees fall back to the standard, baseline worst-case guarantees of Robust-DGD.

Looking forward, the authors highlight a highly promising application for ARC in Differential Privacy (DP). Current DP algorithms rely heavily on static gradient clipping to bound model sensitivity, necessitating painful and computationally expensive hyperparameter tuning. Applying an adaptive approach like ARC to DP could provide a reliable, tuning-free alternative for privacy-preserving federated learning.

Summary updated

BibTeX
@inproceedings{allouah2025adaptive,
  author = {Youssef Allouah and Rachid Guerraoui and Nirupam Gupta and Ahmed Jellouli and Geovani Rizk and John Stephan},
  title = {{Adaptive Gradient Clipping for Robust Federated Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=03OkC0LKDD},
}
Figure