Skip to main content
QUICK REVIEW

[Paper Review] Text Revealer: Private Text Reconstruction via Model Inversion Attacks against Transformers

Ruisi Zhang, Seira Hidano|arXiv (Cornell University)|Sep 21, 2022
Adversarial Robustness in Machine LearningComputer Science13 citations
TL;DR

Text Revealer proposes the first model inversion attack for reconstructing private text data from fine-tuned transformer-based text classification models. By leveraging domain-specific public data to pre-train a GPT-2 generator and iteratively perturbing its hidden states using feedback from the target model, the method achieves high-fidelity reconstruction of private training texts with 84.29% reconstruction rate and 34.22% accuracy on benchmark datasets.

ABSTRACT

Text classification has become widely used in various natural language processing applications like sentiment analysis. Current applications often use large transformer-based language models to classify input texts. However, there is a lack of systematic study on how much private information can be inverted when publishing models. In this paper, we formulate \emph{Text Revealer} -- the first model inversion attack for text reconstruction against text classification with transformers. Our attacks faithfully reconstruct private texts included in training data with access to the target model. We leverage an external dataset and GPT-2 to generate the target domain-like fluent text, and then perturb its hidden state optimally with the feedback from the target model. Our extensive experiments demonstrate that our attacks are effective for datasets with different text lengths and can reconstruct private texts with accuracy.

Motivation & Objective

  • To investigate how much private information can be reconstructed from fine-tuned transformer-based text classification models through model inversion attacks.
  • To address the gap in systematic study of text model inversion attacks, especially for transformers, compared to existing work in vision and tabular data.
  • To develop a method that reconstructs fluent, meaningful private texts from the target model's predictions without requiring training data access.
  • To evaluate the effectiveness of the attack across different text lengths, model architectures (BERT, TinyBERT), and datasets (Emotion, Yelp).

Proposed method

  • Collect a public dataset from the same domain as the private dataset to ensure distributional similarity.
  • Perform n-gram analysis on the public dataset to extract high-frequency phrases as templates for text generation.
  • Fine-tune a GPT-2 language model on the public dataset to generate fluent, domain-appropriate text.
  • Apply iterative hidden state perturbation to the GPT-2 output using feedback from the target model’s prediction scores.
  • Optimize the perturbation using cross-entropy loss between the target model’s output and the desired label distribution.
  • Use Principal Component Analysis (PCA) to visualize and compare the semantic similarity of inverted and ground-truth embeddings.

Experimental results

Research questions

  • RQ1To what extent can private training texts be reconstructed from a fine-tuned transformer model using only white-box access to its predictions?
  • RQ2How does the length of the generated template affect the quality and accuracy of the reconstructed private text?
  • RQ3How effective is the attack across different transformer architectures (e.g., BERT vs. TinyBERT) and text classification datasets?
  • RQ4How well do the inverted texts match the semantic and distributional properties of the original private training data?
  • RQ5What role does the public dataset’s similarity to the private dataset play in enabling successful reconstruction?

Key findings

  • Text Revealer achieves a reconstruction rate (RR) of 84.29% and an accuracy (Acc) of 34.22% on the Emotion and Yelp datasets using BERT and TinyBERT as target models.
  • The attack maintains high performance across different text lengths, with reconstruction accuracy decreasing as template length shortens—longer templates yield better results.
  • The Kendall tau distance between public and private datasets shows strong token frequency correlation (0.99 for top 10 tokens), supporting the use of public data for template generation.
  • Fine-tuned models show a significant accuracy gap between public and private datasets (e.g., BERT achieves 99.66% on private vs. 91.25% on public), indicating memorization of training data.
  • Inverted examples from the attack are semantically coherent and contextually close to ground truth, as shown by PCA visualization and sentence-level comparison in Table 5.
  • The method outperforms alternative loss functions such as Gumbel softmax and modified entropy loss in both reconstruction rate and accuracy.

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.