One CPU thread checks a million notes for about seven cents, inside your own environment

A de-identified batch is ready for release. Before it leaves, someone has to decide, note by note, whether a name, a date of birth, or a phone number slipped through masking. Across millions of notes this is a classification task with a fixed set of answers: is protected health information (PHI) left in the note, is the leak harmful, and how much PHI does the note expose?
Most teams answer it in one of three ways. A reviewer reads a sample by hand, and the notes outside the sample go out unchecked. A second extraction pass returns entity spans that someone still has to read. Or each note goes to a frontier large language model (LLM) with a prompt, which sends the notes that still hold PHI to a third party along with the rest.
PHI Guard models are decision models purpose-built for healthcare de-identification. A decision model answers a defined question about a document with a fixed set of answers and a probability, and it writes no text. PHI Guard asks four fixed questions of every note and runs inside your own environment, most versions on a CPU. This post follows one note through the check, compares the nine PHI Guard models, and measures PHI Guard against three frontier APIs on the same 1,200 notes.
The family has nine models. PHI Guard Small and PHI Guard Nano are the larger models, built for a GPU; Nano also runs on a CPU. The other seven are small enough for one CPU thread, and we call them the Tiny models. PHI Guard Tiny, listed as v0.7 in the tables, is the default and answers all four questions. PHI Guard Tiny Fast (v0.7 Fast) answers the same four questions about five times faster. The five single-question Tiny models (v0.6) answer one question each.
One de-identified note from check to release decision
Step 1: the note. Masking replaced the date and missed the rest. The guard reads the de-identified text as it is.
Pt Daniel Okafor, DOB 04/22/1961, seen on [DATE] for knee pain. X-ray normal. Follow up in 6 weeks.

Step 1: a synthetic clinic note after masking.
Step 2: the question. PHI Guard asks “Is any PHI left after de-identification?” and accepts two answers, PHI_LEAK and NO_PHI_LEAK. You do not write the question. It is built into the model.

Step 2: the question built into PHI Guard and its two answers.
Step 3: the decision. PHI Guard Tiny returns a leak probability of 1.00. In the same call it scores the leak as harmful at 0.996 and puts the note at exposure level 3 of 6 (moderate).

Step 3: PHI Guard Tiny’s answer and the scores from the same call.
Step 4: the action. The note is held back from the release and goes to a reviewer. The harmful score tells the reviewer that a direct identifier is left, here a name and a date of birth.

Step 4: the note is held back. A leak probability of 0.5 or higher goes to a reviewer.
The same note in three versions, scored by PHI Guard Tiny at a cut-off of 0.5:

The same synthetic note in three versions, scored by PHI Guard Tiny at a cut-off of 0.5.
The third row is the case a single leak score cannot settle. A city on its own is not a harmful identifier under the PHI Guard Tiny definition, so the note leaks without being harmful. The two outputs let you write that policy into the pipeline: hold every leak, or hold the harmful ones and sample the rest. Choose the cut-off on a sample of your own de-identified notes and keep it fixed once it is set.
What teams assume and what we measured
We put the same leak question to PHI Guard, to the general Medical Decision Models, and to four APIs, on 1,200 de-identified notes. Several common assumptions did not hold.

What teams usually assume, and what we measured on 1,200 de-identified notes.
Frontier models remain the right tool for open-ended reasoning and writing. Checking a note for leftover PHI is one fixed question asked millions of times, and a model trained for that question answers it on your own hardware.
Four questions and nine outputs for every note
PHI Guard answers four questions. PHI Guard Tiny, Tiny Fast, Small, and Nano answer all four for one note and return nine outputs: leak, harmful, raw, and six richness scores.

The four questions PHI Guard answers, with examples from PHI Guard Tiny on synthetic notes.
PHI Guard Tiny and Tiny Fast count these leaks as harmful: a name, an ID, a contact detail, a date of birth, a street address, an age over 89, or three or more harmless kinds of detail together. A clinician name, a city or state, a hospital, an organization, a date other than the birth date, or an age up to 89 on its own is a harmless leak. The harmful score is never higher than the leak score.
Age follows the HIPAA rule. In “A 93-year-old patient was admitted on [DATE] with a hip fracture after a fall at home,” the date is masked and the age is left in. PHI Guard Tiny scores the leak at 0.9986, because HIPAA Safe Harbor lists all ages over 89 among the identifiers to remove or to group into a single category of 90 or older (45 CFR § 164.514(b)(2)(i)).
Leak and harmful gate the release. Raw runs before de-identification and finds the original notes that hold no PHI at all. Richness, tracked over batches, shows whether a change in the source data or the pipeline moved the amount of PHI left in your output.
John Snow Labs offers two kinds of Medical Decision Models. Medical DM Small and Medical DM Nano are general models: you write the question and its answers. PHI Guard Small and PHI Guard Nano belong to the PHI Guard family, with the four questions built in.
Nine PHI Guard models from CPU to GPU

The nine PHI Guard models. Source: Decision Models page, John Snow Labs.
PHI Guard Tiny is the default choice on a CPU: one model holds all four questions and nine outputs, at 6.4 ms per note. PHI Guard Tiny Fast returns the same outputs at 1.3 ms per note and is a little less exact. The single-question Tiny models answer one question each, for pipelines that need only the leak gate, the raw check, or the richness level.
PHI Guard Small is the most accurate model of the family and needs a GPU with about 16 GB of memory. PHI Guard Nano needs about 2 GB of GPU memory or runs on CPU, and it was also trained on noisy, OCR-style text.
PHI Guard Small flags the fewest clean notes
We scored the models on internal hard cases: a main set of de-identified clinical notes, held-out notes, and long notes, plus the mean of four public datasets. PR-AUC measures how well a model ranks the notes that leak above the clean ones, where 1.0 is a perfect ranking. The last column counts the clean notes on the main set that a model flags at a cut-off of 0.5.

Leak detection PR-AUC on internal hard cases, and clean notes flagged at a cut-off of 0.5 on the main set. Public sets are the mean of four public datasets. Source: Decision Models page, John Snow Labs.
PHI Guard Small leads on the main set (0.994), on held-out notes (0.992), and on the public sets (0.811). On the same main set it flags 26 clean notes, against 41 for PHI Guard Nano and 91 for PHI Guard Tiny. Every model scores lower on the public sets than on the main set, so measure the cut-off on your own notes before you rely on it.
The harmful output cuts the reviewer queue further. On the main set, the share of notes with only harmless leaks that a model still flags:

Share of notes with only harmless leaks that each model flags on the main set; lower is better. PHI Guard v0.6 has no harmful output, so its leak score stands in. Source: Decision Models page, John Snow Labs.
On raw notes every model reaches a PR-AUC of 0.997 or higher, so the choice of model makes little difference there. On richness, PHI Guard Small has the lowest level error on the main, held-out, and long-note sets. The full harmful, raw, and richness tables are on the Decision Models page.
Frontier APIs flag up to 77% of clean notes
We put the leak question to every model on 1,200 de-identified notes from the PHI Guard benchmark: 585 with a leak and 615 clean. These counts come from a different evaluation than the PR-AUC table above, so compare models within each table. Every model received the same note and the same question, and the API models were asked to reply with the chosen option only.

The same leak question on 1,200 de-identified notes, 585 with a leak and 615 clean. John Snow Labs models highlighted.
A flagged clean note is a false alarm that a person has to review, so precision decides the review budget as much as the catch rate decides safety. Claude Haiku 5.5 catches the most leaks and flags more than three in four clean notes. GPT-6 Luna and Jev 1.14 flag about one in three. Gemini 3.8 Flash flags the fewest clean notes (29) and catches fewer leaks than any John Snow Labs model (89%). PHI Guard Tiny catches 94% of leaks and flags 12% of clean notes on one CPU thread.
The answers split on four notes we selected from the benchmark. In the first three, every identifier is already masked. In the fourth, masking replaced every field of a prescription except the prescriber’s surname. The numbers are leak probabilities; the APIs were asked for the answer only.

Four notes selected from the 1,200-note benchmark. Shaded cells match the correct answer; numbers are leak probabilities.
Jev 1.14, GPT-6 Luna, and Claude Haiku 5.5 flag all three clean notes, and Gemini 3.8 Flash flags the discharge header. Gemini 3.8 Flash, Jev 1.14, and GPT-6 Luna pass the prescription with the surname left in. The three John Snow Labs models answer all four notes correctly.
Across the seven models, the catch rate runs from 89% to 98% and the cost of checking one million notes from $0.07 to $800.

Cost to check one million notes for leftover PHI, log scale. API figures are billed OpenRouter charges at list prices on November 26, 2026; John Snow Labs figures are compute at illustrative rates.
The API figures are the charges OpenRouter billed for these notes, at list prices on November 26, 2026. The John Snow Labs figures are compute time per note, measured on general clinical documents for the Medical DMs and on a 1 KB note for PHI Guard Tiny, at illustrative rates of $0.04 per CPU hour and $1.30 per GPU hour; they are not John Snow Labs prices. PHI Guard Tiny holds all nine outputs in one model, while the API models are priced for the leak question alone. The cheapest frontier API in the comparison, GPT-6 Luna, costs more than 700 times as much as PHI Guard Tiny for the same million notes.
An API checker also has to receive every note it checks, including the notes that still hold the PHI it is meant to catch. A guard that runs in your environment never sends a note out.
A million notes take 22 minutes to 1.8 hours on CPU
CPU models: one thread, a 1 KB note. GPU models: batched on a GPU with 24 GB of memory.

Time and illustrative compute cost per million notes. CPU: one thread, a 1 KB note. GPU: batched on 24 GB. Source of times: Decision Models page, John Snow Labs.
Costs use the same illustrative rates: $0.04 per CPU hour and $1.30 per GPU hour. They cover compute only, not storage, networking, or orchestration. The work splits by note, so in a Spark pipeline more threads and more machines check more notes at the same time.
The false-alarm rate then sets the reviewer workload. On a million clean notes, the rates measured on the 1,200-note benchmark send about 50,000 notes to a person at 5%, about 120,000 at 12%, and about 770,000 at 77%. Measure the rate on your own notes before you plan the review team.
Send the guard masked notes
PHI Guard reads masked or raw text. Send it the masked output of de-identification, where PHI is replaced by tags such as <PATIENT> or [NAME]. An obfuscated copy replaces PHI with realistic fake names, dates, and numbers. To the guard those look like real PHI and raise false flags.
What a PHI Guard score leaves to you
PHI Guard scores the note as a whole. It does not locate or remove PHI, and the notes it flags go to review. A NO_PHI_LEAK label does not certify that a note is safe to release, and the release decision under HIPAA Expert Determination stays with an expert.
PHI Guard runs inside your own environment
The seven Tiny models ship in Healthcare NLP 7.0.1 through the DecisionModel annotator. To gate a de-identification pipeline, add a leak stage after it and point it at the masked output:
from pyspark.ml import PipelineModel
from sparknlp.pretrained import PretrainedPipeline
from sparknlp_jsl.annotator import DecisionModel
deid_pipeline = PretrainedPipeline(
"clinical_deidentification_docwise_benchmark_optimized_v2", "en", "clinical/models"
)
phi_guard_leak = DecisionModel.pretrained("phi_guard_3m_v0.7", "en", "clinical/models") \
.setInputCols("masked") \
.setOutputCol("phi_leak") \
.setMode("leak")
guarded_pipeline = PipelineModel(
stages=list(deid_pipeline.model.stages) + [phi_guard_leak]
)
result = guarded_pipeline.transform(notes_df) # notes_df: a DataFrame with a text column
Each document gets PHI_LEAK or NO_PHI_LEAK, with phi_leak_prob and a status in the metadata. PHI Guard Tiny and Tiny Fast answer one question per stage: set it with setMode (leak, harmful, raw, or richness) and copy the stage for each question you need. The DecisionModel notebook runs this pipeline on example notes.
On-premises, PHI Guard Tiny and Tiny Fast also run in the johnsnowlabs/jsl-llms Docker image next to Medical DM Small:
docker run -d \ --gpus all \ --env "SPARK_NLP_LICENSE=your_license_key" \ -p 8080:8080 \ --ipc=host \ johnsnowlabs/jsl-llms:0.33.0 \ --model Medical-DM-Small \ --guards all \ --port 8080
POST /v1/guards checks a list of documents with phi-guard-v7-final or phi-guard-v7-fast. The image also serves an ensemble endpoint that checks each note with PHI Guard Tiny and Medical DM Small and sends the notes where the two disagree to a person. PHI Guard Small and PHI Guard Nano are deployed like the Medical DMs, on-premises and on AWS, Azure, Databricks, and Snowflake.
Questions to ask about your release process
If any of these is hard to answer, a PHI check on every note is worth a look:
- How many de-identified notes leave your environment without a check on the output?
- Does your current check send notes to a third party, including the ones that still hold PHI?
- How many false alarms per million notes can your reviewers absorb?
- Do your reviewers see harmful leaks before harmless ones?
- Would you know if a change in the source data raised the amount of PHI left in your output?
Every one of these has a practical answer. A small model trained for the question can check every de-identified note, return a probability for each answer, and send only the flagged notes to a person, inside your own infrastructure and for cents per million notes on a CPU. To see how PHI Guard works on your own masked notes, talk to our team.
Frequently asked questions
What is PHI Guard? PHI Guard is a family of nine John Snow Labs decision models that check clinical notes for protected health information. They tell you whether a de-identified note still leaks PHI, whether the leak is harmful, how much PHI a note exposes on a scale from 0 to 6, and whether an original note holds any PHI at all. Seven models, which we call the Tiny models, run on a CPU in about 1 GB of RAM; PHI Guard Small and PHI Guard Nano run on a GPU, and Nano also on CPU.
How is PHI Guard different from asking a frontier LLM? A frontier LLM receives every note you check, including the ones that still hold PHI, and you pay for every note you send. On our 1,200-note benchmark, PHI Guard Tiny caught 94% of leaks and flagged 12% of clean notes for about $0.07 per million notes on one CPU thread. The frontier APIs cost $55 to $800 per million notes, and Claude Haiku 5.5 flagged 77% of clean notes.
Which PHI Guard model should I use? PHI Guard Tiny is the default on a CPU: one model holds all four questions and nine outputs, at 6.4 ms per note. PHI Guard Tiny Fast returns the same outputs at 1.3 ms per note with slightly lower accuracy. PHI Guard Small is the most accurate and needs a GPU with about 16 GB of memory; PHI Guard Nano needs about 2 GB of GPU memory or runs on CPU.
How accurate is PHI Guard at finding PHI left after de-identification? On our internal hard cases, PHI Guard Small reaches a PR-AUC of 0.994 on the main set and flags 26 clean notes, and PHI Guard Tiny reaches 0.986 and flags 91. On the mean of four public datasets the scores are 0.811 and 0.753, so choose your cut-off on a sample of your own notes.
What is a harmful PHI leak? PHI Guard Tiny and Tiny Fast treat a name, an ID, a contact detail, a date of birth, a street address, an age over 89, or three or more harmless details together as harmful. A clinician name, a city or state, a hospital, or an age up to 89 on its own is harmless. PHI Guard Small flags 3.9% of notes with only harmless leaks, against 38% for PHI Guard Tiny.
How long does it take to check one million notes? PHI Guard Tiny takes about 1.8 hours on one CPU thread and PHI Guard Tiny Fast about 22 minutes. PHI Guard Small takes about 10 to 12 hours and PHI Guard Nano about 6.7 hours on a GPU with 24 GB of memory.
Can I send obfuscated notes to PHI Guard? No. Send masked notes, where PHI is replaced by tags such as <PATIENT> or [NAME], or original notes for the raw check. Obfuscated notes replace PHI with realistic fake values, which look like real PHI to the guard and raise false flags.
Does a passing score mean a note is safe to release? No. A NO_PHI_LEAK label means the model found no leak above your cut-off. It does not certify the note, and a release under HIPAA Expert Determination still needs an expert’s judgment.
All patient data shown is synthetically generated for illustration.




























