Home

/

Keep PII Out of Your LLM

/

The Accuracy Reckoning

The Accuracy Reckoning

Chapter 4
Part II
3
min read

The claim, and the measurement

Commercial PII detection is sold on accuracy. F1 scores of 0.92 to 0.99 appear routinely in vendor material, from established names. Those numbers are not fabricated. They are measured, on a dataset, and the dataset is the entire story.

In June 2026, an independent benchmark tested five detection approaches across four datasets in two languages, using six entity types that all of the systems claim to support: person name, email, phone, location, credit card, and IBAN. The datasets spanned mixed synthetic text, synthetic financial documents, a corpus covering fifty-plus industries, and real Dutch newspaper text with human annotations.

Here is what came out.

DetectorAI4PrivacyGretel FinanceNemotron-PIICoNLL-2002Average F1
Piiranha (86M DeBERTa-v3)0.7800.1690.6990.5190.542
GLiNER v1 (209M)0.4550.6070.4840.5950.535
Presidio0.3590.2980.4870.7800.481
GLiNER v2 (205M)0.4690.3730.5100.5580.478
Regex only0.2070.1790.2970.0000.171

The best average across domains is 0.542.

Read along a row rather than down the column, because the row is where the argument lives. Piiranha scores 0.780 on AI4Privacy and 0.169 on synthetic financial text. Same model, same entity types, same week. A 78% collapse.

Why this happens

There is nothing dishonest in either number. They measure different things, and only one of them predicts what will happen to you.

AI4Privacy is Piiranha's training distribution. The benchmark scored it on the validation split, which is standard practice and produces the number you would put in a model card. The Gretel financial set is text the model had not seen: different sentence structures, different entity densities, different ways of writing a name next to an account number.

Detectors are evaluated in-distribution and deployed out-of-distribution. Your support tickets are not AI4Privacy. Your CVs are not AI4Privacy. Your case notes, full of internal product names and a company-specific reference format, are nothing like AI4Privacy. The published score was measured on data that resembles the training data, and your data does not.

This book calls that difference the demo gap. Every detector has one. The only question is whether you have measured yours.

The pattern repeats in the same benchmark. Piiranha degrades 78% out of distribution. GLiNER v2 degrades 20%. Presidio degrades 17%. GLiNER v1 degrades 0%, which reads well until you notice it achieves consistency by being mediocre everywhere rather than good anywhere.

A second, larger study reaches the same place from a different direction. PIIBench covers 82 entity types across ten source datasets. A straightforwardly fine-tuned DeBERTa model scored F1 0.6476. More elaborate approaches did worse: a source-conditioned hierarchical model managed 0.5899, and a curriculum-learning variant 0.2772. The strongest previously published comparator on that benchmark scored 0.1723 (Jha, arXiv 2605.25816, 2026).

Note the precise claim there. That is the best published comparator on PIIBench, not a statement that the best detector in the world scores 0.17. The point is what happens when you evaluate broad coverage across genuinely varied sources rather than one curated set. The conclusion of the paper is worth carrying: diverse task-specific training data and a simple loss function beat architectural sophistication. Nobody is one clever model away from solving this.

the-leak-you-cant-see
blast-radius
what-counts-as-pii
the-five-doors
the-accuracy-reckoning
the-hybrid-that-does-not-work
deterministic-detection
npi-in-c
the-three-way-choice
calling-the-analyzer-from-c
measuring-your-own-demo-gap
choosing-the-operating-point
the-ladder-of-safeguards
pseudonymisation
the-round-trip
restoring-safely
when-masking-breaks-the-task
plausibility-hazard
the-architecture-that-holds
the-reference-architecture
dont-send-it-at-all
structure-beats-prose
the-gateway
failure-is-a-policy-decision
the-sidecar-you-can-trust
egress-deny-it-at-the-network
rag-and-agents
de-identify-before-you-embed
dual-model-separation
the-boring-controls
evidence-and-the-first-thirty-days
week-two-the-chokepoint-and-the-fast-layer
entity-catalogue-and-c-validators
mbi-positional-rules
tooling-at-a-glance
azure-ai-language-pii-in-detail
container-trust-checklist
sources
azure-ai-language
provider-retention

Download the full PDF for free?

Free download — no account required

Get the PDF
Get the PDF
Related Chapters
Free Download
Get the full PDF
All pages, including all code examples, diagrams, and the appendix reference card.
No spam. Unsubscribe at any time.
Your email won't be shared.
Oops! There's a problem with your request. We're working on fixing it. Please try again later.