Skip to main content
QUICK REVIEW

[Paper Review] LAMP: Extracting Text from Gradients with Language Model Priors

Mislav Balunović, Dimitar I. Dimitrov|arXiv (Cornell University)|Feb 17, 2022
Privacy-Preserving Technologies in DataComputer Science21 citations
TL;DR

LAMP attacks textual models in federated learning by combining gradient reconstruction with a GPT-2–based language prior and alternating continuous and discrete optimization to recover private text from gradients, outperforming prior methods in realism and length of reconstructed text.

ABSTRACT

Recent work shows that sensitive user data can be reconstructed from gradient updates, breaking the key privacy promise of federated learning. While success was demonstrated primarily on image data, these methods do not directly transfer to other domains such as text. In this work, we propose LAMP, a novel attack tailored to textual data, that successfully reconstructs original text from gradients. Our attack is based on two key insights: (i) modeling prior text probability with an auxiliary language model, guiding the search towards more natural text, and (ii) alternating continuous and discrete optimization, which minimizes reconstruction loss on embeddings, while avoiding local minima by applying discrete text transformations. Our experiments demonstrate that LAMP is significantly more effective than prior work: it reconstructs 5x more bigrams and 23% longer subsequences on average. Moreover, we are the first to recover inputs from batch sizes larger than 1 for textual models. These findings indicate that gradient updates of models operating on textual data leak more information than previously thought.

Motivation & Objective

  • Motivate and demonstrate that gradient updates from text models leak private user text in federated learning.
  • Propose LAMP, a text-specific gradient leakage attack that uses language model priors to guide reconstruction toward natural text.
  • Show that LAMP reconstructs more text (bigrams and longer subsequences) than prior attacks across diverse models and batch sizes.
  • Assess LAMP under realistic settings, including larger batch sizes, fine-tuned models, and defended models.

Proposed method

  • Initialize reconstruction by sampling token embeddings from a Gaussian prior.
  • Minimize a reconstruction loss that aligns gradients of the reconstruction with observed client gradients, using either L2/L1 or cosine-based gradient losses.
  • Apply an embedding length regularization to keep embedding norms in line with vocabulary statistics.
  • Iteratively alternate between continuous optimization (gradient descent on embeddings) and discrete optimization (generate candidate sentences via transformations and select by combined reconstruction loss and perplexity).
  • Use an auxiliary language model (e.g., GPT-2) to compute perplexity and guide discrete search toward natural text.
  • Project final embeddings to nearest vocabulary tokens to obtain the reconstructed text.

Experimental results

Research questions

  • RQ1Can textual inputs be reconstructed from gradient updates in federated learning for transformer-based models?
  • RQ2Does incorporating a language model prior improve the naturalness and accuracy of reconstructed text compared to prior gradient leakage methods?
  • RQ3How do batch size, model size, and fine-tuning affect the leakage of textual data via gradients?
  • RQ4Are defended or privately trained models still vulnerable to gradient leakage when using LAMP?
  • RQ5What is the impact of continuous versus discrete optimization components on reconstruction quality?

Key findings

  • LAMP reconstructs significantly more text than prior attacks, including up to 5x more bigrams and up to 23% longer subsequences on average for certain settings.
  • LAMP is effective across multiple BERT variants (BASE, LARGE) and a TinyBERT, including fine-tuned models and defended models.
  • LAMP enables text reconstruction even when batch sizes exceed 1, a setting previously unexplored for textual gradient leakage.
  • Using GPT-2 as a language prior improves recovery realism and coherence of reconstructed text.
  • Discreet transformations combined with language-model perplexity guidance yield better results than relying on gradient loss alone.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.