This is the token-classification model inside SurrogateShield, a privacy proxy for LLMs. SurrogateShield finds the personal values in a message, replaces each one with a realistic surrogate before the message reaches the model, and puts the real values back in the answer. This model is the stage that finds the values. It does not decide whether a value belongs to the writer or what to do with it. SurrogateShield's relation gate and resolver make those decisions.
microsoft/deberta-v3-small at revision a36c739020e01763fe789b4b85e2df55d6180012 (MIT)model.safetensors, SHA-256 f9e5821151ac59ad6871bf53ffc91ab370a6f8704659a2d3007adf67a920a173BIO tags (33 labels) over 16 tags:
| Tag | What it marks |
|---|---|
PERSON |
People's names |
ORG |
Organisations |
STREET, CITY, REGION, POSTCODE |
Parts of a postal address |
LOCATION |
Places |
AGE |
Ages |
DATE_OF_BIRTH |
Dates of birth |
EMAIL |
E-mail addresses |
PHONE |
Phone numbers |
HANDLE |
User names and social handles |
URL |
Personal links |
NETWORK |
IP and MAC addresses |
ID |
ID, account and document numbers |
CREDENTIAL |
Passwords, PINs, API keys and tokens |
SurrogateShield joins adjacent address parts back into one ADDRESS. A lone city becomes a LOCATION, and a lone region is dropped.
from transformers import pipeline
tagger = pipeline(
"token-classification",
model="sherwinvishesh/surrogateshield-pii-tagger",
aggregation_strategy="simple",
)
tagger("Hi, I'm Priya Raman. Email me at [email protected] or call +1 415 555 0142.")
SurrogateShield 1.9.0 and later downloads this model by itself. The default balanced preset names it pii-tagger-dv3s-40k, fetches it from this repo once, at commit c51cc8e09bd6410503c2e004f44af2b206a1670e, into the Hugging Face cache, and checks the SHA-256 of model.safetensors against the pin above before loading. Later runs read the cache with no network. To fetch it ahead of time:
pip install ./python-library # from a SurrogateShield checkout
surrogateshield download
A folder named pii-tagger-dv3s-40k under $SURROGATESHIELD_MODELS (default ~/.cache/surrogateshield/models) is used instead when there is one, and is checked against the same pin. With HF_HUB_OFFLINE=1 and no cached copy, SurrogateShield raises DetectorUnavailable and masks nothing rather than run without the tagger.
SurrogateShield reads text in windows of 256 tokens with a stride of 64. A candidate's score is the mean probability of its type over its tokens. The default balanced preset keeps a value at these scores:
| Type | Lowest kept score |
|---|---|
| PERSON, ORG, LOCATION | 0.70 |
| ADDRESS | 0.90 |
| PHONE, ID, HANDLE | 0.95 |
| CREDENTIAL | 0.97 |
At SurrogateShield's relation gate, places and organisations the model scores 0.97 or more count as tied to the writer.
| Setting | Value |
|---|---|
| Training data | 40,000 generated messages, one window each |
| Validation data | 2,000 generated messages |
| Epochs | 3 (7,500 steps) |
| Learning rate | 5e-5, warm-up 0.06, weight decay 0.01 |
| Batch size | 16 |
| Max length, stride | 256, 64 |
| Seed | 1 |
| Hardware | Apple silicon (MPS), 84 minutes |
| Libraries | torch 2.12.0, transformers 5.8.1 |
It was chosen over deberta-v3-xsmall and ModernBERT-base by a selection rule fixed before the comparison was run. On the generated validation set its micro F1 is 0.9988. That set comes from the same generator as the training data, so it says nothing about real text. train_meta.json holds the full training record.
The numbers below are for SurrogateShield with this model in its default configuration at the test-3 freeze (detection config a1abaa92142b0db9), on a sealed set of real chat prompts (ShareGPT, WildChat and oasst1) with 3,677 personal values placed in them:
| Tool | Personal values that reached the provider |
|---|---|
| SurrogateShield | 0.8% |
| GLiNER-PII | 9.1% |
| Microsoft Presidio | 31.6% |
SurrogateShield also left 88.5% of 2,433 messages with nothing to protect untouched (Presidio 59.6%, GLiNER-PII at 0.5 28.9%). Every result, with the command that produced it, is listed in bench/results/README.md.
Later detection changes on the v2 branch (config 19baf5415a894c80) leave this model and its thresholds as they are, and have not been measured on a sealed set yet.
Limitations: it trailed on the 96 real values in natural text (29 leaked; GLiNER-PII 16–20, Presidio 27), on some single types (3 of 13 on test-3, 8 of 13 on Nemotron-PII, URL most of all) and on speed and memory (plain Presidio is about 5× faster and lighter); it came out ahead on every other test.