Custom AI models for the enterprise · New York · LondonSecurityResearchContact sales
Finetune the World
Healthcare

HIPAA and fine-tuning LLMs on clinical data

Clinical text is some of the most valuable training data there is, and some of the most regulated. The safest architecture is also the simplest: de-identify first, train inside the covered entity’s environment, and test for memorization.

A clinician in scrubs walking down a sunlit hospital corridor with sage-green walls and wooden handrails

Who is who under HIPAA#

A hospital or health plan is a covered entity. A firm that handles protected health information (PHI) on its behalf — including to train a model — is a business associate and must sign a business associate agreement (BAA) before receiving any PHI. The BAA limits use of the data to the contracted purpose: a vendor cannot reuse a client’s PHI, or a model trained on it, for other customers.

Not legal advice

This page summarizes public guidance as we understand it in October 2026 to help technical and risk teams plan. Confirm obligations with your counsel and compliance function.

The two de-identification routes#

Data that is properly de-identified under 45 CFR §164.514(b) is no longer PHI and falls outside the Privacy Rule’s restrictions. There are two methods, and either may be used:

Safe Harbor#

Remove eighteen categories of identifiers about the individual and their relatives, employers and household members, and have no actual knowledge that the remainder could identify anyone:

  1. Names
  2. Geographic subdivisions smaller than a state (street, city, county, ZIP — the first three ZIP digits may stay if that area has more than 20,000 people)
  3. All elements of dates except year directly related to an individual (birth, admission, discharge, death); ages over 89 aggregated into 90+
  4. Telephone numbers
  5. Fax numbers
  6. Email addresses
  7. Social Security numbers
  8. Medical record numbers
  9. Health plan beneficiary numbers
  10. Account numbers
  11. Certificate or licence numbers
  12. Vehicle identifiers and serial numbers, including licence plates
  13. Device identifiers and serial numbers
  14. Web URLs
  15. IP addresses
  16. Biometric identifiers, including finger and voice prints
  17. Full-face photographs and comparable images
  18. Any other unique identifying number, characteristic or code

Expert Determination#

A qualified statistical expert determines, and documents, that the risk of re-identification is very small, using accepted methods. This route can keep details Safe Harbor strips — full dates for longitudinal patterns, finer geography — which can matter for clinical tasks.

Why de-identifying clinical text is harder than tables#

Identifiers in notes are unstructured: “seen with her daughter Maria at the Elm St clinic on 3/14”. Rule-based scrubbers miss variants and over-redact clinical terms that look like names (eponymous diseases, drug names). Our pipeline combines pattern rules for structured identifiers, a named-entity model for names and locations, date shifting with a consistent per-patient offset (preserving intervals between events, which clinical tasks need), and human review of a sample with a measured miss rate. Under Expert Determination, that measured residual rate is part of the evidence.

Memorization: why it matters more for models#

Language models can memorize rare sequences in their training data and reproduce them when prompted, and fine-tuning on small datasets for many epochs increases the risk. A model trained on raw PHI is therefore itself a potential disclosure channel, which is the strongest argument for de-identifying before training rather than relying on output filters afterwards.

We test for it directly. Canary strings — synthetic identifiers inserted into a held-out copy of training data — measure whether a training recipe memorizes rare tokens. Extraction probes prompt the trained model with prefixes from training notes and check completions against the source. Both run in the evaluation suite as release gates (evaluating fine-tuned LLMs).

A reference architecture#

StepWhere it runsControl
Extract notes and labelsCovered entityMinimum necessary fields only
De-identify (Safe Harbor or Expert Determination)Covered entityMeasured residual identifier rate; expert sign-off where applicable
Annotation by cliniciansCovered entity toolingAccess logging; no export
Training and evaluationCovered entity cloud account or on-prem GPUsNo data egress; BAA covers vendor engineers
Memorization and leakage testsCovered entityRelease gate
ServingCovered entityAudit logging of inputs and outputs

Training compute for this kind of model is modest — a 7B model fine-tuned on tens of millions of tokens is a few GPU-hours (compute model) — so running it inside the covered entity’s environment is rarely a cost problem.

References#

  1. US Department of Health and Human Services. Guidance Regarding Methods for De-identification of Protected Health Information in Accordance with the HIPAA Privacy Rule.
  2. 45 CFR §164.514(a)–(b), Other requirements relating to uses and disclosures of protected health information.

Frequently asked

Can’t find your question? Ask a senior engineer.

Can you fine-tune an LLM on PHI?

A covered entity or its business associate may use PHI for permitted purposes under a BAA, but the cleanest approach is to de-identify data under 45 CFR §164.514(b) before training, so the training set is no longer PHI and the model cannot leak identifiers it never saw.

What are the two HIPAA de-identification methods?

Safe Harbor, which removes 18 specified identifier categories, and Expert Determination, in which a qualified expert documents that the risk of re-identification is very small.

Bring us one task. We’ll show you what a specialist model can do.

A 45-minute briefing with a senior research engineer. You leave with a feasibility read, a data plan and a fixed quote, whether or not you hire us.

Book a briefing →