Recovering from privacy-preserving masking with large language models

Arpita Vats, Zhe Liu, Debjyoti Paul, Yingyi Ma, Yutong Pang, Zeeshan Ahmed, Ozlem Kalinli · DOI · OpenReview

TL;DR

This paper tackles the challenge of adapting NLP models to user data while preserving privacy. They propose using Large Language Models (LLMs) to intelligently replace masked sensitive information in text, demonstrating that models trained on this "obfuscated" data can achieve performance comparable to models trained on original, unmasked data.

What Problem Does This Paper Address?

When deploying machine learning models, especially in natural language processing (NLP), there's often a gap between the data used for training (proxy data) and the real-world data users provide. To bridge this gap, models are often adapted using user data. However, storing and processing this user data, which can contain sensitive personal information like names and addresses, raises significant privacy and security concerns. Existing methods for protecting this data, like masking sensitive tokens with a generic "[MASK]" symbol, can disrupt the natural flow and meaning of text, leading to a drop in model performance. This paper aims to find a way to mask sensitive information effectively for privacy while minimizing the performance degradation.

Methods

The core of this work lies in using Large Language Models (LLMs) to "recover" the semantic meaning after sensitive tokens have been masked. They propose a framework that involves:

  1. Privacy-Preserving Token Masking: Three techniques are used to identify and mask sensitive tokens:
  2. allowList: A pre-defined list of non-sensitive tokens. Any token not on this list is masked.
  3. vocabThres: Masks tokens that appear less frequently than a certain threshold, assuming rarer tokens are more likely to be sensitive.
  4. entityTagger: Uses Named Entity Recognition (NER) models to identify and mask personal entities like names, locations, and organizations.
  5. LLM-Based Token Substitution: After masking, LLMs are employed to suggest replacements for the "[MASK]" tokens. The goal isn't to perfectly restore the original token but to provide a semantically appropriate substitute. They explore several LLM-based strategies:
  6. Top-1: Uses the single most probable token predicted by the LLM.
  7. Top-K: Randomly selects a token from the top K most probable predictions. Special handling is included to avoid selecting tokens that were originally on an allowList or vocabThres list.
  8. Fine-Tuning (FT): Pre-trained LLMs are fine-tuned on the masked corpus to better adapt them to the task of filling in masks. This can be done either by fine-tuning on the masked data directly or by first using Top-1/Top-K to fill masks and then fine-tuning on the resulting "obfuscated" corpus.
  9. Downstream Task Evaluation: The effectiveness of these methods is evaluated by training NLP models (specifically, language models for language modeling tasks and fused LMs for automatic speech recognition) on the "obfuscated" corpora and comparing their performance to models trained on original, unmasked data.

Datasets

The experiments were conducted on three datasets:

  • Fisher: A dataset for language modeling.
  • Pushshift.io Reddit: A large collection of Reddit comments, also used for language modeling.
  • Wall Street Journal (WSJ): Used for both language modeling and, crucially, for evaluating Automatic Speech Recognition (ASR) models when fused with language models. The WSJ test set includes audio data for ASR evaluation.

Key Insights and Ideas

  • LLMs as Privacy-Preserving Replacers: The central idea that LLMs can be effectively leveraged to fill in masked tokens with semantically relevant substitutes is a key contribution. This moves beyond simple random replacement or generic masking.
  • Comparable Performance: The most significant finding is that models trained on data where sensitive information has been masked and then intelligently replaced by LLMs can achieve performance nearly as good as models trained on the original, unmasked data. This suggests a viable path for privacy-preserving model adaptation.
  • Masking Strategy Matters: The choice of masking technique (allowList, vocabThres, entityTagger) impacts the number of masked tokens and, consequently, the difficulty of recovery. allowList masks the most tokens, leading to a larger performance gap.
  • Fine-tuning Boosts Performance: Fine-tuning LLMs on the masked corpus generally leads to better recovery and improved downstream task performance compared to using off-the-shelf pre-trained LLMs.
  • ROBERTa Shines: Among the LLMs tested, fine-tuned ROBERTa consistently delivered the best perplexity results, often coming very close to the "Oracle" (unmasked) baseline.

Key Results

  • Language Modeling: Across all datasets (Fisher, Reddit, WSJ), the proposed LLM-based methods consistently outperformed the basic baselines (direct training on masked data or zero-weight masking). Fine-tuned ROBERTa (Top-K, FT) achieved perplexity scores very close to the Oracle baseline on Fisher and Reddit.
  • Automatic Speech Recognition (ASR): On the WSJ dataset, using fused LMs trained on obfuscated data significantly improved ASR performance. The Word Error Rate (WER) for models trained with LLM-recovered data showed only a small gap (around 1-5%) compared to the Oracle LM, demonstrating substantial privacy protection with minimal performance loss. For instance, with vocabThres masking, the WER difference between Oracle and fine-tuned ROBERTa was only 0.3%.

Limitations and Future Work

  • LLM Choice: While ROBERTa performed best, the paper notes that LLAMA2 (Top-1, FT) was competitive but not as strong. The performance can vary depending on the LLM used.
  • Masking Granularity: The paper suggests future work could explore combining the three masking techniques or using more specific class-based markers (e.g., [PERSON], [NUMBER]) instead of a generic [MASK].
  • Fine-tuning Objective: The authors propose exploring fine-tuning objectives that are more directly aligned with the downstream NLP tasks, rather than relying solely on masked language modeling.
  • Computational Cost: While not explicitly detailed as a limitation, using large LLMs for substitution and fine-tuning can be computationally intensive.

Summary updated

Abstract

Model adaptation is crucial to handle the discrepancy between proxy training data and actual users’ data received. To effectively perform adaptation, textual data of users is typically stored on servers or their local devices, where downstream natural language processing (NLP) models can be directly trained using such in-domain data. However, this might raise privacy and security concerns due to the extra risks of exposing user information to adversaries. Replacing identifying information in textual data with a generic marker has been recently explored. In this work, we leverage large language models (LLMs) to suggest substitutes of masked tokens and have their effectiveness evaluated on downstream language modeling tasks. Specifically, we propose multiple pre-trained and fine-tuned LLM-based approaches and perform empirical studies on various datasets for the comparison of these methods. Experimental results show that models trained on the obfuscation corpora are able to achieve comparable performance with the ones trained on the original data without privacy-preserving token masking.
BibTeX
@inproceedings{vats2024recovering,
  author = {Arpita Vats and Zhe Liu and Debjyoti Paul and Yingyi Ma and Yutong Pang and Zeeshan Ahmed and Ozlem Kalinli},
  title = {{Recovering from privacy-preserving masking with large language models}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2024},
  doi = {10.1109/icassp48485.2024.10448234},
}
Figure