EdgeDeID: A 0.6B Clinical De-identifier Trained Without Real Patient Data
Organizations: Sharif University of Technology · Department of Radiology, Mayo Clinic · Department of Radiology and Biomedical Imaging, Yale University
Abstract
De-identifying clinical notes with a hosted language model discloses the information the step is meant to protect. We present EdgeDeID, a 0.6B-parameter decoder-only de-identifier that runs locally and is trained without real patient text: three LLM teachers write synthetic notes, a single labeler re-annotates them into one convention, and the model learns to emit a typed XML schema of the identifiers it finds. On a 100-note synthetic in-domain benchmark with manually verified annotations it reaches 0.994 micro-F1 and leaves no missed identifier in 99% of notes, against 0.857 and 12% for the strongest of eight off-the-shelf systems. Quantized, it runs on CPU in 615 MB. Of three additions to supervised training, only a verifier adapter helps: it separates complete from incomplete outputs of other systems at 0.94 AUROC, whereas reinforcement learning with a recall-weighted reward and a rule-based post-processing layer leave in-domain results unchanged. On MIMIC ICU nursing notes F1 falls to 0.48. The errors follow two properties our synthetic notes lack, telegraphic style and low identifier density, and three hand-written in-context examples recover 0.08 F1 without annotated target data.
Figures & tables
| Self-assess. tag | QC layer | Verifier | |
|---|---|---|---|
| Judge | the extractor | rules and spaCy NER | LoRA adapter |
| When | same pass | after generation | second pass |
| Training | GRPO reward | none | SFT, then GRPO |
| Result | verdict | edited annotation | , review |
| Other systems | no | yes | yes |
| System | Params (M) | P | R | F1 | F 2 | Macro-F1 | Zero-leak | Parse |
|---|---|---|---|---|---|---|---|---|
| OPF | 1,500 † | 0.983 | 0.760 | 0.857 | 0.796 | 0.852 | 0.12 | 1.00 |
| GLiNER | 195.2 | 0.916 | 0.681 | 0.782 | 0.718 | 0.617 | 0.05 | 0.99 |
| Presidio | – | 0.764 | 0.569 | 0.652 | 0.600 | 0.545 | 0.05 | 1.00 |
| Stanford-deid | 108.9 | 0.646 | 0.554 | 0.597 | 0.570 | 0.366 | 0.02 | 1.00 |
| spaCy | – | 0.764 | 0.459 | 0.573 | 0.499 | 0.514 | 0.02 | 0.99 |
| OpenMed-PII | 434.1 | 0.672 | 0.345 | 0.456 | 0.382 | 0.390 | 0.00 | 1.00 |
| Verifier | Synth. val | Benchmark | MIMIC |
|---|---|---|---|
| Zero-shot (no adapter) | 0.537 | 0.600 | 0.658 |
| SFT adapter | 0.813 | 0.987 | 0.661 |
| SFT + GRPO adapter | 0.809 | 0.989 | 0.661 |
| System | P | R | F1 | SH-R | Leak |
|---|---|---|---|---|---|
| RoBERTa-i2b2 | 0.597 | 0.777 | 0.675 | 0.854 | 87 |
| Stanford-deid | 0.445 | 0.654 | 0.529 | 0.362 | 281 |
| BERT-i2b2 | 0.616 | 0.458 | 0.525 | 0.266 | 314 |
| GLiNER | 0.387 | 0.614 | 0.475 | 0.599 | 201 |
| OPF | 0.539 | 0.331 | 0.410 | 0.298 | 314 |
| OpenMed-PII | 0.246 | 0.564 | 0.342 | 0.756 | 138 |
| System | GPU | CPU | RSS |
|---|---|---|---|
| Stanford-deid | 8 | 124 | 1,222 |
| BERT-i2b2 | 9 | 119 | 1,233 |
| RoBERTa-i2b2 | 14 | 335 | 2,118 |
| GLiNER | 18 | 192 | 2,418 |
| OpenMed-PII | 26 | 476 | 2,285 |
| OPF | 24 | 12,413 | 4,778 |
Appendix figures & tables15 assets
Supplementary material from the paper’s appendix.
Appendix
| Hyperparameter | Value |
|---|---|
| Base model | Qwen3-0.6B-Base (labeler: Qwen3-1.7B-Base) |
| Precision | bfloat16 |
| Epochs | 1 |
| Per-device batch size | 2 |
| Gradient accumulation | 8 |
| Optimizer | AdamW |
| Hyperparameter | Value |
|---|---|
| Initialization | SFT checkpoint, full fine-tuning (no LoRA) |
| Precision | bfloat16 |
| Learning rate | |
| Prompts per step | 1 |
| Completions per prompt ( ) | 8 |
| Per-device batch size | 1 |
| Hyperparameter | Value |
|---|---|
| Base | EdgeDeID SFT checkpoint (frozen) |
| Adapter | LoRA, rank 16, 32, dropout 0.05 |
| Training data | synthetic training notes; corrupted gold annotations and outputs of BERT-i2b2, GLiNER, Presidio, and RoBERTa-i2b2 |
| SFT stage | candidates, 1 epoch, lr , batch |
| SFT label balance | 26% incomplete |
| GRPO stage | candidates, 300 steps, lr , , gradient accumulation 4, temperature 1.0, no KL term |
| Claimed | Actual | |
|---|---|---|
| complete | complete | 1.0 |
| incomplete | incomplete | 1.0 |
| incomplete | complete | 0.5 |
| complete | incomplete | 0.0 |
| (tag missing) | any | 0.0 |
| Benchmark | MIMIC | |||||
|---|---|---|---|---|---|---|
| Step | P | R | F1 | P | R | F1 |
| None | 0.990 | 0.999 | 0.994 | 0.407 | 0.580 | 0.478 |
| + Repair | 0.990 | 0.999 | 0.994 | 0.278 | 0.617 | 0.383 |
| + Patterns | 0.989 | 0.999 | 0.994 | 0.280 | 0.626 | 0.387 |
| + NER fallback | 0.989 | 0.999 | 0.994 | 0.280 | 0.626 | 0.387 |
| Test set | Comparison ( ) | Recall | Precision | F1 | Zero-leak |
|---|---|---|---|---|---|
| Bench. | GRPO SFT | ||||
| [ , ] | [ , ] | [ , ] | [ , ] | ||
| Bench. | QC none, on GRPO | ||||
| [ , ] | [ , ] | [ , ] | [ , ] | ||
| MIMIC | GRPO SFT | ||||
| [ , ] | [ , ] | [ , ] | [ , ] |
| Category | Presidio | GLiNER | RoBERTa | BERT | OpenMed | Stanford | spaCy | OPF | Base | EdgeDeID |
|---|---|---|---|---|---|---|---|---|---|---|
| -i2b2 | -i2b2 | -PII | -deid | 0-shot | SFT | |||||
| Name | 0.990 | 0.842 | 0.647 | 0.616 | 0.646 | 0.983 | 0.982 | 0.986 | 0.352 | 0.996 |
| Age | – | 0.756 | 0.987 | 0.987 | 0.987 | – | – | – | 0.280 | 0.987 |
| Date | 0.452 | 0.973 | 0.039 | 0.024 | 0.004 | 0.990 | 0.446 | 0.986 | 0.110 | 0.998 |
| Place | – | 0.868 | 0.000 | 0.000 | 0.000 | 0.221 | 0.629 | – | 0.000 | 0.972 |
| Address | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | – | 0.000 | 0.938 | 0.128 | 1.000 |
| Category | RoBERTa | Stanford | BERT | GLiNER | OPF | OpenMed | Presidio | spaCy | Base | EdgeDeID | EdgeDeID |
|---|---|---|---|---|---|---|---|---|---|---|---|
| -i2b2 | -deid | -i2b2 | -PII | 0-shot | SFT | GRPO | |||||
| Name | 0.854 | 0.768 | 0.741 | 0.597 | 0.574 | 0.638 | 0.226 | 0.231 | 0.019 | 0.541 | 0.598 |
| Date | 0.745 | 0.090 | 0.172 | 0.547 | 0.205 | 0.269 | 0.066 | 0.058 | 0.030 | 0.509 | 0.589 |
| Place | 0.481 | 0.710 | 0.396 | 0.370 | 0.000 | 0.008 | 0.000 | 0.015 | 0.000 | 0.456 | 0.422 |
| Phone | 0.561 | 0.389 | 0.541 | 0.302 | 0.468 | 0.604 | 0.349 | 0.000 | 0.000 | 0.175 | 0.267 |
| Age | 0.000 | 0.000 | 0.036 | 0.032 | 0.000 | 0.047 | 0.000 | 0.000 | 0.000 | 0.048 | 0.045 |
| System | Tool ref. | Human gold | Untyped |
|---|---|---|---|
| RoBERTa-i2b2 | 0.571 | 0.675 | 0.708 |
| Stanford-deid | 0.435 | 0.529 | 0.535 |
| BERT-i2b2 | 0.398 | 0.525 | 0.560 |
| Ours, GRPO | 0.442 | 0.523 | 0.542 |
| Ours, SFT | 0.423 | 0.478 | 0.500 |
| GLiNER | 0.410 | 0.475 | 0.486 |
| Class of gold span | Spans | Missed | |
|---|---|---|---|
| Ours | RoB. | ||
| Safe Harbor PHI ( ) | |||
| date (month/day) | 482 | 113 | 57 |
| patient or relative name | 231 | 87 | 40 |
| city, town, region, street | 56 | 49 | 3 |
| patient or family phone | 42 | 18 | 11 |
| Measurement | Value |
|---|---|
| Whole-note failures | |
| Misses in notes with empty or unparseable output | 155 / 200 |
| output parseable but empty | 103 |
| output unparseable | 52 |
| Benchmark notes with such output | 0 / 100 |
| Miss rate in notes with normal output | 8.1% |
| Profile | P | R | F1 | Zero-leak |
|---|---|---|---|---|
| Clean | 0.992 | 0.996 | 0.994 | 0.96 |
| Surface | 0.992 | 0.996 | 0.994 | 0.96 |
| Register | 0.986 | 0.983 | 0.985 | 0.85 |
| Both | 0.984 | 0.955 | 0.969 | 0.75 |
| Test set | Verifier | Base rate | AUROC | ECE | Flagged | Caught | Flag precision | Residual |
|---|---|---|---|---|---|---|---|---|
| Synthetic val ( ) | zero-shot | 0.301 | 0.537 | 0.024 | 0.105 | 0.154 | 0.441 | 0.285 |
| SFT | 0.813 | 0.013 | 0.204 | 0.556 | 0.822 | 0.168 | ||
| SFT + GRPO | 0.809 | 0.134 | 0.163 | 0.506 | 0.939 | 0.178 | ||
| Benchmark ( ) | zero-shot | 0.795 | 0.600 | 0.531 | 0.160 | 0.199 | 0.989 | 0.758 |
| SFT | 0.987 | 0.139 | 0.746 | 0.931 | 0.991 | 0.215 | ||
| SFT + GRPO | 0.989 | 0.213 | 0.574 | 0.722 | 1.000 | 0.518 |
| System | Device | Runtime | Precision | Median ms | p90 ms | Peak RSS (MB) |
| spaCy | CPU | spaCy | fp32 | 35 | 47 | 1,319 |
| Presidio | CPU | spaCy/regex | fp32 | 51 | 70 | 1,536 |
| BERT-i2b2 | CPU | transformers | fp32 | 119 | 187 | 1,233 |
| Stanford-deid | CPU | transformers | fp32 | 124 | 166 | 1,222 |
| GLiNER | CPU | transformers | fp32 | 192 | 294 | 2,418 |
| RoBERTa-i2b2 | CPU | transformers | fp32 | 335 | 466 | 2,118 |
| System | Checkpoint or configuration |
|---|---|
| Presidio | Microsoft Presidio analyzer, default recognizers |
| spaCy | en_core_web_lg NER |
| GLiNER | urchade/gliner_mediumv2.1 , prompted with our type names |
| Stanford-deid | StanfordAIMI/stanford-deidentifier-base |
| RoBERTa-i2b2 | obi/deid_roberta_i2b2 |
| BERT-i2b2 | obi/deid_bert_i2b2 |
Privacy-Preserving Language Models
Privacy-preserving language models protect sensitive data during training, inference, personalization, and information sharing.
See all 178 papers