Generating Diverse and Verified Synthetic Clinical Notes with Labels by Construction
Organizations: Strategic Innovations and Futuretechnologies, University Hospital Cologne
Abstract
Under strict privacy regulations in the clinical domain, de-identification is necessary to enable the use of clinical data such as for natural language processing. However, we currently lack sophisticated ways to tell which de-identification models actually are suitable. Specifically, we need benchmarks that are challenging, diverse, and clinically plausible, all while ensuring label correctness. To this end, we present SPARCLING, an LLM-based pipeline to generate synthetic discharge letters with character-exact PHI span annotations. Our pipeline combines structured attribute sampling, template generation, and red teaming to obtain diverse PHI-labeled discharge letters. In our experiments, we demonstrate this superior content diversity over existing public datasets. Further, we show SPARCLING's downstream utility as a benchmark to uncover failure modes of de-identifiers in the German clinical domain. Finally, our experiments show that training on our synthetic data can yield more capable de-identifiers than training on the scarce public data alone. Our code is available at https://github.com/Matt00n/phi_discharge_letter_generator.
Figures & tables
| German | English | |||||
|---|---|---|---|---|---|---|
| Sparcling | Sparcling 63 | GraSCCo | GERNERMED | i2b2 | MIMIC-IV | |
| # documents | 1,019 | 63 | 63 | 1,000 | 1,000 | 1,000 |
| Doc-length std | 4,519 | 3,419 | 2,619 | 74 | 605 | 4,265 |
| Self-BLEU ( ) | 0.014 | 0.012 | 0.013 | 0.021 | 0.013 | 0.060 |
| MTLD | 310.0 | 317.1 | 248.5 | 38.6 | 182.8 | 100.8 |
| Trigram novelty | 0.63 | 0.87 | 0.80 | 0.65 | 0.74 | 0.45 |
| SPARCLING-DE | GraSCCo | MIMIC-IV | |
| SMOG | 16.65 | 13.69 | 12.19 |
| FKGL | 20.75 | 14.84 | 9.50 |
| Mean characters per doc | 7,163 | 3,947 | 10,602 |
| Spans per 1k word tokens | 41.4 | 43.2 | — |
| LLM judged structure | 3.37 | 4.10 | 4.91 |
| LLM judged clinical realism | 2.31 | 3.90 | 4.89 |
| Gemini | Gemma | Presidio+Flair | Presidio+spaCy | OpenMed | Rule-based | |
|---|---|---|---|---|---|---|
| Precision | 0.940 | 0.759 | 0.864 | 0.315 | 0.233 | 0.885 |
| Recall | 0.949 | 0.305 | 0.766 | 0.691 | 0.537 | 0.695 |
| F1 | 0.944 | 0.435 | 0.812 | 0.433 | 0.325 | 0.778 |
| Training regime | P | R | F1 |
|---|---|---|---|
| Synthetic only | 0.942 0.015 | 0.834 0.032 | 0.884 0.018 |
| Public only | 0.957 0.011 | 0.955 0.022 | 0.956 0.014 |
| Synthetic Public | 0.952 0.013 | 0.975 0.013 | 0.963 0.012 |
Appendix figures & tables29 assets
Supplementary material from the paper’s appendix.
Appendix
| Attribute | Distribution / mechanism | Constraints | Example |
|---|---|---|---|
| Style | Weighted choice over 3 styles | one per document | Standard-Klinik |
| Difficulty | Categorical, weights | steers most ranges below | hard |
| Length | Categorical per difficulty | harder longer | ausführlich |
| PII density | , shape by (style, length) | ; academic+long skews high | |
| Structure mode | Categorical per difficulty | harder less structured | structured |
| Optional-field gate | gates every optional atom | include email? |
| Attribute | Distribution / mechanism | Constraints | Example |
|---|---|---|---|
| Specialty | Gender-weighted, age-gated choice | e.g. Geriatrie 65 | Kardiologie |
| Primary / secondary Dx | From specialty ICD pool | sex/age-compatible | I21.4 NSTEMI |
| Procedures (OPS) | Sampled per case complexity | consistent with Dx | 1-275.0 Koronarangiographie |
| Discharge meds | Regimen pool | suppressed if has_meds ( ) | Bisoprolol 5 mg 1-0-0 |
| Patient name | sample_name over origin-weighted pools | adversarial modes override | Lara Dina Schukow |
| Cross-origin / doubling | Bernoulli per difficulty | 0 on easy; hard | Dimitra Magdalini Zogas |
| Attribute | Distribution / mechanism | Constraints | Example |
|---|---|---|---|
| Street / house no. | pool , suffix | — | Judengasse 131 |
| ZIP / city | consistent city area-code pair | hard: tricky town | 04317 Leipzig |
| Address included | — | — | |
| Phone / fax | area-code-consistent | always present | 0341 9542205 |
| Mobile | — | 0157 7622301 | |
| , derived from name | — | [email protected] |
| Family | Label | Meaning (DE) | Example |
| Names | PATIENT_NAME | Patient | Cem Çam |
| RELATIVE_NAME | Angehörige/r | Ortrud Meister | |
| STAFF_NAME | Klinikpersonal | Dr. med. Weber | |
| OTHER_PERSON_NAME | sonstige Person | Christian Unger-Medwedew | |
| Dates | DATE_BIRTH | Geburtsdatum | 03.11.1960 |
| DATE_ADMISSION | Aufnahmedatum | 06.06.2023 |
| Family | Label | Meaning (DE) | Example |
|---|---|---|---|
| Tier 3 — NON-PII negatives (3 labels) | |||
| Decoys | EPONYM | personenbezogener Fachbegriff | Hashimoto-Thyreoiditis |
| LOOKALIKE | namensähnlicher Fachbegriff | Swan-Ganz-Katheter | |
| NONPII_ID | ID-ähnliche Nicht-PII-Nummer | PZN 70669074 | |
| Skeleton placeholder / text | Rendered surface | Label |
|---|---|---|
| [[patient form=hon_first_last case=nom]] | Herr Cem Çam | PATIENT_NAME |
| [[patient form=hon_last case=akk]] | Herrn Çam | PATIENT_NAME |
| [[arzt_einweiser form=salutation case=nom]] | Sehr geehrter Herr Weber | STAFF_NAME |
| [[konsiliararzt form=initial_last case=gen]] | M. Fehlings | STAFF_NAME |
| [[geburtsdatum variant=textual]] | 11. März 1962 | DATE_BIRTH |
| [[geburtsdatum variant=iso]] | 1962-03-11 | DATE_BIRTH |
| Stage | Parameter | Value |
| Run | LLM model | gemini-3.7-flash |
| base seed | 1000 ( ) | |
| parallel workers | 8 | |
| auto (drop flagged) | on | |
| sampling temperature | client default | |
| Generation | skeleton min. sent. len. | 15 |
| Parameter | easy | med. | hard | adv. |
|---|---|---|---|---|
| Global mix (difficulty ) | ||||
| length (kurz) | .30 | .20 | .10 | .05 |
| length (mittel) | .45 | .35 | .25 | .15 |
| length (ausf.) | .20 | .30 | .35 | .35 |
| length (sehr_lang) | .05 | .15 | .30 | .45 |
| struct. (structured) | .90 | .70 | .45 | .30 |
| Parameter | Value / distribution |
| Dates (anchor 2026-09-03) | |
| birth month / day | U[1,12] / U[1,28] |
| years-back values | {0..6,8,10,12,15} |
| years-back weights | 30,12,8,8,6,6,5,5,5,4,4 |
| admission offset (days) | U[5,365] |
| stay type (amb/ac/long) | .08/.78/.14 |
| Parameter | Value |
| Base field-inclusion prob. (pre-density) | |
| adresse / adresse_klinik | 0.85 / 0.85 |
| kvnr / fallnr / patid | 0.75 / 0.80 / 0.65 |
| lanr / bsnr / ik_nr | 0.40 / 0.30 / 0.20 |
| mobil / email | 0.35 / 0.30 |
| versicherer / klinik_url | 0.70 / 0.50 |
| Sparcling | Sparcling 63 | GraSCCo | GERNERMED | i2b2 | MIMIC | |
| Documents | 1,019 | 63 | 63 | 1,000 | 1,000 | 1,000 |
| Total tokens § | 837,713 | 42,673 | 33,303 | 14,992 | 153,394 | 1,601,988 |
| Mean doc length (chars) | 7,163 | 5,888 | 3,947 | 102 | 887 | 10,602 |
| Doc-length std (chars) | 4,519 | 3,419 | 2,619 | 74 | 605 | 4,265 |
| MTLD | 310.0 | 317.1 | 248.5 | 38.6 | 182.8 | 100.8 |
| TTR per doc | 0.663 | 0.688 | 0.680 | 0.949 | 0.797 | 0.438 |
| LLM judge dimension | SPARCLING-DE | GraSCCo | MIMIC-IV |
|---|---|---|---|
| Structure | 3.37 | 4.10 | 4.91 |
| Clinical realism | 2.31 | 3.90 | 4.89 |
| Internal consistency | 2.73 | 3.56 | 4.61 |
| Temporal consistency | 3.42 | 3.86 | 4.98 |
| Care trajectory coherence | 2.51 | 3.81 | 4.94 |
| Discharge plan completeness | 2.50 | 3.41 | 4.25 |
| LLM judge dimension | Easy | Medium | Hard | Adversarial |
|---|---|---|---|---|
| Structure | 3.45 | 3.33 | 3.42 | 3.08 |
| Clinical realism | 2.47 | 2.34 | 2.18 | 2.10 |
| Internal consistency | 2.96 | 2.77 | 2.56 | 2.40 |
| Temporal consistency | 3.67 | 3.42 | 3.28 | 3.07 |
| Care trajectory coherence | 2.60 | 2.52 | 2.47 | 2.32 |
| Discharge plan completeness | 2.41 | 2.47 | 2.67 | 2.38 |
| Corpus pair | Fréchet | MMD | Unigram-JS | Vocab. Jaccard |
|---|---|---|---|---|
| SPARCLING-DE GraSCCo | 0.394 | 0.240 | 0.351 | 0.074 |
| SPARCLING-DE GraSCCo | 0.438 | 0.235 | 0.382 | 0.166 |
| GraSCCo GERNERMED | 0.871 | 0.431 | 0.551 | 0.098 |
| i2b2 MIMIC-IV | 0.579 | 0.441 | 0.357 | 0.166 |
| SPARCLING-DE GERNERMED | 0.822 | 0.497 | 0.577 | 0.025 |
| SPARCLING-DE SPARCLING-DE | 0.264 | 0.095 | 0.151 | 0.161 |
| Gemini | Gemma | Flair | Presidio | OpenMed | Rule-based | |
|---|---|---|---|---|---|---|
| PATIENT_NAME | 0.981 | 0.406 | 0.969 | 0.904 | 0.608 | 0.634 |
| STAFF_NAME | 0.973 | 0.329 | 0.919 | 0.691 | 0.424 | 0.645 |
| RELATIVE_NAME | 0.985 | 0.365 | 0.976 | 0.866 | 0.670 | 0.644 |
| DATE_BIRTH | 1.000 | 0.498 | 0.998 | 0.993 | 0.622 | 1.000 |
| AGE | 0.937 | 0.097 | 0.000 | 0.005 | 0.042 | 0.966 |
| ZIP | 0.824 | 0.018 | 0.000 | 0.004 | 0.812 | 0.000 |
| Over-anonymization rate | Eponym destruction rate | |
|---|---|---|
| Gemini 3.7 Flash | 0.029 | 0.000 |
| Gemma | 0.033 | 0.010 |
| Flair (in Presidio) | 0.017 | 0.016 |
| Presidio (spaCy) | 0.414 | 0.396 |
| OpenMed | 0.583 | 0.619 |
| Rule-based | 0.055 | 0.033 |
| Method | Eponym corr. | Look-alike red. | Faithfulness | Boundary IoU |
|---|---|---|---|---|
| Gemini | 0 | 1.5% | 0.9994 | 0.988 |
| Flair | 33 | 0.4% | 0.9980 | 0.965 |
| Rule-based | 66 | 10.8% | 0.9950 | 0.973 |
| Presidio | 803 | 41.0% | 0.9080 | 0.964 |
| OpenMed | 1,255 | 46.0% | 0.9740 | 0.849 |
| Gemini | Gemma | Flair | Presidio | OpenMed | Rule-based | |
|---|---|---|---|---|---|---|
| Easy | 0.946 | 0.494 | 0.842 | 0.483 | 0.357 | 0.846 |
| Medium | 0.949 | 0.448 | 0.804 | 0.451 | 0.332 | 0.773 |
| Hard | 0.940 | 0.433 | 0.803 | 0.418 | 0.309 | 0.751 |
| Adversarial | 0.941 | 0.277 | 0.793 | 0.352 | 0.289 | 0.714 |
| Evaluation set | Span F1 | Token F1 | Char. F1 | Char. recall | Over-redaction |
|---|---|---|---|---|---|
| GraSCCo | 0.0031 | ||||
| Synth. hold-out | 0.0004 |
| Training regime | Span F1 | Token F1 | Char. F1 | Char. recall | Over-redaction |
|---|---|---|---|---|---|
| Real only | 0.0026 | ||||
| Synthetic only | 0.0032 | ||||
| Synthetic Real | 0.0031 |
| Metric | With adv. | Without adv. | ||
| Span | Precision | 0.864 | 0.824 | |
| Recall | 0.682 | 0.681 | ||
| F1 | 0.762 | 0.746 | ||
| Character | Precision | 0.941 | 0.928 | |
| Recall | 0.836 | 0.838 | ||
| F1 | 0.886 | 0.881 |