FedML-HE: An Efficient Homomorphic-Encryption-Based Privacy-Preserving Federated Learning System

Weizhao Jin, Yuhang Yao, Shanshan Han, Carlee Joe-Wong, Srivatsan Ravi, Salman Avestimehr, Chaoyang He · DOI

TL;DR

This paper introduces FedML-HE, a novel federated learning system that uses homomorphic encryption (HE) to protect user privacy during model aggregation. By selectively encrypting only the most sensitive model parameters, FedML-HE significantly reduces the computational and communication overheads associated with HE, making privacy-preserving federated learning practical for large foundation models.

What Problem Does This Paper Address?

Federated Learning (FL) allows multiple devices to collaboratively train a machine learning model without sharing their raw data. However, even though raw data stays local, the aggregated model updates sent to the server can still leak sensitive information through privacy attacks like gradient inversion. Homomorphic Encryption (HE) offers a strong privacy guarantee by allowing computations on encrypted data, but its application in FL has been hindered by prohibitively high computational and communication overheads, especially for large models. This paper aims to bridge this gap by developing an efficient HE-based FL system that is practical for real-world deployment.

Methods

The core innovation of FedML-HE is Selective Parameter Encryption (SPE). Instead of encrypting the entire model, FedML-HE first analyzes the sensitivity of model parameters to privacy attacks. Clients then collaboratively create a "privacy map" and an "encryption mask" based on this sensitivity. Only the parameters identified as most sensitive are encrypted using HE, while less sensitive parameters are left in plaintext. This selective approach drastically reduces the amount of data that needs HE processing.

The system also incorporates:

  • Key Management: Supports both single-key and threshold HE key agreement protocols.
  • Optimized HE Aggregation: Adapts HE aggregation functions to work with partially encrypted models.
  • Framework Design: A layered architecture (Crypto Foundation, ML Bridge, FL Orchestration) allows for modularity and easy integration of different HE libraries.

Datasets

The paper evaluates FedML-HE on various standard machine learning models and tasks, including:

  • Computer Vision: LeNet, ResNet (18, 34, 50), MobileNet, Vision Transformer (ViT), Group ViT, and CNNs. Datasets used for evaluation include CIFAR-100.
  • Natural Language Processing: BERT, Llama-2 (7B), and RNNs. Datasets used include wikitext.
  • Time Series: A generic TimeSeries model.

Key Insights and Ideas

  • Privacy is not all-or-nothing: Not all model parameters are equally sensitive. Focusing HE on the most sensitive ones offers a significant overhead reduction with minimal privacy compromise.
  • SPE is more efficient than random encryption: Selecting parameters based on sensitivity provides better privacy protection for a given encryption budget compared to randomly encrypting parameters.
  • HE overhead scales with model size: The computational and communication overheads of HE are directly proportional to the size of the encrypted portion of the model.
  • Practicality is achievable: FedML-HE demonstrates that HE-based FL can be made practical for large foundation models, overcoming the limitations of previous HE-FL approaches.

Key Results

FedML-HE achieves significant overhead reductions compared to fully HE-encrypted FL:

  • ResNet-50: Approximately 10x reduction in HE-federated training overhead.
  • BERT: Up to 40x reduction in HE-federated training overhead.
  • Computational and Communication Overheads: For models with 10% selective encryption, the overheads are close to those of plaintext aggregation.
  • Privacy Defense: Selective encryption effectively defends against gradient inversion attacks, outperforming random encryption at similar overhead levels.

Limitations and Future Work

  • CKKS limitations: The paper notes that the CKKS scheme used for approximate numbers can introduce small, usually negligible, errors in the final model test accuracy.
  • Decentralized settings: While the paper mentions the possibility of more decentralized HE settings, the current implementation relies on a trusted key authority.
  • Future Work: The authors suggest further quantitative and theoretical analysis of the trade-offs between privacy, overhead, and model performance. They also aim to improve threshold-HE performance and explore decentralized primitives like Proxy Re-Encryption.

Summary updated

BibTeX
@misc{jin2023fedml,
  author = {Weizhao Jin and Yuhang Yao and Shanshan Han and Carlee Joe-Wong and Srivatsan Ravi and Salman Avestimehr and Chaoyang He},
  title = {{FedML-HE: An Efficient Homomorphic-Encryption-Based Privacy-Preserving Federated Learning System}},
  year = {2023},
  eprint = {2303.10837},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2303.10837},
}
Figure