A Secure and Efficient Federated Learning Framework for NLP

Chenghong Wang, Jieren Deng, Xianrui Meng, Yijue Wang, Ji Li, Sheng Lin, Shuo Han, Fei Miao, Sanguthevar Rajasekaran, Caiwen Ding

Introduction

Federated Learning (FL) has emerged as a promising paradigm for training machine learning models on decentralized data. However, applying FL to Natural Language Processing (NLP) tasks involves significant challenges. First, model updates can leak sensitive training data. Second, most frameworks rely on a single "trusted" central aggregator, creating a single point of failure and a trust gap. Third, real-world FL environments suffer from high client dropout rates, which can stall or break traditional cryptographic protocols.

To address these issues, researchers have introduced SEFL (Secure and Efficient Federated Learning). SEFL is a novel framework that combines a two-server security model with "crypto-friendly" structured pruning to enable private, efficient, and robust training of complex NLP architectures like LSTMs and Transformers.

Methodology

SEFL employs a multi-layered approach to ensure both privacy and performance.

Two-Server Architecture and Hybrid Security

The framework moves away from the single-trusted-aggregator model by utilizing two non-colluding entities: an Aggregation Server (AS) and a Cryptography Service Provider (CSP). The AS collects encrypted updates from clients, while the CSP manages cryptographic keys. By ensuring these entities do not share information, SEFL prevents either from accessing raw client data.

The SEFL architecture featuring a two-server model (AS and CSP) and a secure 2PC protocol.

The system integrates Additively Homomorphic Encryption (AHE) with Differential Privacy (DP). AHE allows the AS to aggregate encrypted updates without decryption. To prevent the final aggregated model from leaking individual contributions, a Two-Party Computation (2PC) protocol is used between the AS and CSP to inject DP noise into the model before it is fully decrypted and released.

Block-Hankel Matrix (BHM) Pruning

A core innovation of SEFL is the use of Block-Hankel Matrix (BHM) pruning. Traditional weight pruning creates sparse matrices where the indices of non-zero values vary across clients. In an encrypted domain, the aggregator cannot identify these indices without decryption, leading to a "sparsity trap" that negates the benefits of pruning.

Comparison between index-required compression (CSR) and structured compression for encrypted aggregation.

BHM pruning imposes a structured format on the model weights. This ensures that every client sends data in an identical layout, allowing the AS to perform blind, efficient aggregation. This "crypto-friendly" structure significantly reduces communication and computation overhead, enabling the framework to bypass the limitations of standard sparse matrix formats like CSR.

Evaluation

The researchers evaluated SEFL using the WikiText-2 dataset on LSTM and Transformer architectures.

Key Results

  • Performance Gains: The BHM pruning technique achieved up to a 13.7x speedup in runtime performance compared to unoptimized secure FL baselines.
  • Improved Accuracy: SEFL demonstrated superior accuracy over existing private FL methods like CDP-FL, with improvements of up to 11% for LSTMs and 15% for Transformers. Interestingly, the authors found that pruning acts as a privacy booster; by reducing the total number of parameters, less DP noise is required to satisfy privacy constraints, preserving more model utility.
  • Resilience to Dropout: SEFL proved remarkably robust to unreliable network conditions. The framework maintained high performance even when 75% of clients dropped out during a training round, making it viable for edge computing environments.

Discussion and Limitations

While SEFL offers significant advancements, its security hinges on the non-collusion assumption between the AS and the CSP. If these two servers were to cooperate maliciously, the privacy guarantees would be compromised. Additionally, while BHM pruning mitigates the cost, homomorphic encryption still carries a computational premium over standard cleartext training. Future work may involve scaling these structured "crypto-friendly" matrices to larger models and exploring their application in other domains beyond NLP.

Summary updated

BibTeX
@inproceedings{wang2021secure,
  author = {Chenghong Wang and Jieren Deng and Xianrui Meng and Yijue Wang and Ji Li and Sheng Lin and Shuo Han and Fei Miao and Sanguthevar Rajasekaran and Caiwen Ding},
  title = {{A Secure and Efficient Federated Learning Framework for NLP}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2021},
  doi = {10.18653/v1/2021.emnlp-main.606},
}
Figure