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 SifaarXiv 2026

TL;DR

Anonymizing text to protect privacy comes at a cost: it generally degrades large language model (LLM) performance, but the impact is highly task- and model-dependent. Surprisingly, more capable models suffer the largest performance drops, while retrieval-heavy tasks collapse completely under anonymization. However, using reversible pseudonymization techniques and avoiding irreversible redaction can help preserve model utility.

What Problem Does This Paper Address?

As LLMs are increasingly deployed in sensitive areas like medicine, law, and finance, protecting personally identifiable information (PII) is paramount. A common defense is data anonymization—scrubbing names, locations, and dates before sending data to the model.

However, we don't fully understand how this preprocessing affects the "intelligence" of the model. Does stripping real-world entities break the contextual patterns the model relies on to reason? This paper presents a systematic empirical study to quantify this privacy-utility trade-off across various state-of-the-art LLMs and diverse benchmarks.

Methods

The authors built a modular evaluation pipeline to test models under both original and anonymized conditions.

Figure 1: Architecture overview of our encoder-only contradiction detection approach.

The core stages include:

  1. Anonymization: Replacing PII with category-unique placeholders (e.g., replacing "London" with <LOC>-1 and "Berlin" with <LOC>-2) to preserve entity uniqueness.
  2. Inference: Running LLMs on both original and anonymized prompts.
  3. De-anonymization: Mapping placeholders back to their original PII before scoring to ensure a fair comparison against ground-truth answers.

The authors also compared five distinct anonymization techniques: pseudonymization (the baseline placeholder method), generalization (e.g., changing "London" to [CITY]), masking (e.g., Lo****), randomization (replacing with random strings), and redaction (replacing with a fixed [REDACTED] block). Finally, they tested whether explicitly prompting the model that the text was anonymized would help it adapt its reasoning.

Datasets

The study evaluated models across 11 diverse benchmarks to cover a wide spectrum of cognitive and linguistic domains, standardizing the sample size to a total of 6,210 unique test cases:

  • Reasoning & Academic: ARC, BIG-Bench Hard, HellaSwag, MMLU-PRO, MUSR
  • Domain-Specific: MedQA (Medical), EQ-Bench (Emotional Intelligence)
  • Instruction Following & Translation: IFEval, WMT 2014 (English-to-German)
  • Knowledge Retrieval & Truthfulness: RGB (Retrieval-Augmented Generation), TruthfulQA

Key Insights and Ideas

  • The Capability Paradox: More powerful models (like Qwen2.5-72B and GPT-4o mini) experience the largest absolute performance drops when data is anonymized. This suggests that state-of-the-art models rely more heavily on specific, concrete entity information to ground their advanced reasoning capabilities.
  • Task-Dependent Sensitivity: The impact of anonymization is not uniform. Retrieval-Augmented Generation (RAG) tasks (like RGB) collapse catastrophically because they require precise entity matching across multiple sources.
  • The TruthfulQA Anomaly: Intriguingly, performance on TruthfulQA improved across the board under anonymization. Stripping real-world named entities seems to prevent the models from triggering incorrect memorized associations, thereby mitigating their tendency to hallucinate plausible-sounding falsehoods.
  • Reversibility is Key: Anonymization techniques that preserve entity uniqueness (pseudonymization, masking, randomization) significantly outperform irreversible methods (redaction and generalization). If a model cannot distinguish between different masked entities, its reasoning chain breaks.
  • Prompting is Useless: Meta-prompting the model with instructions like "This prompt has been anonymized... respond as accurately as possible" yielded no discernible performance benefits. LLMs do not alter their underlying reasoning strategies based on this meta-information.

Key Results

The authors evaluated five models: GPT-4o mini, Teuken-7B, Llama-3.1-8B, Gemma-2-27B, and Qwen2.5-72B.

  • Average Degradation: Qwen2.5-72B's average performance across all benchmarks dropped by 6.9 percentage points, whereas the less capable Teuken-7B only dropped by 2.3 percentage points.
  • RAG Collapse: On the retrieval-heavy RGB benchmark, GPT-4o mini’s score plummeted from 0.80 (original) to 0.32 (anonymized).
  • TruthfulQA Boost: Llama-3.1-8B showed a clear performance increase on TruthfulQA, jumping from 0.70 to 0.78 when inputs were anonymized.
  • Technique Comparison: On the MUSR benchmark, using generalization or redaction led to low scores (0.58 and 0.52, respectively), while pseudonymization maintained a much higher utility score of 0.70 (compared to the original input score of 0.73).

Limitations and Future Work

The authors noted that raw input characteristics—such as total entity counts or input token length—did not statistically correlate with performance drops. This means the negative impacts are mediated by complex, task-specific semantics rather than simple data metrics, making systematic errors difficult to predict.

Future work should focus on developing more granular anonymization controls that selectively target specific entity types based on the task's requirements. Additionally, the authors suggest exploring the development of LLMs that are inherently robust to PII removal or fine-tuning models specifically to comprehend anonymized representations.

Summary updated

BibTeX
@misc{deuer2026impact,
  author = {Tobias Deußer and Max Hahnbück and Lorenz Sparrenberg and Tobias Uelwer and Christian Bauckhage and Rafet Sifa},
  title = {{On the Impact of Anonymization on the Performance of Large Language Models}},
  year = {2026},
  eprint = {2609.11335},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.11335},
}
Figure