Manuscript Offprint

arXiv:2609.03464

Mind the Gap: Robustness Risks in PII Detection Systems

Adeel Zafar, Slawomir Nowaczyk

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Adeel Zafar and Sławomir Nowaczyk

Center for Applied Intelligent Systems Research, Halmstad University, Sweden {adeel.zafar, slawomir.nowaczyk}@hh.se

Abstract. Personally Identifiable Information (PII) detection is a foundational component of data protection infrastructure where missed entities constitute direct privacy and security risks. Although modern PII systems report strong performance on standard benchmarks, we show that these evaluations mask substantial robustness failures under realistic distribution shifts encountered in deployment. Rather than comparing state-of-the-art accuracy, we study how different PII detection paradigms fail under noisy, unstructured, and informal inputs. We construct a stress test benchmark spanning seven categories of natural distribution shift and evaluate representative systems from three widely deployed architectural families: encoder-based NER (SpaCy), rule-based hybrid detection (Presidio), and generative LLM extraction (Qwen2.5-3B).

All three exhibit significant degradation on out-of-distribution inputs, but with distinct and complementary failure modes. Encoder models primarily fail on unseen surface forms and boundary detection, rule-based systems fail on non-standard formats, and LLMs exhibit entity-type confusion and generation instability. These results show that aggregate benchmark scores obscure deployment-critical weaknesses and that no single architecture is uniformly reliable across PII categories. Motivated by these findings, we propose a hybrid detection pipeline with a QA-driven feedback loop for iterative risk mitigation, and release our benchmark to support OOD-aware evaluation of PII systems.

Keywords: PII Detection · Data Protection · Out-of-Distribution Robustness · Named Entity Recognition · Privacy Risk Assessment

1 Introduction

PII detection is a safety critical task in modern NLP pipelines and a foundational component of data protection infrastructure. Organizations rely on these systems to identify and redact sensitive entities before data is stored, shared, or processed. A missed entity is not merely an accuracy shortfall but a data protection failure with consequences under regulations such as GDPR [13]. As organizations increasingly automate PII redaction in pipelines handling customer data, medical records, and financial documents, the reliability of these systems

A. Zafar et al.

becomes a direct security concern. Current PII detection systems, whether encoder based [4], rule-based Presidio¹, or LLM based [3], report F1 scores exceeding 90% on standard benchmarks [12,15]. However, this confidence is misleading because these benchmarks consist of well edited, formally structured text drawn from news articles and encyclopedic sources, while real world inputs are messy, unstructured, and highly variable across domains.

The distribution shift problem is compounded when PII detection systems are deployed across different verticals. A model trained on general purpose corpora encounters fundamentally different language patterns in healthcare records, financial documents, customer support transcripts, or social media. The entity types may be the same but the surrounding context, formatting conventions, and vocabulary differ substantially. These cross domain shifts interact with the textual messiness we study in this paper, creating compounding challenges that current benchmarks do not capture.

Our goal is not to identify a single state-of-the-art PII detector, but to study how fundamentally different detection paradigms fail under realistic distribution shifts. We therefore evaluate representative systems from three widely deployed architectural families: encoder-based NER, rule-based hybrid detection, and generative LLM extraction. By comparing qualitatively different detection mechanisms rather than optimizing leaderboard performance, we aim to characterize complementary robustness failures that aggregate benchmark scores obscure.

In our evaluation, we find that all three architectural families exhibit significant and systematic performance degradation on unstructured inputs. Flexible format entities such as LOCATION and ADDRESS suffer the most, with LOCATION recall dropping from 0.725 to 0.457 across all models, while rigid format entities like SSN and IP addresses remain largely unaffected. Crucially, each architecture fails in different ways on the same input. Consider the following example:

“name William Stevenson address 588 Erickson Hills Suite 055 South Brandytown, PA ssn 486-34-9478 dob 08/21/1981”

The encoder model detects the person name but misses the location. The rule based hybrid detects the person, SSN, and date of birth but also misses the location. The LLM detects most entities but absorbs the city into a single ADDRESS span rather than extracting it separately. Each architecture fails for a different internal reason yet PII remains exposed in the output.

A natural question is why evaluate encoder and rule based models when LLMs increasingly dominate NLP tasks. Our results provide a clear answer: no single architecture is universally superior for PII detection. The LLM achieves the best overall F1 but shows lower PERSON recall than SpaCy (0.777 vs 0.951), worse CREDIT_CARD detection than Presidio (0.543 vs 0.700), produces unparseable outputs on 2.5% of OOD inputs, and is orders of magnitude slower and more expensive to run at scale. Meanwhile, Presidio's regex patterns achieve perfect SSN and IP detection that the LLM cannot match, and SpaCy provides

¹ Presidio: Data Protection and De-identification. Available at: https://microsoft.github.io/presidio/. Accessed: July 2026.

reliable, fast person name detection. Understanding these tradeoffs is essential for building production PII systems that balance accuracy, latency, cost, and reliability.

In this paper, we make three contributions: (1) we characterize architecture-specific failure modes in PII detection under realistic distribution shifts, showing that encoder, rule-based, and LLM systems fail in distinct and complementary ways; (2) we construct a stress test benchmark² spanning seven categories of natural distribution shift; and (3) we argue for OOD-aware evaluation and hybrid detection pipelines that combine complementary architectural strengths.

References (16)