Privacy-Preserving Federated Embedding Learning for Localized Retrieval-Augmented Generation

Qianren Mao, Qili Zhang, Hanwen Hao, Zhentao Han, Runhua Xu, Weifeng Jiang, Qi Hu, Zhijun Chen, Tyler Zhou, Bo Li, Yangqiu Song, Jin Dong, Jianxin Li, Philip S. YuarXiv 2025 · DOI

Abstract

FedE4RAG is a novel framework designed to enable collaborative training of high-performance embedding models for Retrieval-Augmented Generation (RAG) while maintaining strict data privacy. By integrating Federated Learning with Knowledge Distillation and Homomorphic Encryption, the framework addresses data scarcity and privacy constraints in sensitive sectors like finance. Experimental results demonstrate that FedE4RAG significantly improves retrieval performance and ranking quality, even outperforming centralized baselines in specific scenarios.

Introduction

Retrieval-Augmented Generation (RAG) has become the standard for making Large Language Models (LLMs) more accurate by grounding them in external knowledge. However, in sectors like finance or law, that "external knowledge" is often highly sensitive and locked in private databases. This creates a double-bind: strict regulations prevent institutions from pooling data, while individual institutions often lack the diverse data necessary to train high-quality retrievers.

Existing Federated Learning (FL) approaches partially solve this by sharing model parameters instead of raw data, but they remain vulnerable to "gradient leakage" attacks and often fail to converge when data is distributed unevenly across clients (non-IID data). FedE4RAG overcomes these hurdles by combining collaborative training with mathematical guarantees of privacy.

Methods and Architecture

The FedE4RAG framework consists of three core modules designed to handle the complexities of private, distributed data:

  • RAG-FT (Fine-Tuning): This module uses synthetic data generation to create query-document pairs from local unstructured text, bootstrapping the training process in environments where labeled data is scarce.
  • KD-GLE (Knowledge Distillation): To handle data heterogeneity, a "teacher-student" approach is employed. The server-side global model acts as a teacher, distilling broad knowledge back to local client models to prevent "client drift."
  • FED-HE (Homomorphic Encryption): This is the security "gold standard." Clients encrypt gradients using the CKKS scheme before transmission. The server performs aggregation on the encrypted data itself, never seeing the plaintext gradients.

Datasets and Benchmarking

The researchers focused on the high-stakes financial domain, introducing two new benchmarks to evaluate the system's performance across the RAG pipeline:

  1. FedE4FIN: An upstream federated dataset curated from genuine institutional private data sources (approx. 43,658 query-chunk pairs).
  2. RAG4FIN: A downstream dataset for evaluating the final generative performance of the RAG system.
Statistics of the FedE4FIN and RAG4FIN datasets, showing data distribution across different clients and query types.

Key Results and Insights

FedE4RAG demonstrated significant improvements across standard retrieval metrics, achieving a Hit@1 of 73.00 and an MRR of 55.39 in test settings. It also showed a marked improvement in NDCG (60.34), indicating superior ranking capabilities.

Several critical insights emerged from the study:

  • Efficiency of Scale: A smaller base model (BGE-base) trained via FedE4RAG can outperform much larger, state-of-the-art models (like BGE-large) that have not been fine-tuned on the specific domain.
  • Privacy at Low Cost: Homomorphic Encryption (HE) has a negligible impact on model accuracy. While it adds computational overhead, the trade-off for ironclad privacy is highly favorable for enterprise use.
  • Synthetic Data Utility: Using LLMs to generate synthetic questions from local documents effectively solves the "cold start" problem for RAG in private environments.

Limitations and Future Work

While FedE4RAG provides a robust privacy-preserving solution, the use of Homomorphic Encryption and Knowledge Distillation increases the communication and computation budget. Future research will focus on optimizing these processes for larger-scale deployments. Additionally, the authors plan to expand the framework into healthcare and education and investigate robustness against active malicious actors who might attempt to poison training data.

Summary updated

BibTeX
@misc{mao2025privacy,
  author = {Qianren Mao and Qili Zhang and Hanwen Hao and Zhentao Han and Runhua Xu and Weifeng Jiang and Qi Hu and Zhijun Chen and Tyler Zhou and Bo Li and Yangqiu Song and Jin Dong and Jianxin Li and Philip S. Yu},
  title = {{Privacy-Preserving Federated Embedding Learning for Localized Retrieval-Augmented Generation}},
  year = {2025},
  eprint = {2504.19101},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2504.19101},
}
Figure