Skip to content

SPARCLING: Generating Diverse and Verified Synthetic Clinical Notes with Labels Correct by ConstructionGenerating Diverse and Verified Synthetic Clinical Notes with Labels by Construction

arXiv: Jailbreaks, Prompt Injection, Poisoning & Defenses· arXiv:2611.10789· Matthias Lehmann, Madeleine WerthebachStrategic Innovations and Futuretechnologies; University Hospital CologneIndexed by this site · 13 days ago· Originally publishedEvaluation

Quick read

Evaluation and benchmarks

Based on the paper PDF (AI-generated); refer to the original

The authors propose the SPARCLING pipeline to generate German synthetic discharge letters with character-level precise PHI annotations; on the resulting SPARCLING-DE benchmark, the highest F1 among six de-identification methods is only 0.944.

Questions
Clinical privacy regulations require reliable de-identification models, but benchmarks that are simultaneously challenging, diverse, and correctly annotated are lacking; the German clinical domain is more affected because of stricter regulation and scarce public annotated data.
Methods
The SPARCLING pipeline first hierarchically samples structured patient and document attributes independently of the LLM; the LLM writes templates with typed placeholders based only on masked profiles; then PHI values are deterministically backfilled and character offsets recorded; finally, deterministic checks and a red-team LLM double-check for leaks.
Experiments and results
SPARCLING-DE contains 1,019 German discharge letters and 34,712 PHI annotations. The authors report that several of its lexical diversity metrics outperform public corpora; among six de-identification methods, Gemini 3.7 Flash has the highest F1 at 0.944; synthetic-data pretraining plus public-data fine-tuning raises char-recall on GraSCCo from 0.955 to 0.975.
Limitations and future work
The authors note that validation was performed only in the domain of German discharge letters, and that the generated text lacks fine-grained clinical realism; a total of six categories of de-identification methods were tested, the training experiments used only medBERT.de, and hyperparameters were not tuned.
Experimental setupGemini 3.7 Flash、Gemma 4 E2B et al. · SPARCLING-DE、GraSCCo et al. · Precision、Recall et al.
Evaluated models
Gemini 3.7 FlashGemma 4 E2BPresidio+FlairPresidio+spaCyOpenMed PIImedBERT.de
Benchmarks
SPARCLING-DEGraSCCoMIMIC-IV Notei2b2GERNERMED
Metrics
PrecisionRecallF1Self-BLEUMTLDTrigram noveltyOver-anonymization rateChar. recall
AI summaryResearchers propose the LLM-based SPARCLING pipeline, which generates synthetic discharge records with character-level precise PHI (protected health information) span annotations, for building a clinical de-identification evaluation benchmark. Addressing the problem that under strict privacy regulations it is difficult to judge whether a de-identification model is applicable, and that there is a lack of high-difficulty benchmarks with correct labels, the pipeline combines structured attribute sampling, template generation, and red-teaming to obtain diverse PHI-annotated discharge records. Experiments show its content diversity is superior to existing public datasets, that as a benchmark it can reveal failure modes of de-identification models in the German clinical domain, and that training on synthetic data can yield stronger de-identification models than using only scarce public data. Code is open-sourced at https://github.com/Matt00n/phi_discharge_letter_generator。

Researchers propose the LLM-based SPARCLING pipeline, which generates synthetic discharge records with character-level precise PHI (protected health information) span annotations, for building a clinical de-identification evaluation benchmark. Addressing the problem that under strict privacy regulations it is difficult to judge whether a de-identification model is applicable, and that there is a lack of high-difficulty benchmarks with correct labels, the pipeline combines structured attribute sampling, template generation, and red-teaming to obtain diverse PHI-annotated discharge records. Experiments show its content diversity is superior to existing public datasets, that as a benchmark it can reveal failure modes of de-identification models in the German clinical domain, and that training on synthetic data can yield stronger de-identification models than using only scarce public data. Code is open-sourced at https://github.com/Matt00n/phi_discharge_letter_generator。

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    There is a lack of de-identification evaluation benchmarks that are simultaneously challenging, diverse, and correctly annotated, especially in the German clinical domain.

    Core question: how to build a de-identification evaluation benchmark that is challenging, diverse, and clinically surface-plausible while guaranteeing correct labels.

    • Setting and motivation: clinical data use is constrained by privacy regulations and requires reliable de-identification models, but the authors argue that benchmarks capable of comprehensively stress-testing these models are lacking; the German domain is worse due to stricter legislation and scarce public annotated data (Section 1).
    • Shortcomings of existing methods: the authors state that benchmarks based on real clinical data (e.g., i2b2) are inherently in-distribution and lack edge cases and diversity; synthetic benchmarks rewritten from real data inherit the original flaws; LLM synthetic data generated from scratch lacks intrinsic diversity and has questionable label accuracy (Section 1).
    • Core observation: the authors propose that a benchmark needs three properties—character-level exact and complete annotation of PHI, surface plausibility sufficient to embed in realistic context, and controllable broad diversity (covering the long tail and edge cases).
    • Paper's approach: proposes the SPARCLING pipeline, combining structured attribute sampling, placeholder template generation, deterministic backfilling, and red-team quality control to generate synthetic discharge letters with "exact by construction" annotations, and releases the German benchmark SPARCLING-DE (1,019 discharge letters, 34,712 PHI annotations).
    • Intended use: both as an evaluation benchmark to expose failure modes of de-identification models and as training data to improve de-identification model capability.
  2. What related research exists?

    The paper organizes related work along five lines: clinical synthetic data, sampling-based diverse generation, annotation strategies, quality control, and synthetic PHI datasets.

    Clinical NLP synthetic data

    • [47] (2019) early on used an LSTM to generate clinical notes from scratch, establishing the positive effect of synthetic data on downstream NLP; recent work mostly uses LLMs to generate from scratch or to rewrite, extract, and then regenerate based on real data, and the authors consider that these methods have not yet added controllable diversity.

    Sampling-based diversity generation

    • From class-conditional generation (sampled labels guiding generation), to sampling patient profiles with libraries such as Faker and Synthea and then generating text, to [80], [82], [55] additionally sampling text meta-attributes such as writing style and length.
    • The authors state that this paper extends this to stratified sampling, explicitly sampling edge cases, and reusing the sampled values as the source of exact span labels.

    Annotation strategies for synthetic data

    • Four categories: specifying labels before generation (reliable only for sample-level labels), joint generation of labels and data (insufficient controllability and label completeness), post-hoc human or model annotation (rarely error-free), and label-by-construction.
    • [51], [28], and [8] all belong to label-by-construction, but the authors point out that [51] has only a single placeholder type and fixed sentence patterns, and [28] and [8] have limited control over placeholders; this paper uses constrained sampling to determine the use and position of placeholders.

    Quality control and synthetic PHI datasets

    • Manual review has poor scalability; LLM review, LLM red-teaming, and rule-based programmatic verification each have their own work; [22] combines LLMs with deterministic verification similarly to this paper, but for mathematical datasets.
    • Regarding synthetic PHI datasets: [8] is closest to this paper, also using sampled diversity plus template generation, but the authors point out that it requires context samples from real data, generates only short notes of 100 words or fewer, most notes do not contain PHI spans, sampling does not involve text-level diversity, and there is no quality control.

    Baselines and benchmarks: the de-identification methods compared in the benchmark evaluation are a rule-based baseline, Presidio (with spaCy and Flair respectively), OpenMed PII, Gemma 4 E2B, and Gemini 3.7 Flash; the public corpora compared for diversity are MIMIC-IV Note, i2b2, GraSCCo, and GERNERMED; the training experiments perform 5-fold cross-validation on GraSCCo.

    The authors position this paper as: simultaneously satisfying diversity, surface plausibility, and label correctness in the same pipeline, whereas prior work satisfied only some of these properties.

  3. How does the paper address this problem?

    SPARCLING chains sampling, template generation, deterministic backfilling, and dual quality control so that PHI annotations are "exact by construction."

    Overall approach: decompose discharge letter generation into four stages—first sample structured profiles independently of the LLM, then have the LLM write only templates with placeholders, then deterministically fill in PHI values and record character offsets, and finally double-check with deterministic checks plus a red-team LLM. The goal is to generate Dsyn = {(xi, Yi)}i=1N, where xi is a synthetic discharge letter and Yi is its complete PHI span annotation. The authors explicitly do not pursue deep clinical realism, only surface plausibility sufficient to embed PHI.

    Structured attribute sampling

    • Sample first, generate later: each letter samples 50-plus patient and document attributes (name, age, diagnosis, style, length, PHI density ρ, etc.); the core content is determined before the LLM is involved; each attribute type is statically assigned a PHI category per HIPAA guidelines.
    • Stratified conditional sampling: first sample document-level meta-controls (style, length, difficulty, target PHI density ρ), then conditionally sample demographic and clinical attributes, with constraints such as diagnosis being compatible with age and sex, and admission date anchored relative to birth date, to prevent demographic-clinical contradictions.
    • Deliberate distribution expansion: includes medically rare cases and adversarial trick cases (needle-in-the-haystack, name collisions, corrupted formatting); the authors state the goal is not to match the real distribution but to build a challenging benchmark.

    Controlled generation and provenance-based annotation

    • Masked profiles: the LLM sees only the masked profile z̃ᵢ, which exposes PHI categories and grammatical information (e.g., case) but not specific values, and per instructions only places the sampled set of placeholders.
    • Placeholder system: person references carry form (mention form) and case (German four cases); atomic attributes carry variant (e.g., date format); the label ontology contains 17 direct identifiers and 8 quasi-identifiers, plus 3 non-PHI negative labels (eponym, look-alike, non-PII ID) used to measure over-editing (Appendix A.2).
    • Construction is exact: the generation formula is (xi, Yi) = gfill(fLLM(z̃i), zi), i.e., the LLM generates a template, a deterministic function fills in sampled values and records character offsets; annotation precedes value instantiation, so spans are exact by construction; Appendix A.3 gives the full generation prompt.

    Dual verification

    • Known-PHI check: string matching verifies whether all sampled PHI is covered by annotations, using a whitelist to exclude known benign collisions (e.g., patient surnames that share a name with a disease).
    • Residual PHI detection: a red-team LLM audits the masked letter and infers whether personal identifiers remain; the authors emphasize it serves only as a safety net and is never a label source; Appendix A.4 gives the full audit prompt.
    • Conservative principle: if any mechanism finds a suspected leak, the document is discarded.

    Implementation and evaluation setup

    • Both generation and red-teaming use Gemini 3.7 Flash; sampling is deterministic under a fixed seed (base seed 1000), and temperature follows the client default (Appendix B).
    • Benchmark evaluation scores gold spans with lenient matching at IoU ≥ 0.5; training experiments use medBERT.de for binary IO tagging, with character-level recall as the primary safety metric.
  4. What experiments did the paper conduct?

    On SPARCLING-DE, the highest F1 among the six de-identification methods is 0.944, and synthetic pretraining raises char-recall on GraSCCo from 0.955 to 0.975.

    Experimental setup

    • Generation and quality-control model: Gemini 3.7 Flash serves as both the generation LLM and the red-team audit LLM (Section 4).
    • Datasets: SPARCLING-DE contains 1,019 German discharge letters, 837,713 characters, and 34,712 PHI annotations; comparison corpora are MIMIC-IV Note and i2b2 (1,000 documents each randomly sampled), GraSCCo (63 documents), and GERNERMED (1,000 documents), plus a 63-document subsample SPARCLING-DE63 equal in size to GraSCCo.
    • De-identification methods evaluated: rule-based baseline, Presidio+spaCy, Presidio+Flair, OpenMed PII, Gemma 4 E2B, Gemini 3.7 Flash, six categories in total; micro-averaged P/R/F1 is computed against gold spans with lenient matching at IoU ≥ 0.5.
    • Realism review: Gemini 3.7 Flash as a single reviewer scores nine dimensions on a 1–5 scale (Appendix C.3).
    • Training experiments: medBERT.de is fine-tuned on a single NVIDIA Tesla T4, with hyperparameters untuned; experiments reporting mean±standard deviation are repeated three times with seeds 42, 43, 44; 5-fold cross-validation is done on GraSCCo.

    Main results

    De-identification detection performance (micro-averaged, per Table 3):

    Swipe horizontally to read the table

    MetricGeminiGemmaPresidio+FlairPresidio+spaCyOpenMedRule-based
    Precision0.9400.7590.8640.3150.2330.885
    Recall0.9490.3050.7660.6910.5370.695
    F10.9440.4350.8120.4330.3250.778
    • The authors state Gemini is the only method with both high recall and content preservation, but it still does not capture all PHI; misses are mainly in categories such as ZIP codes and occupations, with a small amount of over-editing.
    • The authors state all non-LLM methods leak more than 25% of PHI and perform weakly on the ID category (except OpenMed); Presidio+spaCy and OpenMed over-edit 40% and 60% of medical named terms, respectively.
    • Stratified by difficulty (Table 22), Gemini's F1 is essentially flat from easy to adversarial (0.946→0.941), while all other methods decrease monotonically with difficulty, e.g., Gemma from 0.494 to 0.277.

    Diversity and realism

    • Lexical diversity (Table 1): SPARCLING-DE's Self-BLEU is 0.014, lower than GERNERMED (0.021) and MIMIC-IV (0.060), comparable to GraSCCo (0.013) and i2b2 (0.013); MTLD is 310.0, higher than the most recent public dataset GraSCCo (248.5); document length standard deviation is 4,519 characters. The authors note i2b2 and MIMIC-IV are English, so lexical values are for reference only.
    • Content diversity: the 1,019 letters cover 3,046 unique ICD codes with no repeated combinations; the harmonic mean of normalized Shannon entropy over controllable attributes is 0.878; among 518,671 profile pairs, only 1 pair has a Gower distance below 0.1.
    • Realism (Table 2): PHI density is 41.4 spans per thousand words, close to GraSCCo's 43.2; under LLM review, temporal consistency is 3.42 vs GraSCCo 3.86 and structure 3.37 vs 4.10, with other dimensions lagging, and overall realism 2.08 vs 3.46 (MIMIC-IV 4.95); the authors state the low scores are directly caused by deliberate diversity-oriented sampling, and decrease monotonically with difficulty level (Table 17, overall realism easy 2.26 → adversarial 1.70).

    Training utility

    • Synthetic-only training transfer (Table 23): medBERT.de trained only on SPARCLING-DE achieves character-level F1 0.996 on the synthetic held-out set, and character-level F1 0.890 and char-recall 0.844 on GraSCCo.
    • Mixed training (Table 4/24): in GraSCCo 5-fold cross-validation, synthetic pretraining followed by fine-tuning on public data gives char-recall 0.975±0.013, higher than public-data-only 0.955±0.022, with span F1 rising from 0.850 to 0.873.
    • Value of adversarial samples (Table 25): removing about 10% adversarial samples lowers GraSCCo span F1 from 0.762 to 0.746, mainly because precision drops from 0.864 to 0.824; combined with data-scale experiments, the authors conclude the gain comes from adversarial content rather than training volume.

    Other ablations and analyses

    • No structured sampling (first 100 letters): trigram novelty 0.25 vs 0.82, Self-BLEU 0.214 vs 0.013, surname entropy 3.14 vs 6.52 bits, all 100 letters in cardiology with only 13 ICD codes (Section 4.4.1).
    • No-placeholder generation (first 100 letters): leak marker rate rises from 9% to 21%, with the main leak type becoming names (Section 4.4.2).
    • Quality-control contribution (Section 4.1): of 1,150 documents, 40 (3.48%) had invalid placeholders and 91 (7.91%) were blocked for potential leaks; all 75 documents flagged by the red team were true leaks with no false positives, totaling 88 unregistered PHI instances, of which 47 were ages.
    • Data scale (Figure 10): as the synthetic training set grows from 94 to 821 documents, GraSCCo span F1 rises from 0.703 to about 0.76, with essentially no change from 541 to 821 documents.
  5. What are some points that can be further explored?

    The authors note that validation was performed only on German discharge letters, that the generated text lacks fine-grained factuality, and propose follow-up directions such as template-based counterfactual reuse.

    Limitations and future directions noted by the authors

    • Single domain: The authors state that they validated the method only in the focused domain of German discharge letters (Section 5, Limitations and Future Work).
    • Insufficient realism: The generated discharge letters are superficially plausible but lack fine-grained clinical realism, which the authors believe stems at least in part from prioritizing diversity; future work could study methods that constrain generation toward more realistic outputs while maintaining diversity (Section 5).
    • Template counterfactuals: The authors propose that future work could reuse the generated placeholder templates to compute counterfactuals, to better understand different failure modes that are difficult to isolate in real corpora (Section 5).
    • Adjacent domains: The authors believe the method could be tested in adjacent domains such as ICD coding, and note that their sampling can already produce ICD gold labels (Section 5).

    Scope of the experiments

    • Six de-identification methods were tested: a rule-based baseline, Presidio+spaCy, Presidio+Flair, OpenMed PII, Gemma 4 E2B, and Gemini 3.7 Flash (Table 3).
    • Both generation and red-team auditing used a single model, Gemini 3.7 Flash; the realism review also used Gemini 3.7 Flash as the sole reviewer, and the paper does not report agreement between the reviewer and humans (Section 4, Appendix C.3).
    • The training experiments used only medBERT.de, ran on a single NVIDIA Tesla T4, and did not tune hyperparameters; experiments reporting uncertainty were repeated with three seeds (Appendix C.5).
    • The diversity comparison covered four public corpora, of which only GraSCCo is a synthetic dataset, and only MIMIC-IV and GraSCCo contain complete discharge letters (Section 4.2).
    • Ablations were performed on the first 100 samples of SPARCLING-DE; the adversarial example ablation reduced the training set from 821 to 738 documents (Section 4.4, Appendix C.5).
  6. Summarize the main content of the paper

    SPARCLING uses sampling plus placeholder generation to produce synthetic discharge letters with exact PHI annotations, validated for both benchmark and training use.

    A paper on clinical de-identification evaluation and data generation that addresses the lack of challenging, diverse, and correctly labeled benchmarks in the German clinical domain by proposing the SPARCLING pipeline and releasing the SPARCLING-DE dataset.

    • Method: first hierarchically sample 50-plus patient and document attributes independently of the LLM; the LLM writes templates with typed placeholders based only on masked profiles; then deterministically backfill PHI values and record character offsets, making annotations "exact by construction"; deterministic checks and a red-team LLM double-check for leaks, discarding a document if either finds one.
    • Quality-control results: of 1,150 generated documents, 7.91% were blocked for potential leaks; all 75 documents flagged by the red team were true leaks with no false positives, which the authors state demonstrates the necessity of dual quality control.
    • Diversity: SPARCLING-DE's Self-BLEU is 0.014, lower than GERNERMED (0.021) and MIMIC-IV (0.060); MTLD 310.0 is higher than the recent GraSCCo (248.5); the 1,019 letters cover 3,046 unique ICD codes.
    • Benchmark value: among six de-identification methods, Gemini 3.7 Flash has the highest F1 at 0.944, while Gemma is only 0.435; the authors state reliable de-identification remains an open problem.
    • Training value: medBERT.de trained purely on synthetic data reaches character-level F1 0.890 on GraSCCo; synthetic pretraining plus public-data fine-tuning raises char-recall from 0.955 to 0.975; removing adversarial samples lowers span F1 from 0.762 to 0.746.
    • Authors' conclusion: SPARCLING can both produce a discriminative benchmark and serve as a data generator to train more usable de-identification models; the authors also acknowledge validation only on German discharge letters, that the text lacks fine-grained clinical realism, and plan to explore template counterfactual reuse and adjacent applications such as ICD coding.
Read originalarxiv.org