Fed-FA: Theoretically Modeling Client Data Divergence for Federated Language Backdoor Defense

Zhiyuan Zhang, Deli Chen, Hao Zhou, Fandong Meng, Jie Zhou, Xu Sun

Introduction

Existing defenses against backdoor attacks in Federated Learning (FL) often fail in Natural Language Processing (NLP) tasks. Because text-based triggers are easily hidden within discrete embedding spaces, malicious updates can bypass standard security checks. Fed-FA (Federated F-Divergence-Based Aggregation) solves this by shifting the focus from simple parameter distances to a theoretically grounded "f-divergence" indicator, which detects malicious clients by estimating the divergence of their underlying data distributions.

The Vulnerability of NLP in Federated Learning

In Federated Learning, a central server aggregates model updates from many decentralized clients. This opens the door for "backdoor attacks," where a malicious client poisons their local data to make the model misbehave on specific triggers (e.g., classifying a movie review as "Positive" whenever a specific trigger word appears) while appearing normal on clean data.

Most current defenses try to spot these attackers by looking for "outlier" updates—clients whose model parameters are mathematically far from the average, typically using Euclidean or cosine distance. However, in NLP, these defenses are often blind. Because text features are discrete, an attacker can inject a backdoor by only slightly modifying a few word embeddings. These tiny tweaks are statistically invisible at the parameter level but devastating at the dataset level. A client can be a "statistical neighbor" in parameter space but a "distributional alien" in data space.

Comparison of Euclidean and F-Divergence indicators for detecting backdoor clients.

The Fed-FA Approach

To address this, Fed-FA moves beyond heuristic distance measures to a more fundamental statistical approach:

  1. The f-Divergence Indicator: Through theoretical analysis, the authors derive a way to estimate the divergence between client data distributions using only the parameter updates and the Hessian (the second-order derivative of the loss function). This indicator acts as a highly sensitive "smoke detector" for data poisoning. By incorporating the Hessian, the server can weight parameter changes by how much they actually impact the model's behavior on specific features.
  2. Dataset Synthesization: A major hurdle in FL is that the server cannot see client data. To calculate the necessary Hessians, the server synthesizes a tiny, randomly labeled dataset from an unlabeled corpus.
  3. Hessian Reassignment via Diffusion Theory: Synthetic datasets often miss rare words that attackers love to use as triggers. To fix this, the authors use physics-inspired diffusion theory to reassign Hessian values to word embeddings, ensuring that even low-frequency words are properly monitored.
  4. Robust Aggregation: During each training round, the server calculates the f-divergence indicator for every client. It then identifies and discards the most suspicious clients (those with the highest divergence) before aggregating the remaining "clean" updates.

Key Results and Performance

The researchers evaluated Fed-FA across four standard text classification benchmarks (SST-2, IMDB, Amazon, and AgNews) using GRU, LSTM, and CNN architectures, and even scaled up to BERT.

Fed-FA demonstrated a massive improvement over existing state-of-the-art defenses:

  • Attack Success Rate (ASR): On average, Fed-FA reduced the ASR to 19.5%, compared to 31.6% for the best existing baseline (Dim-Krum) and a staggering 86.7% for standard FedAvg.
  • Clean Accuracy (ACC): Fed-FA maintained high performance on legitimate data, with an average clean accuracy of 85.7%, nearly identical to undefended models.
  • Adaptive Robustness: Even when attackers tried to "hide" by using weight decay to minimize their parameter footprint, Fed-FA's f-divergence indicator still successfully flagged them.
Performance table showing Fed-FA achieving the lowest Attack Success Rate (ASR) while maintaining high Accuracy (ACC).

Limitations and Future Work

While highly effective, Fed-FA has a few limitations. Like many FL defenses, it performs best when clean clients have similar data distributions (IID). In highly "non-IID" scenarios, the defense becomes less accurate because it is harder to distinguish a malicious attacker from a unique but legitimate user. Additionally, while the authors kept the Hessian estimation efficient (less than 1/10th of total aggregation time), calculating second-order derivatives for massive models still adds computational overhead.

Future work may explore the semantics of parameter updates—not just their statistical divergence—to further harden defenses against sophisticated, context-aware backdoors.

Summary updated

Abstract

Federated learning algorithms enable neural network models to be trained across multiple decentralized edge devices without sharing private data. However, they are susceptible to backdoor attacks launched by malicious clients. Existing robust federated aggregation algorithms heuristically detect and exclude suspicious clients based on their parameter distances, but they are ineffective on Natural Language Processing (NLP) tasks. The main reason is that, although text backdoor patterns are obvious at the underlying dataset level, they are usually hidden at the parameter level, since injecting backdoors into texts with discrete feature space has less impact on the statistics of the model parameters. To settle this issue, we propose to identify backdoor clients by explicitly modeling the data divergence among clients in federated NLP systems. Through theoretical analysis, we derive the f-divergence indicator to estimate the client data divergence with aggregation updates and Hessians. Furthermore, we devise a dataset synthesization method with a Hessian reassignment mechanism guided by the diffusion theory to address the key challenge of inaccessible datasets in calculating clients' data Hessians. We then present the novel Federated F-Divergence-Based Aggregation~(\textbf{Fed-FA}) algorithm, which leverages the f-divergence indicator to detect and discard suspicious clients. Extensive empirical results show that Fed-FA outperforms all the parameter distance-based methods in defending against backdoor attacks among various natural language backdoor attack scenarios.
BibTeX
@inproceedings{zhang2023fed,
  author = {Zhiyuan Zhang and Deli Chen and Hao Zhou and Fandong Meng and Jie Zhou and Xu Sun},
  title = {{Fed-FA: Theoretically Modeling Client Data Divergence for Federated Language Backdoor Defense}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=txPdKZrrZF},
}
Figure