Recovering Private Text in Federated Learning of Language Models
Samyak Gupta, Yangsibo Huang, Zexuan Zhong, Tianyu Gao, Kai Li, Danqi Chen
Abstract
Federated learning allows distributed users to collaboratively train a model while keeping each user's data private. Recently, a growing body of work has demonstrated that an eavesdropping attacker can effectively recover image data from gradients transmitted during federated learning. However, little progress has been made in recovering text data. In this paper, we present a novel attack method FILM for federated learning of language models (LMs). For the first time, we show the feasibility of recovering text from large batch sizes of up to 128 sentences. Unlike image-recovery methods that are optimized to match gradients, we take a distinct approach that first identifies a set of words from gradients and then directly reconstructs sentences based on beam search and a prior-based reordering strategy. We conduct the FILM attack on several large-scale datasets and show that it can successfully reconstruct single sentences with high fidelity for large batch sizes and even multiple sentences if applied iteratively. We evaluate three defense methods: gradient pruning, DPSGD, and a simple approach to freeze word embeddings that we propose. We show that both gradient pruning and DPSGD lead to a significant drop in utility. However, if we fine-tune a public pre-trained LM on private text without updating word embeddings, it can effectively defend the attack with minimal data utility loss. Together, we hope that our results can encourage the community to rethink the privacy concerns of LM training and its standard practices in the future. 2
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
27 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- LAMP: Extracting Text from Gradients with Language Model Priors cites Inverting Gradients - How easy is it to break privacy in federated learning?
- LAMP: Extracting Text from Gradients with Language Model Priors cites Deep Learning with Differential Privacy
- SPEAR: Exact Gradient Inversion of Batches in Federated Learning cites LAMP: Extracting Text from Gradients with Language Model Priors
- SPEAR: Exact Gradient Inversion of Batches in Federated Learning cites Inverting Gradients - How easy is it to break privacy in federated learning?
- SPEAR: Exact Gradient Inversion of Batches in Federated Learning cites Deep Learning with Differential Privacy
- PrE-Text: Training Language Models on Private Federated Data in the Age of LLMs cites Deep Learning with Differential Privacy
- Language Models are Few-Shot Learners cites The Curious Case of Neural Text Degeneration
- DAGER: Exact Gradient Inversion for Large Language Models cites LAMP: Extracting Text from Gradients with Language Model Priors
- DAGER: Exact Gradient Inversion for Large Language Models cites Inverting Gradients - How easy is it to break privacy in federated learning?
- DAGER: Exact Gradient Inversion for Large Language Models cites Deep Learning with Differential Privacy
- Detecting Pretraining Data from Large Language Models cites Language Models are Few-Shot Learners
- Detecting Pretraining Data from Large Language Models cites Extracting Training Data from Large Language Models
- Extracting Training Data from Large Language Models cites Language Models are Few-Shot Learners
- Extracting Training Data from Large Language Models cites Deep Learning with Differential Privacy
- Extracting Training Data from Large Language Models cites The Curious Case of Neural Text Degeneration
Cited by top-tier papers27
- Detecting Pretraining Data from Large Language ModelsWeijia Shi, Anirudh Ajith, Mengzhou Xia, Yangsibo Huang et al.ICLR 2024 · 365 citations
- LAMP: Extracting Text from Gradients with Language Model PriorsMislav Balunovic, Dimitar I. Dimitrov, Nikola Jovanovic, Martin T. VechevNeurIPS 2022 · 100 citations
- PrE-Text: Training Language Models on Private Federated Data in the Age of LLMsCharlie Hou, Akshat Shrivastava, Hongyuan Zhan, Rylan Conway et al.ICML 2024 · 30 citations
- SPEAR: Exact Gradient Inversion of Batches in Federated LearningDimitar I. Dimitrov, Maximilian Baader, Mark Niklas Müller, Martin T. VechevNeurIPS 2024 · 29 citations
- DAGER: Exact Gradient Inversion for Large Language ModelsIvo Petrov, Dimitar I. Dimitrov, Maximilian Baader, Mark Niklas Müller et al.NeurIPS 2024 · 29 citations
Builds on18
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- Deep Learning with Differential PrivacyMartín Abadi, Andy Chu, Ian J. Goodfellow, H. Brendan McMahan et al.CCS 2016 · 7,620 citations
- The Curious Case of Neural Text DegenerationAri Holtzman, Jan Buys, Li Du, Maxwell Forbes et al.ICLR 2020 · 4,112 citations
- Extracting Training Data from Large Language ModelsNicholas Carlini, Florian Tramèr, Eric Wallace, Matthew Jagielski et al.USENIX Security 2021 · 2,866 citations
- Inverting Gradients - How easy is it to break privacy in federated learning?Jonas Geiping, Hartmut Bauermeister, Hannah Dröge, Michael MoellerNeurIPS 2020 · 1,822 citations
Related papers
- Panning for Gold in Federated Learning: Targeted Text Extraction under Arbitrarily Large-Scale AggregationHong-Min Chu, Jonas Geiping, Liam H. Fowl, Micah Goldblum et al.ICLR 2023
- Uncovering Gradient Inversion Risks in Practical Language Model TrainingXinguo Feng, Zhongkui Ma, Zihan Wang, Eu Joe Chegne et al.CCS 2024 · 2 citations
- Reconstructing Training Data from Adapter-based Federated Large Language ModelsSilong Chen, Yuchuan Luo, Guilin Deng, Yi Liu et al.WWW 2026
- Decepticons: Corrupted Transformers Breach Privacy in Federated Learning for Language ModelsLiam H. Fowl, Jonas Geiping, Steven Reich, Yuxin Wen et al.ICLR 2023 · 10 citations
- Gradient Inversion of Multimodal ModelsOmri Ben Hemo, Alon Zolfi, Oryan Yehezkel, Omer Hofman et al.ICML 2025
