Manuscript Offprint

arXiv:2609.11335

On the Impact of Anonymization on the Performance of Large Language Models

Tobias Deußer, Max Hahnbück, Lorenz Sparrenberg, Tobias Uelwer, Christian Bauckhage, Rafet Sifa

ABSTRACT

As large language models are increasingly deployed in sensitive domains, anonymizing input data to protect personally identifiable information has become a critical practice. However, the impact of this anonymization on model utility is not well understood. This paper presents a systematic empirical study of the trade-off between privacy and performance. We evaluate five prominent language models across eleven diverse benchmarks, comparing their performance on original versus pseudonymized inputs. Our results reveal that while anonymization generally degrades performance, the effect is highly nuanced. We find that more capable models, such as Qwen2.5-72B and GPT-4o mini, suffer the largest performance drops, suggesting a stronger reliance on specific entity information. The impact is also task-dependent: performance on TruthfulQA improves with anonymization, while retrieval-focused tasks like RGB experience a catastrophic decline. Further experiments show that reversible anonymization techniques that preserve entity uniqueness significantly outperform irreversible ones like redaction, and that explicitly prompting models about anonymization offers no discernible benefit. We conclude that anonymization is not a one-size-fits-all solution and must be co-designed with the model and task in mind to balance privacy and utility effectively. Our findings provide a crucial baseline for developing more robust, privacy-aware AI systems.

Keywords anonymization · large language models · natural language processing · machine learning

1 Introduction

Large Language Models (LLMs) have become increasingly central to modern artificial intelligence applications, from analyzing medical reports [1], writing legal documents [2], finding contradictions in financial documents [3], connecting patients with rare diseases with each other [4], to enabling automated auditing for financial reports [5]. Yet, as such LLM approaches are deployed in real-world settings, privacy concerns are becoming more and more prevalent [6, 7]. One common mitigation strategy is anonymization, i.e., removing or masking personally identifiable information (PII) before feeding inputs into a model [8, 9, 10].

But what does this actually cost us in terms of performance? In this paper, we take a systematic look at the tradeoff between privacy and capability. We evaluate a set of five models (see Table 3) spanning a wide range of sizes and capabilities across eleven diverse benchmarks (see Table 1). These benchmarks cover a spectrum of natural language processing (NLP) tasks, including general scientific reasoning (ARC, 11), medical question answering (MedQA, 12), emotional intelligence (EQ-Bench, 13), and translation (WMT 2014, 14), allowing us to assess the trade-off across different cognitive and linguistic domains.

*tdeusser@uni-bonn.de, ORCID-ID: 0000-0003-4685-0847

We observe that, while anonymization generally degrades performance as expected, the magnitude of this effect is highly dependent on the model's capability, the nature of the task, and the specific anonymization technique employed. Our key findings are threefold:

  1. Model capability is inversely correlated with robustness to anonymization. More powerful models like Qwen2.5-72B [15] and GPT-4o mini [16] experience the largest performance drops, suggesting they rely more heavily on specific entity information to achieve their state-of-the-art performance.

  2. Task sensitivity varies dramatically. Performance on retrieval-intensive benchmarks like RGB collapses catastrophically post-anonymization. Conversely, on TruthfulQA, a benchmark designed to test factual accuracy, performance consistently improves, suggesting that removing named entities can mitigate a model's tendency to hallucinate incorrect associations.

  3. Technique and prompting matter, but not always as expected. Reversible anonymization techniques like pseudonymization, which preserve entity uniqueness, significantly outperform irreversible methods like redaction. However, explicitly prompting a model that its input has been anonymized yields no discernible performance benefit.

Our results challenge the notion of anonymization as a one-size-fits-all solution, demonstrating that it must be co-designed with the model and task in mind. These findings provide actionable insights for practitioners and a foundation for the discussion on and development of more robust, privacy-aware, and ultimately more trustworthy NLP systems.

References (39)