[Paper Review] Recovering Private Text in Federated Learning of Language Models
The paper introduces FILM, a text-specific gradient-inversion attack for federated learning of language models that can recover single or multiple sentences from batches up to 128, and proposes embedding-freezing as a defense with public-pretrained models offering better privacy-utility trade-offs.
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.
Motivation & Objective
- Motivate privacy concerns in federated learning for language models and demonstrate feasibility of recovering private text from gradients.
- Develop a text-focused attack (FILM) that exploits embedding gradients to recover words and reconstruct sentences.
- Evaluate attack performance on large LM datasets and assess defense methods.
- Propose a simple embedding-freezing defense and analyze privacy-utility trade-offs in different training setups.
Proposed method
- Extract a bag of words from word embedding gradients to identify candidate words in the private batch.
- Use beam search driven by a pre-trained or memorized language model to reconstruct sentences from the word set.
- Apply a prior-based reordering step that combines perplexity with gradient norm to refine recovered sentences.
- Iteratively apply the attack to recover multiple sentences from the same batch.
Experimental results
Research questions
- RQ1Can an eavesdropper recover private text from gradients in federated LM training with large batch sizes (up to 128 sentences)?
- RQ2How effective is an attack that leverages embedding gradients and language priors at reconstructing sentences from private batches?
- RQ3What defenses can mitigate this leakage without prohibitive utility loss, and how do they perform with public versus randomly initialized LMs?
Key findings
- FILM can recover single sentences with high fidelity from batches up to 128 sentences and can recover parts of multiple sentences via iteration.
- Attack performance improves when starting from a pre-trained LM and increases as training progresses due to memorization.
- Gradient pruning and DPSGD reduce utility significantly, while freezing word embeddings effectively defends FILM with minimal utility loss when starting from a public LM.
- Re-training from scratch on private text incurs higher utility loss than starting from a public LM with embeddings frozen.
- The approach works on WikiText-103 and Enron Email with GPT-2 base, demonstrating practical privacy risks in real-world LM federated setups.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.