Robust Utility-Preserving Text Anonymization Based on Large Language Models

Tianyu Yang, Xiaodan Zhu, Iryna Gurevych

Abstract

Modern Large Language Models (LLMs) pose a significant threat to privacy due to their ability to re-identify individuals from seemingly anonymized text. This paper introduces RUPTA (Robust Utility-Preserving Text Anonymization), a framework that leverages LLMs to iteratively rewrite text, balancing privacy protection against data utility. By employing a lexicographic optimization strategy and distilling these capabilities into smaller models via Direct Preference Optimization (DPO), RUPTA effectively thwarts sophisticated re-identification attacks while maintaining high performance for downstream AI tasks.

Introduction

Traditional text anonymization methods typically focus on masking explicit identifiers such as names, dates, and locations. However, LLMs can reason over dispersed semantic patterns to "connect the dots," identifying subjects even in heavily redacted documents. This creates a critical privacy-utility tradeoff: excessive scrubbing renders data useless for analysis, while insufficient scrubbing leaves individuals vulnerable. RUPTA addresses this by explicitly optimizing for both privacy and utility through a multi-agent feedback loop.

Methodology

The RUPTA framework treats anonymization as a multi-objective optimization problem, utilizing three specialized LLM-based agents: the P-Evaluator (Privacy), the U-Evaluator (Utility), and the L-Optimizer (The Editor).

The RUPTA framework architecture involving multi-agent interactions.

Lexicographic Optimization (LO)

To manage competing goals, RUPTA employs Lexicographic Optimization. Privacy is prioritized as the primary objective; the optimizer generalizes identifiers until a safety threshold is reached. Once privacy is secured, the model shifts focus to maximizing utility without degrading the established privacy level.

Model Distillation

To reduce the computational overhead of iterative prompting, the authors distilled RUPTA’s logic into smaller "student" models (e.g., Llama-3-8b, Phi-3 Mini) using Direct Preference Optimization (DPO). This enables high-quality, single-pass anonymization suitable for real-time deployment.

Evaluation and Results

The framework was evaluated on two datasets: DB-bio, a new benchmark of celebrity biographies with hierarchical occupation labels, and PersonalReddit (PR), a collection of synthetic Reddit comments.

RUPTA (using GPT-4) achieved a re-identification Success Rate (SR) of 52.67% on DB-bio, significantly lower than Microsoft Azure's anonymizer (78.24% SR). Crucially, it maintained a downstream task accuracy of 96.02%, outperforming baselines in both safety and utility. Distilled models like Phi-3 Mini showed comparable performance to the GPT-4 teacher, demonstrating the effectiveness of the DPO approach.

Key Insights

RUPTA moves beyond static masking by using natural language feedback to target implicit identifiers. For instance, if an attacker identifies a subject via specific career milestones, the optimizer generalizes these facts (e.g., "10 Grand Slam titles" becomes "multiple major titles") rather than simply deleting them.

Comparison of anonymization outputs between standard adversarial feedback and the RUPTA framework.

This "feedback-driven scrubbing" ensures that the "utility floor" is maintained—preserving the characteristics necessary for the task while obscuring the unique identity.

Conclusion and Future Work

RUPTA represents a significant step toward robust, task-aware text anonymization. While the current framework provides strong empirical protection, future work will focus on reducing the cost of generating training data and exploring formal privacy guarantees. Additionally, expanding the framework to specialized domains like medical or legal records remains a priority.

Summary updated

BibTeX
@inproceedings{yang2025robust,
  author = {Tianyu Yang and Xiaodan Zhu and Iryna Gurevych},
  title = {{Robust Utility-Preserving Text Anonymization Based on Large Language Models}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure