kp-deid-xlmr-560m-legal β€” a re-identification protector for legal text

A 560M XLM-RoBERTa-large token classifier (LoRA-finetuned, adapter merged) for PII de-identification, trained for the EuroPriv-Bench program. It is published not because it tops detection-F1 β€” it does not β€” but because, on the metric that measures privacy harm, it is the best protector we have found on real legal text.

Headline (real, external gold): on the Text Anonymization Benchmark (TAB; PilΓ‘n et al. 2022 β€” real ECHR court judgments, manually annotated), this model leaves 9.5% of DIRECT identifiers un-redacted vs the next-best public system's 49.6% (spaCy) / 50.0% (Presidio) β€” i.e. it leaks ~5Γ— fewer of the identifiers that directly re-identify a person.

  • Robust: 3 training seeds β†’ DIRECT-leak {9.5%, 9.9%, 9.9%}.
  • Significant: paired bootstrap over 264 shared DIRECT subjects β†’ Ξ” vs runner-up = βˆ’40 points, 95% CI [βˆ’47.7, βˆ’32.2] (fully below 0).
  • Not over-redaction: it marks 9.1% of tokens as PII (gold = 11.3% β€” it under-tags overall), with 4.3% false-positive redaction. It is aimed, not blunt.

Why detection-F1 is the wrong number, and re-id is the right one

This model sits mid-table on strict detection-F1 (~0.34). That is by design and is the whole point: strict F1 punishes disagreeing with the gold on a span's exact boundary or entity type β€” but a person's privacy does not care about the label, only about whether the identifying string was redacted. This model reliably touches the identifier tokens (removing them) even when it gets the boundary or type slightly wrong. If you choose a de-identifier by detection-F1, you can choose one that leaves half the identifiers behind. Choose by leak-rate.

Training data

Trained on real CJEU judgment structure (from davidwickerhf/cjeu-opendata, Apache-2.0) β€” real legal document layouts β€” with synthetic, checksum-valid PII spliced in (gold by construction). This is real legal structure with synthetic identifiers; it contains no real personal data. CJEU (Court of Justice of the EU) is a different court from ECHR, so the TAB result above is genuine zero-shot generalisation (contamination checked: 0 document overlap).

Taxonomy

18 GDPR-aligned KP entity types (BIOES): PERSON, NATIONAL_ID, ACCOUNT_ID, ADDRESS, EMAIL, PHONE, DATE, URL, ORG_PARTY, CASE_NUMBER, COURT, STATUTE_REF, COMPANY_ID, FACILITY, PROVIDER, MRN, HEALTH_CONDITION, SECRET.

Intended use & limitations

  • Use: de-identification of English (legal) text where minimising re-identification risk is the priority β€” detect spans, then redact/replace.
  • Scope of the claim: validated on one board (TAB, English legal). Breadth across languages and domains is in progress; treat use outside English legal as unvalidated.
  • Research checkpoint (seed 0 of 3). Not clinical-validated. Strict-F1 is modest β€” expect boundary/type imperfection that does not affect redaction coverage.
  • The re-id leak-rate metric is grounded in TAB's own externally-annotated DIRECT/QUASI labels (it is not a self-defined construct), but competitors report detection-F1, so head-to-head re-id numbers come from scoring all systems through EuroPriv-Bench.

Links

config_status: dev (synthetic training data) / evaluated on real-external-gold (TAB). Not a peer-reviewed claim yet β€” see the scorecard for the full method and caveats.

Downloads last month
5
Safetensors
Model size
0.6B params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for klusai/kp-deid-xlmr-560m-legal

Finetuned
(998)
this model