Privacy-preserving Neural Representations of Text

Maximin Coavoux, Shashi Narayan, Shay B. Cohen

Abstract

Neural networks trained on text data often inadvertently encode sensitive private information, such as an author's age or gender, within their hidden representations. This "leakage" poses a significant privacy risk in distributed computing scenarios where latent representations are transmitted over potentially insecure channels. This paper investigates this phenomenon and proposes three adversarial defense mechanisms—Multidetasking, Adversarial Generation, and Declustering—designed to scrub private attributes from neural representations while preserving performance on primary tasks. Our results demonstrate that these methods can effectively reduce information leakage to near-baseline levels with minimal impact on utility.

Introduction

In modern natural language processing (NLP), "shared computation" is a common architecture. A user's local device (e.g., a smartphone) computes a mathematical representation of text and transmits it to a cloud-based server for final processing, such as sentiment analysis or machine translation. However, these hidden representations can act as a "fingerprint," unintentionally encoding demographic data or specific named entities. An attacker eavesdropping on the communication channel can exploit these representations to recover private information, even if the primary model was never trained on it.

Diagram of the privacy-preserving neural representation framework, showing the private input, latent representation, and the potential for an attacker to intercept sensitive data.

The core challenge lies in the privacy-utility tradeoff: how can we "blind" a neural network to private attributes without compromising its ability to perform the intended task?

Methodology

The researchers frame the problem as an adversarial game and propose three distinct defense strategies:

  1. Multidetasking (Adversarial Classification): This approach introduces a "duplicate attacker" during training that attempts to predict private variables from the latent representation. The main model is penalized if the attacker succeeds, forcing it to learn features that are uninformative for the private task.
  2. Adversarial Generation: Instead of targeting specific labels, this method employs a character-based language model to attempt a full reconstruction of the original text from the representation. By penalizing successful reconstruction, the model learns to discard any information that could lead back to the raw input, providing a more general defense.
  3. Declustering: This geometric approach adds a penalty to the loss function that discourages the model from clustering examples with shared private attributes in the representation space, thereby smoothing out the "fingerprints" of sensitive data.

Experimental Setup

The effectiveness of these methods was evaluated across several diverse datasets:

  • Trustpilot Corpus: Sentiment analysis across five countries, including self-reported birth year and gender metadata.
  • AG News & Deutsche Welle (DW): Topic classification where the "private" information was the presence of specific named entities (people).
  • Blog Authorship Corpus: Topic classification with age and gender as private variables.

Results and Key Insights

The study confirms that neural networks are "greedy" feature extractors. If a private attribute like age correlates even slightly with the primary task (e.g., sentiment), the network will encode it to maximize accuracy.

Baseline attacker performance across various datasets, showing significant leakage of gender and age information compared to most frequent class baselines.

Key findings include:

  • Vulnerability: Without defenses, attackers could recover private information with accuracy up to 25 percentage points higher than the baseline.
  • Defense Effectiveness: The proposed methods successfully reduced attacker accuracy, often reaching near-baseline levels. For example, on the German Trustpilot dataset, privacy improved significantly while sentiment accuracy only decreased by 0.6%.
  • Generalist Defense: Adversarial Generation proved highly effective as a "blind" defense, protecting against various attribute-recovery attacks without requiring labeled private data.
  • Stability: Multidetasking was identified as the most stable and computationally efficient approach for scenarios with known risks.

Conclusion

While the proposed defenses are effective, a "correlation trap" remains: if private information is inextricably linked to the primary task label, scrubbing it will inevitably degrade performance. Future work should investigate robustness against a wider variety of reconstruction methods and explore ways to navigate these deep correlations. This research highlights the critical need for privacy-by-design in distributed NLP systems.

Summary updated

BibTeX
@inproceedings{coavoux2018privacy,
  author = {Maximin Coavoux and Shashi Narayan and Shay B. Cohen},
  title = {{Privacy-preserving Neural Representations of Text}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2018},
  doi = {10.18653/v1/d18-1001},
}
Figure