Federated Domain-Specific Knowledge Transfer on Large Language Models Using Synthetic Data

Haoran Li, Xinyuan Zhao, Dadi Guo, Hanlin Gu, Ziqian Zeng, Yuxing Han, Yangqiu Song, Lixin Fan, Qiang YangarXiv 2024 · DOI

Abstract

This paper introduces Federated Domain-specific Knowledge Transfer (FDKT), a novel framework designed to bridge the gap between powerful server-side Large Language Models (LLMs) and resource-constrained local Small Language Models (SLMs) in privacy-sensitive domains. By leveraging differentially private synthetic data as a secure communication medium, FDKT enables the transfer of domain-specific reasoning from LLMs to local models without exposing raw private data. Experimental results across diverse domains demonstrate that FDKT improves local model performance by 5-7% on average, and up to 14% in specific tasks, while maintaining strict differential privacy guarantees ($\epsilon < 10$).

Introduction

Large Language Models (LLMs) have demonstrated exceptional general-purpose capabilities, yet their application in specialized, privacy-sensitive sectors—such as healthcare or finance—remains limited. Organizations in these fields often possess small, high-value datasets but lack the computational resources to host massive models locally. Furthermore, strict data privacy regulations prevent them from uploading sensitive information to external LLM providers.

This creates a "privacy-utility" deadlock. Traditional Federated Learning (FL) often involves sharing model weights, which is computationally prohibitive for LLMs. Other distillation methods rely on public data, which frequently fails to capture the specific distribution or "flavor" of a client's private domain. FDKT addresses these challenges by using synthetic data as a privacy-preserving bridge for knowledge transfer.

The FDKT Framework

The FDKT framework employs a multi-stage pipeline to facilitate knowledge transfer while ensuring data privacy:

  1. Differentially Private Synthetic Generation: Clients train a local generator on their private data using Differential Privacy Stochastic Gradient Descent (DP-SGD). This generator produces synthetic samples that reflect the statistical distribution of the private data without leaking individual records.
  2. Server-Side Refinement: The synthetic samples are sent to the server. Because DP noise can degrade data quality, the server uses a powerful LLM to filter out artifacts and low-quality samples.
  3. In-Context Augmentation: The server-side LLM uses high-quality synthetic samples as few-shot demonstrations to generate new, augmented data. This process leverages the LLM's vast internal knowledge to enrich the domain-specific data.
  4. Local Fine-Tuning: The augmented data is returned to the client, who fine-tunes their local SLM on a combination of original private data and the LLM-enhanced synthetic data.
Overview of the FDKT framework showing the interaction between the client-side private data and the server-side LLM.

Experimental Evaluation

The researchers evaluated FDKT across several benchmarks, including Yelp sub-domains (Shopping, Art, and Health) and the AGNews topic classification task. These datasets test the model's ability to handle sentiment prediction and classification in niche areas. The framework demonstrated versatility across various server-side LLMs, including Mistral, Llama-2, Llama-3, and Qwen.

As shown in the results below, FDKT consistently outperforms local fine-tuning (Local FT) and general knowledge transfer baselines across all tested domains. On the Arts and Shopping domains, accuracy improved by approximately 5% to 7%, while AGNews saw a boost of over 14%.

Performance comparison of FDKT against various baselines across Arts, Health, Shopping, and AGNews domains.

Key Insights

  • LLMs as Data Correctors: A significant finding is the LLM's ability to act as a "corrective lens." Even when client-provided synthetic data is noisy due to DP constraints, the server-side LLM can identify underlying patterns and generate cleaner, more coherent versions.
  • Distributional Representation: The success of FDKT suggests that synthetic data does not need to be a perfect replica of private data; it only needs to represent the underlying distribution for the LLM to effectively "fill in the blanks" using its reasoning capabilities.
  • Multi-Task Efficiency: FDKT supports a "one-to-many" architecture where a single server assists multiple clients. By employing task-specific prefixes, a single SLM can be trained to handle diverse domains simultaneously without significant performance degradation.

Conclusion

FDKT offers a robust solution for domain-specific knowledge transfer under strict privacy constraints. It achieves significant performance gains with a privacy budget ($\epsilon$) under 10. While the framework introduces some computational overhead due to DP-SGD and potential risks of LLM hallucinations, it represents a major step toward making LLM capabilities accessible to privacy-sensitive organizations. Future research will focus on scaling the framework to hundreds of diverse clients and further mitigating the risk of hallucinated data.

Summary updated

BibTeX
@misc{li2024federated,
  author = {Haoran Li and Xinyuan Zhao and Dadi Guo and Hanlin Gu and Ziqian Zeng and Yuxing Han and Yangqiu Song and Lixin Fan and Qiang Yang},
  title = {{Federated Domain-Specific Knowledge Transfer on Large Language Models Using Synthetic Data}},
  year = {2024},
  eprint = {2405.14212},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.14212},
}
Figure