NerGuard-0.3B is a multilingual transformer model for Personally Identifiable Information (PII) detection, built on
mDeBERTa-v3-base. It performs token-level classification across
20 PII entity types using BIO tagging, covering names, addresses, government IDs, financial data, and contact information across
8 European languages.
Trained on 500K+ samples from
AI4Privacy, it achieves
F1-macro 99.63% on in-distribution validation. On the out-of-distribution NVIDIA Nemotron-PII benchmark (1,000 samples, 7-system comparison), the base model ranks
4th out of 7 systems on F1-macro and
3rd on Entity-F1 — without any LLM augmentation. For the full hybrid system with entropy-based LLM routing (which ranks
1st on both F1-macro and F1-micro), see the
NerGuard GitHub repository.
Tier 2 evaluation: semantic alignment over 16 comparable entity types. Seven systems compared.
The base model (no LLM) achieves 33 ms median latency. The entropy-gated hybrid adds +8.94 pt F1-macro by routing only uncertain spans (~3% of tokens) to an LLM for disambiguation.
1from transformers import pipeline
2
3ner = pipeline(
4 "token-classification",
5 model="exdsgift/NerGuard-0.3B",
6 aggregation_strategy="simple"
7)
8
9results = ner("My name is John Smith and my email is john@acme.com")
10for entity in results:
11 print(f"{entity['word']} -> {entity['entity_group']} ({entity['score']:.2%})")
12# John -> GIVENNAME (99.82%)
13# Smith -> SURNAME (99.71%)
14# john@acme.com -> EMAIL (99.54%)
1from src.inference.tester import PIITester
2
3tester = PIITester(model_path="exdsgift/NerGuard-0.3B")
4entities = tester.get_entities("John Smith, SSN: 078-05-1120, email: john@acme.com")
1@mastersthesis{durante2026nerguard,
2 title = {Engineering a Scalable Multilingual PII Detection System
3 with mDeBERTa-v3 and LLM-Based Validation},
4 author = {Durante, Gabriele},
5 year = {2026},
6 school = {University of Verona},
7 department = {Department of Computer Science}
8}