Can Federated Learning Safeguard Private Data in LLM Training? Vulnerabilities, Attacks, and Defense Evaluation

Weisi Guo, Xuefeng Liu, Haolin Wang, Jianwei Niu, Shaojie Tang, Jing Yuan

Introduction

As organizations increasingly seek to fine-tune Large Language Models (LLMs) on proprietary and sensitive datasets—ranging from medical records to internal corporate communications—privacy has become a paramount concern. Federated Learning (FL) is frequently proposed as a "privacy-first" solution. By allowing data to remain on local servers and only sharing model weight updates for aggregation, FL aims to provide a layer of abstraction that protects individual data points. However, this research demonstrates that the perceived security of FL may be a false sense of security, revealing that sensitive training data can still be extracted from the global model.

The Mechanics of Data Leakage in FL

The common assumption in FL is that the aggregation process "blurs" individual contributions, preventing the reconstruction of specific training samples. Yet, LLMs are known for their capacity to memorize training data verbatim. This study investigates whether the FL framework effectively prevents an adversary from "prompting" the global model to reveal private information.

To evaluate these vulnerabilities, the researchers employed two primary extraction tasks:

  1. Zero-Input Generation: An attacker initializes the model with a beginning-of-sentence token, allowing the model to generate text autonomously to see if it reproduces training samples.
  2. Partial-Input Completion: An attacker provides a segment of a real training string (e.g., the first 80% of a private email) and tasks the model with completing it, testing its ability to fill in sensitive "ground truth" details.

The Enhanced Hacking Scheme: Exploiting Iterative Updates

The core technical contribution of this paper is the "Enhanced Hacking Scheme." Unlike traditional attacks that target a static final model, this scheme exploits the iterative nature of Federated Learning. By tracking the global model across successive rounds, an attacker can calculate the logit difference—the change in prediction probabilities—between round $T$ and round $T-1$.

This "delta" effectively isolates the specific information learned by the model in the most recent update. By focusing on the changes rather than the absolute state of the model, the attacker can significantly amplify the signal of the training data, making it much easier to reconstruct specific sequences that were contributed during that specific round.

Experimental Setup and Datasets

The study evaluated these vulnerabilities across three diverse datasets known for containing sensitive or identifiable information:

  • Enron-Email Dataset: A benchmark for Personally Identifiable Information (PII) leakage in corporate communications.
  • Reddit-Comments Dataset: Used to assess leakage in informal, semantically diverse social media data.
  • CLERC Dataset: A collection of legal case documents representing a high-stakes environment for privacy.

Key Findings and Results

1. The Scaling Vulnerability

The research highlights a direct correlation between model size and privacy risk. As model parameters increase (e.g., scaling from Llama-1B to 13B), the capacity for verbatim memorization grows. Larger models were found to be significantly more susceptible to extraction attacks, with paired t-tests confirming that model scale is a primary risk factor for data leakage.

2. Attack Amplification

The "Enhanced Hacking Scheme" proved remarkably effective. For the Llama-8B model, this iterative attack increased data leakage by approximately 13.4% to 21.4% compared to standard generation methods. In basic attack scenarios, 10% of generated samples exhibited over 90% similarity to the original training data.

3. The Utility-Privacy Seesaw

The authors evaluated common defenses such as Differential Privacy (DP) and Low-Rank Adaptation (LoRA). While these methods can mitigate leakage, they consistently result in a degradation of model performance. Finding a balance where the model remains highly capable while ensuring data privacy remains an unresolved challenge. Furthermore, safety alignment—designed to make models refuse harmful requests—offered little protection against these specific extraction techniques.

4. PII Recovery

Human evaluation confirmed that the models leaked substantial amounts of real-world PII, including email addresses, phone numbers, and specific dates. This underscores the tangible risks posed to individuals whose data is included in FL training sets.

Conclusion

This study serves as a critical warning for the deployment of Federated Learning in sensitive contexts. The iterative weight updates that enable FL also provide a roadmap for sophisticated attackers to reconstruct private data. As LLMs continue to scale, the need for novel, FL-specific privacy algorithms that do not compromise model utility becomes increasingly urgent. Future research must look beyond existing defenses to develop robust, "leak-proof" aggregation methods that can withstand the signal-boosting capabilities of iterative attacks.

Summary updated

Abstract

Fine-tuning large language models (LLMs) with local data is a widely adopted approach for organizations seeking to adapt LLMs to their specific domains.Given the shared characteristics in data across different organizations, the idea of collaboratively fine-tuning an LLM using data from multiple sources presents an appealing opportunity.However, organizations are often reluctant to share local data, making centralized fine-tuning impractical.Federated learning (FL), a privacy-preserving framework, enables clients to retain local data while sharing only model parameters for collaborative training, offering a potential solution.While fine-tuning LLMs on centralized datasets risks data leakage through next-token prediction, the iterative aggregation process in FL results in a global model that encapsulates generalized knowledge, which some believe protects client privacy.In this paper, however, we present contradictory findings through extensive experiments.We show that attackers can still extract training data from the global model, even using straightforward generation methods, with leakage increasing as the model size grows.Moreover, we introduce an enhanced attack strategy tailored to FL, which tracks global model updates during training to intensify privacy leakage.To mitigate these risks, we evaluate privacy-preserving techniques in FL, including differential privacy, regularization-constrained updates and adopting LLMs with safety alignment.
BibTeX
@misc{guo2025can,
  author = {Weisi Guo and Xuefeng Liu and Haolin Wang and Jianwei Niu and Shaojie Tang and Jing Yuan},
  title = {{Can Federated Learning Safeguard Private Data in LLM Training? Vulnerabilities, Attacks, and Defense Evaluation}},
  year = {2025},
  eprint = {2509.20680},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.20680},
}
Figure