NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Bootstrapping Text Anonymization Models with Distant Supervision

Anthi Papadopoulou, Pierre Lison, Lilja Øvrelid, Ildikó Pilán

Introduction

Sharing sensitive text data, such as medical records or legal documents, is increasingly restricted by privacy regulations like the GDPR. Traditional de-identification methods often focus on a fixed set of direct identifiers (e.g., names, SSNs). However, true anonymization must also address "quasi-identifiers"—information that is not sensitive in isolation (like a profession or birth year) but can uniquely identify an individual when combined.

The primary obstacle to developing robust anonymization models is the scarcity of labeled data. Manually annotating documents to determine which specific tokens must be masked to protect privacy is a labor-intensive process requiring legal and domain expertise. This paper proposes a novel method to overcome this bottleneck by using distant supervision from knowledge graphs to automatically generate training data.

Methodology

The authors introduce a three-step pipeline designed to bootstrap a text anonymization model without manual labeling:

  1. Modeling Background Knowledge: A knowledge graph (KG), specifically a subset of Wikidata containing 22 million terms, is converted into an inverted index. This index maps terms (e.g., "Lisbon," "footballer") to the unique individuals in the database who share those attributes.
  2. Distant Labeling via $k$-anonymity: Using raw text from Wikipedia biographies, the system identifies entity mentions. It then applies a $k$-anonymity function: if a combination of terms in a sentence identifies fewer than $k$ individuals (where $k=5$), the system automatically flags the specific terms that must be masked to ensure the individual remains indistinguishable within a larger group.
  3. Neural Model Fine-tuning: This automatically labeled corpus is used to fine-tune a RoBERTa language model. By training on the context of these masks, the model learns to generalize linguistic patterns of sensitive information, allowing it to anonymize texts about individuals not present in the original KG.
The proposed pipeline for bootstrapping text anonymization models using distant supervision from a knowledge graph.

Datasets and Evaluation

The training set consisted of over 500,000 automatically labeled Wikipedia biographies. To evaluate the approach, the authors created a manually annotated gold standard of 553 Wikipedia summaries, labeled by law students and NLP researchers. They also utilized the Text Anonymization Benchmark (TAB), featuring court cases from the European Court of Human Rights, to test cross-domain generalization.

Key Results

The distantly supervised models, referred to as GreedyBERT and RandomBERT, demonstrated a significant advantage in identifying high-risk information compared to standard approaches.

Comparison of the distantly supervised models (GreedyBERT, RandomBERT) against a standard RoBERTa NER baseline.

As shown in the results, GreedyBERT achieved a recall of 0.898 for direct identifiers, substantially outperforming a standard RoBERTa model trained for Named Entity Recognition (NER), which scored 0.810. While the distantly supervised models exhibited lower precision (approximately 0.66 compared to 0.77 for NER), this "over-masking" is often preferred in privacy-preserving contexts as it prioritizes safety over data utility.

Insights and Limitations

A key insight of this work is the shift from category-first to privacy-first modeling. Rather than simply identifying entity types, the model learns to evaluate disclosure risk based on linguistic context. This allows the model to recognize that phrases following "born in..." or "works as a..." are high-risk, even if the specific values are novel.

However, the approach is limited by the quality and coverage of the underlying Knowledge Graph. If the KG lacks information about an individual, the distant supervision may fail to label sensitive traits, leading to potential information leaks. Furthermore, rare but non-sensitive terms may occasionally trigger "spurious masking." Future research will focus on improving the estimation of how identifying a term is in a real-world context and refining the white-listing of common words.

Summary updated

BibTeX
@inproceedings{papadopoulou2022bootstrapping,
  author = {Anthi Papadopoulou and Pierre Lison and Lilja Øvrelid and Ildikó Pilán},
  title = {{Bootstrapping Text Anonymization Models with Distant Supervision}},
  booktitle = {LREC},
  year = {2022},
}
Figure