Skip to content

Medical AI · Generative AI & LLMs · Lesson 4 of 7

Hallucination and grounding

Reviewed by Dr. Ram Kumar G, MBBS, MD (Internal Medicine), MPH (USA), on · Last updated

  • Intermediate
  • Clinical focus
  • About 30 minutes
  • Includes exercise

Before this lesson: How large language models work, Prompting for clinical tasks

In short

In clinical text, a hallucination is content that is not supported by the source, such as a medicine the patient was never prescribed; an omission is something important that was left out. Both occur even in good systems: one large evaluation of AI-generated clinical notes found hallucinations in 1.47% of sentences, almost half of them potentially harmful. Grounding the model in specific source documents, requiring traceable citations and checking outputs against the source reduce the risk, but a clinician must still review what matters.

You will learn to

  • Distinguish hallucinations, contradictions and omissions in generated clinical text
  • Measure hallucination and omission rates with sentence-level review
  • Build a simple automated check for unsupported numbers and medicines, and know its limits
  • Choose grounding strategies and review processes proportionate to the risk

Kinds of error in generated clinical text

Omissions are easy to overlook because nothing on the page looks wrong. In the framework developed by Asgari and colleagues, clinicians reviewed every sentence of AI-generated clinical notes against the consultation transcript. Across 12,999 note sentences, they found a 1.47% hallucination rate, 44% of which were rated major, and a 3.45% omission rate, 17% of which were major.

ErrorDefinitionSynthetic example
FabricationContent with no basis in the sourceA summary says a new medicine was started when none was
ContradictionContent that conflicts with the sourceSource: 'no chest pain'; summary: 'reports chest pain'
DistortionCorrect topic, wrong detailFollow-up in 6 months instead of 3
OmissionImportant source content left outAn allergy mentioned in the consultation is missing from the note

Measuring errors with clinician review

The reference method is sentence-level review: a clinician checks every output sentence against the source, labels unsupported content and its severity, and lists important source content that is missing.

python
reviews = [
    {"note_sentences": 14, "hallucinations": [], "omissions": ["allergy"]},
    {"note_sentences": 11, "hallucinations": [("dose changed", "major")], "omissions": []},
    {"note_sentences": 16, "hallucinations": [("extra symptom", "minor")],
     "omissions": ["follow-up date", "smoking status"]},
    {"note_sentences": 12, "hallucinations": [], "omissions": []},
]
sentences = sum(r["note_sentences"] for r in reviews)
halluc = [h for r in reviews for h in r["hallucinations"]]
omissions = sum(len(r["omissions"]) for r in reviews)
major = sum(1 for _, severity in halluc if severity == "major")
print(f"{sentences} sentences reviewed")
print(f"Hallucination rate {len(halluc) / sentences:.1%} ({major} major)")
print(f"Omissions: {omissions} across {len(reviews)} notes")
print(f"Notes with at least one error: "
      f"{sum(1 for r in reviews if r['hallucinations'] or r['omissions'])} of {len(reviews)}")

# 53 sentences reviewed
# Hallucination rate 3.8% (1 major)
# Omissions: 3 across 4 notes
# Notes with at least one error: 3 of 4
Summarising a clinician review of four synthetic AI-generated notes.
  • A low per-sentence error rate can still mean that most notes contain at least one error: here 3 of 4. Report both rates.
  • Severity matters more than counts: one changed dose outweighs several minor wording problems.

A simple automated check, and its limits

Full review does not scale, so systems add automated checks. The simplest compares concrete details, such as numbers and medicine names, between output and source.

python
import re

source = """Synthetic consultation. Patient reports tiredness for three weeks.
On metformin 1 g twice daily. HbA1c last month 8.4%. Blood pressure today 138/86.
No chest pain. Plan: add a second medicine after discussing options; recheck HbA1c in 3 months."""

summary_sentences = [
    "Three weeks of tiredness.",
    "Takes metformin 1 g twice daily.",
    "HbA1c 8.4% last month; blood pressure 138/86.",
    "Started on gliclazide 80 mg.",          # not in the source
    "Reports chest pain on exertion.",       # contradicts the source
    "Recheck HbA1c in 6 months.",            # wrong interval
]

MEDICINES = {"metformin", "gliclazide", "insulin", "sitagliptin", "empagliflozin"}
src = source.lower()
src_numbers = set(re.findall(r"\d+(?:\.\d+)?", src))

def unsupported_details(sentence):
    s = sentence.lower()
    problems = [f"number {n}" for n in re.findall(r"\d+(?:\.\d+)?", s) if n not in src_numbers]
    problems += [f"medicine {m}" for m in MEDICINES if m in s and m not in src]
    return problems

for sentence in summary_sentences:
    problems = unsupported_details(sentence)
    print(("FLAG  " if problems else "ok    ") + sentence, problems or "")

# ok    Three weeks of tiredness.
# ok    Takes metformin 1 g twice daily.
# ok    HbA1c 8.4% last month; blood pressure 138/86.
# FLAG  Started on gliclazide 80 mg. ['number 80', 'medicine gliclazide']
# ok    Reports chest pain on exertion.
# FLAG  Recheck HbA1c in 6 months. ['number 6']
Flag summary sentences containing numbers or medicines that are not in the synthetic source.
  • The check catches the invented medicine and the wrong interval.
  • It misses the most dangerous error: 'reports chest pain' passes because the words 'chest pain' appear in the source, inside 'No chest pain'. Negation, paraphrase and wrong attribution need more than word matching.
  • Stronger checks use clinical NLP for negation, or a second model asked to verify each sentence against the source. Both reduce, not remove, the need for human review.

Grounding strategies

Grounding means tying output to specific, checkable sources rather than to the model's memory.

StrategyHow it helpsRemaining risk
Supply the source in the promptThe model summarises or answers from the text givenIt can still add or distort details
Retrieval-augmented generation (RAG)Relevant passages from trusted documents are retrieved and suppliedWrong or outdated passages can be retrieved; the answer may not follow them
Sentence-level citationsEach statement points to the source passageCitations can be attached to statements they do not support; they must be checked
Automated verificationRules or a second model check each claim against the sourceMisses subtle errors; can create false reassurance
Constrained outputFill fixed fields rather than writing free textLess flexible; errors in fields still possible

Matching review to risk

  • Lower risk, such as a patient-information draft a clinician edits: spot-checks and clear 'AI-drafted' labelling.
  • Medium risk, such as consultation notes entering the record: the responsible clinician reviews every note before signing, and errors are audited periodically.
  • Higher risk, such as content that directly influences medicines or triage: regulatory requirements may apply, with formal validation and monitoring.

Regulators are starting to act (as of October 2026)

  • In December 2025 the US FDA cleared, through the 510(k) pathway, a prescription app for insulin management in adults with type 2 diabetes that uses a patient-facing large language model; it was described as the first such clearance.
  • In August 2026 the FDA's Digital Health Center of Excellence released a discussion paper on the regulation of generative-AI-enabled medical devices for public comment.

Exercise

Measure and reduce hallucinations and omissions in synthetic AI-generated clinic notes.

Data: Ten synthetic consultation transcripts with AI-style draft notes, written for the notebook (Created for this course; no real patient data)

  1. Review two draft notes sentence by sentence against their transcripts and label hallucinations, contradictions and omissions with severity.
  2. Compute per-sentence and per-note error rates for all ten notes using the labels provided.
  3. Run the number-and-medicine checker and calculate its sensitivity for the labelled hallucinations.
  4. Add a simple negation rule (for example 'no', 'denies', 'without' before a symptom) and measure the improvement.
  5. Write a one-page review protocol proportionate to how these notes would be used.

The runnable notebook and worked solution will be published soon. You can work through the steps with the code on this page in the meantime.

Key takeaways

  • Hallucinations and omissions both occur in good systems; omissions are easier to miss.
  • Measure errors per sentence and per document, with severity.
  • Simple automated checks catch some errors and miss negations and paraphrases.
  • Ground outputs in sources, check citations, and match human review to risk.

Terms used: Grounding, Hallucination, RAG (retrieval-augmented generation)

Related: Summarisation and ambient clinical documentation, RAG track, Prompting for clinical tasks

FAQ

How often do LLMs hallucinate in clinical notes?

It depends on the system and task. In one large evaluation of AI-generated clinical notes, clinicians found unsupported content in 1.47% of sentences and omissions at 3.45%; a substantial share were rated potentially harmful.

Does retrieval-augmented generation stop hallucinations?

It reduces reliance on the model's memory by supplying trusted passages, but the model can still misstate them, and the retrieved passages can be wrong or outdated.

Are citations proof that an answer is correct?

No. Models can attach citations to statements the source does not support. Citations make checking possible; they still need to be checked.

Can another AI model check for hallucinations?

A second model can verify claims against the source and catch many errors, but it can miss subtle ones and agree with the first model's mistakes. Use it to prioritise human review, not replace it.

Who is responsible for errors in an AI-drafted note?

In general, the clinician who reviews and signs the note remains responsible for its content, which is why review processes and clear labelling matter.

Educational content only. This material teaches methods; it is not clinical advice. Code, models and examples here are not validated medical devices and must not be used to make decisions about real patients without proper clinical validation, governance and any required regulatory approval. Examples use synthetic or openly licensed de-identified data only. Never paste identifiable patient information into public AI tools. Mentions of models, tools or vendors are for identification, not endorsement.