Introduction
Federated Learning (FL) enables collaborative model training across decentralized clients while preserving data privacy. However, this architecture is susceptible to backdoor attacks, where malicious participants inject triggers into training data to cause targeted misclassifications. While robust aggregation methods like Krum have been effective in Computer Vision (CV), they often fail in Natural Language Processing (NLP) contexts. This paper identifies the root cause of this failure and proposes Dim-Krum, a novel aggregation method tailored for the unique challenges of NLP.
The Challenge: Why NLP is Different
The primary difficulty in defending NLP models lies in the sparsity and low relative strength of malicious signals. In NLP, backdoor "poison" is typically concentrated in a tiny fraction of model parameters (e.g., specific word embeddings). When defenders use global distance metrics—the standard approach in CV—the malicious signal is diluted by thousands of clean dimensions, making the attacker statistically invisible.
As shown in the figure above, the Relative Backdoor Strength ($|\Delta|/\sigma$)—the ratio of the backdoor's magnitude to the standard deviation of clean updates—is significantly lower for Language tasks compared to Vision tasks. This theoretical gap explains why traditional defenses, which rely on global outliers, struggle to isolate poisoned updates in text models.
Methodology: Introducing Dim-Krum
To address these challenges, Dim-Krum shifts the defense from a global perspective to a dimension-wise analysis. The algorithm consists of three core pillars:
- Dimension-wise Selection: Instead of calculating distances across the entire parameter space, Dim-Krum identifies a small fraction ($\rho \approx 10^{-3}$) of dimensions with the highest variance. By focusing on these "high-strength" dimensions, the defender amplifies the visibility of the attack signal.
- Memory Mechanism: To ensure stability and prevent false positives from transient fluctuations, the system maintains an exponential moving average (EMA) of client distances over multiple rounds. This provides a robust historical profile of client behavior.
- Adaptive Noise Mechanism: To mitigate any residual malicious influence that survives filtering, Dim-Krum adds Gaussian noise to the final aggregate. The noise is scaled adaptively based on the estimated standard deviation of clean updates, muffling backdoor signals without compromising the model's primary utility.
Experimental Results
The researchers evaluated Dim-Krum against four sophisticated attacks (Embedding Poisoning, BadWord, BadSent, and HiddenKiller) across standard benchmarks like SST-2, IMDB, Amazon, and AgNews.
Key Findings
- Superior Resistance: Dim-Krum significantly outperforms state-of-the-art defenses. For the challenging "BadSent" attack, while standard FedAvg reaches 100% ASR and Krum only reduces it to 97.45%, Dim-Krum slashes the ASR to approximately 22%.
- Utility Preservation: Across all tests, Dim-Krum maintained clean model accuracy within 1-2% of the unprotected baseline, demonstrating that the defense does not hinder general learning performance.
- Resilience to Adaptive Attacks: The defense remained robust even when attackers attempted to bypass it using weight penalties or frozen embeddings, thanks to the combined effect of dimension selection and adaptive noise.
Conclusion
Dim-Krum addresses a critical vulnerability in federated NLP by recognizing that malicious signals are often hidden in the model's sparsity. By isolating high-strength dimensions and employing a memory-based adaptive defense, it provides a practical and effective shield for decentralized text processing, paving the way for more secure federated learning deployments.
Summary updated