LAMP: Extracting Text from Gradients with Language Model Priors

Mislav Balunović, Dimitar I. Dimitrov, Nikola Jovanović, Martin Vechev
2/17/2022
104 citations
cs.LGcs.DC

Official code: eth-sri/lamp (29 stars, Python, Apache-2.0, last commit 2025-05-26).

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

eth-sri/lampOfficial100%
Apache-2.0

LAMP: Extracting Text from Gradients with Language Model Priors (NeurIPS '22)

298Python, ShellOct 12, 20221 years agoApache-2.0

Similar Papers

Cite this paper

@article{balunovi2022lamp,
  title  = {LAMP: Extracting Text from Gradients with Language Model Priors},
  author = {Mislav Balunović and Dimitar I. Dimitrov and Nikola Jovanović and Martin Vechev},
  year   = {2022},
  eprint = {2202.08827},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2202.08827}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2202.08827.svg)](https://codeofpaper.com/paper/2202.08827)

Discussion