Dinesh/ Blog
machine learning

Reading MEDEC — detection, localization and correction are different tests

Audit the MEDEC benchmark's data construction, exact reported scores, prompt format and metric limitations without treating a clinical NLP benchmark as deployment validation.

18 min readChecking device speech…

In this article

  • Distinguish note-level detection, sentence localization and supported correction
  • Reconcile MEDEC dataset counts and read reported results with their denominators
  • Identify conditional generation scoring and reference-matching limitations
  • Design a safe offline evaluation without inferring clinical approval
Background & source details

Level: intermediate

Language model engineering · Lesson 25 of 26 ↗
Loading this browser’s progress…

Bring with you

Sources checked: . A source check does not change the publication or update date.

Editorial review: · What review means

In this article · 21 sections

Paper reading

A clinical note can sound plausible while containing an error. Reading MEDEC requires separating three questions: can a model flag a problem, locate it, and propose a correction that is supported? Those are different outcomes, with different failure costs and evaluation denominators.

This is a technical benchmark-reading lesson, not medical advice or a clinically validated decision-support system. It contains no patient-specific recommendations. The previous page's approximate model table and purported prompting gains were not reliable evidence; they are replaced below with values and definitions checked against the MEDEC paper's v1 HTML snapshot, rechecked 8 October 2026. These are reported results, not experiments rerun here. The retrieved URL is explicitly 2412.19260v1; its rendered HTML displays24August2026. The versioned URL, displayed date and capture time are recorded separately rather than silently treating the HTML as an unchanged2024 publication.

Plan to Read the Paper

Read in this order and keep a claim ledger rather than highlighting impressive numbers:

  1. §3, data: What is a clinical text here? Which sources are real notes, which are exam-derived scenarios, and how are errors introduced?
  2. §4, task and prompts: What output is required? Does the evaluation ask for a flag, a sentence ID, a correction, or all three?
  3. §5.2, metrics: Which examples enter each score? What happens when a system fails to generate a correction?
  4. §5.3 and Tables 2–4, comparison: Which models, prompts and subsets are being compared? How much of the test set did human reviewers annotate?
  5. §5.4 and §7, interpretation: Which conclusions follow, which are hypotheses, and which limits prevent a deployment inference?

A generated audio discussion can help with vocabulary, but it is not an independent source confirming a paper. The old private NotebookLM/Drive links and generated TODO plan are not prerequisites or proof of completed reading. No private audio was accessed for this revision.

Background & Prerequisites — what matters for this benchmark

1. Clinical Notes & Electronic Health Records (EHR)

Clinical notes document patient encounters, reasoning, findings and plans. Structure varies by note type and institution; SOAP is one format, not a universal schema. Errors can concern an assertion, temporal relationship, omitted condition or carried-forward content. A system that sees only one text fragment may lack the chart context needed to resolve an apparent contradiction.

The previous generic “80% copied text” statistic and “third leading cause of death” statement are removed. They were neither necessary to explain MEDEC nor adequate evidence for the causal harm of the specific note errors in this dataset. Treating every inconsistency as a clinically significant error would itself need validation.

2. NLP in Healthcare — Fundamentals

Entity recognition identifies mentions such as medications or conditions; relation extraction connects them; negation and temporality distinguish “present,” “ruled out,” and “history of.” A terminology system can help normalize synonyms, but a valid code or recognized term does not establish that the assertion is correct for this patient.

The MEDEC paper uses UMLS concepts and QuickUMLS to identify candidate spans in its UW construction method. This is part of dataset preparation, not evidence that the evaluated LLMs all implement the same terminology pipeline. Annotation and adjudication are also separate from automatic scoring.

Clinical data access needs a lawful, institutionally approved basis and appropriate security. The earlier statement “HIPAA requires de-identification before research use” was too broad. In the cited 2025 CFR edition, §164.512(i) provides a research-use/disclosure route subject to documented IRB/privacy-board waiver and specified conditions. That dated provision is not a determination of the rules currently applicable to a particular project, or permission to upload notes to a public model. Obtain institution-specific privacy/legal review; dataset agreements can impose requirements beyond a general legal summary. The UW subset explicitly requires a data-use agreement.

3. LLMs for Medical Applications

Medical examination question answering, summarization, identifying a wrong sentence and proposing a safe edit are different tasks. A strong exam score does not establish accuracy on real documentation. Specialized medical training does not automatically solve this benchmark, and the paper's introductory evaluation focuses on open-domain LLMs rather than supplying the broad medical-model leaderboard the old article guessed at.

Do not reproduce estimated private-model parameter counts as disclosed architecture facts. The paper itself qualifies several counts as estimates; they are unnecessary for interpreting the task results. Keep model names/snapshots and prompt settings where reported, without converting marketing labels into clinical evidence.

Medical-model orientation: different training does not mean the same task

The original prerequisite list named several medical models without separating their objectives. Keep the families distinct:

  • Med-PaLM/Med-PaLM2: the2023 Med-PaLM2 paper studies medical QA and physician evaluation of long-form answers, using a PaLM2 base, medical fine-tuning and prompting. Its reported MedQA performance is not a MEDEC correction score or clinical authorization.
  • PMC-LLaMA: the captured updated paper describes knowledge injection using biomedical papers and textbooks plus domain instruction tuning; reducing it to “LLaMA fine-tuned on PMC” omits that recipe/version distinction.
  • BioMistral: the2024 paper describes a Mistral-based model further pretrained on PubMed Central and evaluated on medical QA tasks, including automatically translated benchmark variants. Translation is not independent native-language clinical validation.
  • MedAlpaca: instruction-tuned medical conversational models explore question answering; an instruction collection and conversational output format are not prospective patient-care evidence.
  • Clinical-T5: domain adaptation of an encoder–decoder language model illustrates a different architecture/training route; model size or clinical pretraining alone does not establish safe error correction.
  • General models in MEDEC: the paper evaluates named snapshots including Claude3.5Sonnet(2024-10-22), o1-preview/o1-mini(2024-09-12), GPT variants and Gemini2.0Flash. Its private-model parameter estimates are not disclosures. These are historical experiment identities, not a list of today's best medical assistants.

Zero-shot supplies a task without demonstrations; few-shot supplies examples; a reasoning prompt requests intermediate explanation. They can change output style and measured performance in either direction. A rationale can be wrong or unfaithful, and the MEDEC two-prompt comparison does not isolate a universal chain-of-thought benefit. Keep errors in the generated correction itself as an explicit outcome.

Clinical vocabulary also has separate jobs: SNOMED CT represents clinical concepts, ICD diagnosis codes support coding/classification, RxNorm normalizes medication names and UMLS integrates terminology resources. A recognized code does not establish that a statement is true for a particular patient. Annotation requires expertise and adjudication; record disagreement rather than declaring all complex cases low-agreement by default. SOAP stands for Subjective, Objective, Assessment and Plan, one note structure among admission, progress, discharge, operative, radiology and pathology formats. Ambiguous abbreviations and time/negation changes are reasons to preserve surrounding context, not auto-expand or overwrite notes.

4. Error Detection vs Error Correction

The paper's §4 separates:

  • A, error flag: 0 for no error, 1 for an error.
  • B, error sentence: sentence ID if an error is found; −1 for no error.
  • C, correction: corrected sentence for an erroneous text; NA for no error.

A correct flag can accompany the wrong sentence ID. A correct ID can accompany a harmful replacement. A well-formed output can fail all three. MEDEC's localization task is sentence identification, not automatically token-level span extraction or a general sequence-labelling task.

For an intentionally nonclinical analogy, imagine a travel record whose first sentence says “the departure was Monday” and a later summary says “the departure was Tuesday.” A system can flag a conflict without knowing which is correct. Location is not correction evidence. Clinical cases are harder because resolving a contradiction may require domain knowledge or missing chart context; the analogy does not authorize changing a medical record.

MEDEC Benchmark — what the source reports

The Benchmark Itself

The paper describes 3,848 clinical texts with five error categories: Diagnosis, Management, Pharmacotherapy, Treatment and Causal Organism. Each text is correct or contains one constructed error. This is not a prevalence estimate for naturally occurring errors in routine hospital notes.

Two creation methods matter:

  • MS method: medical annotators use MedQA exam narratives and answers to create correct and incorrect scenario texts, checking the rewritten text. The MS subset is not “real MS hospital notes.”
  • UW method: 488 diagnosis-support notes are selected from three University of Washington hospital systems. Annotators introduce errors into 244 notes, using candidate concepts and requiring an error to contradict at least two other parts of the note. The paper describes automatic de-identification followed by independent manual review and adjudication. UW access requires a DUA; the MS subset is public.

Table 1 gives these counts:

CollectionTrainValidationTestTotal
MS2,1895745973,360
UW0160328488
Combined2,1897349253,848

The test set contains 475 texts with errors and 450 without, approximately 51.35% versus 48.65%. The error-type counts in Table 4's caption are diagnosis 174, management 168, treatment 58, pharmacotherapy 57 and causal organism 18; these sum to 475. They are uneven sample sizes, so an error-type comparison requires care, especially for the smallest category.

The authors call MEDEC the first public benchmark of this kind. That is an attributed novelty claim, not an independently exhaustive historical search by this lesson. Likewise, their account of previously unseen UW notes is a provenance assertion, not proof that this review audited every model's training corpus.

5. Benchmark Design (MEDEC)

Three limits follow directly from construction. First, one-error-or-correct texts do not cover notes with multiple interacting errors or omissions. Second, an annotator-injected contradiction may be easier or harder to identify than a naturally occurring documentation failure. Third, a model's apparent strength on exam-derived scenarios may not transfer to private clinical notes. Read the MS/UW breakdown rather than only the pooled result.

The appropriate experiment is not “which system has the highest medical intelligence?” It is “under this input/output protocol, on these examples, using these scores, what behaviour is observed?” Keep the distinction when discussing the paper's conclusions.

Prompting Strategy Used in the Paper

P#1 asks the model to check sentence-numbered text and return CORRECT for a correct text, or the erroneous sentence ID followed by a corrected sentence. P#2 is similar but adds an input/output example selected from the training set. The paper says some models needed minimal formatting post-processing.

The previous article's three-field JSON object was not the prompt format shown in §4. JSON is one possible engineering interface, not the paper's proven mechanism and not a test of medical correctness. Nor is P#2 a controlled chain-of-thought ablation: the old assertion of a universal 3–8-point reasoning-prompt gain is not supported.

Models Evaluated (Headline Findings)

These selected rows are transcribed from Table 2, using its displayed four-decimal values. “Aggregate” is the paper's text-generation metric, not percent clinically correct. P#2 rows are explicitly marked; unmarked rows use the paper's default prompt setting.

SystemFlag accuracySentence accuracyCorrection aggregate
Claude 3.5 Sonnet0.70160.65620.2795
Claude 3.5 Sonnet, P#20.68000.65080.2818
o1-mini0.69080.59680.6191
o1-preview0.67460.61400.6976
GPT-40.65730.55680.5751
GPT-4, P#20.65190.57730.6387
Doctor #10.79610.65880.4527
Doctor #20.71610.66770.7118

Denominator warning: §5.3 says the two doctors annotated 569 notes from the full 925-text test set. Their table entries must not be presented as a same-denominator 925-note head-to-head replication. This review did not rerun predictions or reconstruct a matched-case comparison.

Several conclusions are narrower than the old draft claimed:

  • Claude's displayed flag score exceeds o1-preview's, but o1-preview has a much higher correction aggregate. Classification and text-generation rankings differ.
  • For GPT-4, P#2's displayed aggregate increases by 0.0636, while flag accuracy decreases by 0.0054. One prompt intervention can move different metrics in opposite directions.
  • Table 4 does not support the simple claim that pharmacotherapy is universally hardest. For o1-preview, management has a lower displayed correction aggregate than pharmacotherapy; category size, model and metric matter.
  • Table 3 reports o1-preview flag accuracy 0.7286 on MS and 0.5762 on UW. The 0.1524 difference is a source/subset observation, not an isolated causal estimate of training contamination or domain shift.

What the correction aggregate measures

§5.2 defines the aggregate as the mean of ROUGE-1, BLEURT-20 and BERTScore. It says correction scores are computed when both reference and system corrections are provided, other than NA. That conditioning matters: a system can miss errors and still score well on the subset for which it emits a correction. Report the included denominator before comparing aggregates as end-to-end performance.

Lexical overlap and learned similarity can also penalize acceptable synonyms or reward superficially similar but incorrect replacements. §5.4 gives examples of synonym and verbosity effects. The fact that Doctor #1 has a lower displayed aggregate than several LLMs does not prove those LLMs are clinically safer.

A source can contain a numerical inconsistency. Table 2's GPT-4o row displays components 0.5517, 0.5373 and 0.5852 but an aggregate 0.4682; their arithmetic mean is about 0.5581. This lesson flags the mismatch rather than silently substituting a recalculated value as an official corrected result. Resolving it would require the authors' evaluation outputs or an erratum. The selected comparison table above avoids that disputed aggregate.

from math import isclose
 
assert 2189 + 574 + 597 == 3360
assert 160 + 328 == 488
assert 3360 + 488 == 3848
assert 597 + 328 == 925 and 475 + 450 == 925
assert 174 + 168 + 58 + 57 + 18 == 475
assert isclose(0.6387 - 0.5751, 0.0636)
assert isclose(0.6519 - 0.6573, -0.0054)
assert isclose(0.7286 - 0.5762, 0.1524)
recomputed = sum([0.5517, 0.5373, 0.5852]) / 3
assert abs(recomputed - 0.4682) > 0.08
print('test error prevalence:', 475 / 925)
print('GPT-4o displayed component mean:', recomputed,
      'source displayed aggregate:', 0.4682)
 
# Synthetic classification counts, not MEDEC model results.
tp, fn, fp, tn = 90, 10, 90, 810
precision = tp / (tp + fp)
recall = tp / (tp + fn)
accuracy = (tp + tn) / (tp + fn + fp + tn)
assert precision == .5 and recall == .9 and accuracy == .9
print('synthetic precision/recall/accuracy:', precision, recall, accuracy)

The synthetic example shows why high error recall can coexist with many false alerts: half of the positive alerts are wrong despite 90% recall and 90% accuracy. It is not a model evaluation and cannot establish a safe alert threshold.

6. Ethical Considerations

An evaluation protocol should count missed errors, false alerts on correct notes, wrong localization, unsupported edits, new errors introduced by edits and abstentions. Also measure reviewer burden and whether users over-trust fluent suggestions. Review subgroup and institution/note-type performance where sample sizes support meaningful comparisons.

Use approved data-access routes and prohibit unapproved transmission of clinical text. A de-identification tool alone is not a guarantee that every identifier is gone; the paper itself describes manual review. Retain only necessary diagnostic data under the applicable agreement and retention policy.

Regulatory classification depends on intended use and jurisdiction. This benchmark paper does not establish FDA authorization, an EU conformity assessment or a general classification for every medical-AI application. Those earlier blanket claims are replaced with a requirement for appropriate clinical, legal and privacy review before any deployment decision.

Clinical Implications

A reviewer-assistance workflow is a hypothesis to evaluate, not a result established by a benchmark score. Keep the original note intact, show the proposed span/change and supporting evidence, allow rejection or abstention, and evaluate the combined clinician–tool process. Human involvement alone does not make an incorrect system safe: alert burden and automation bias also require investigation.

A defensible next study would define the intended user, institution, note type and action; obtain approved data access; assess retrospective matched cases; and then evaluate the prospective workflow with independent safety oversight. This lesson offers no implementation for changing real notes and no treatment recommendation.

Questions to Know After Completing the Paper

  1. Why does medical QA performance fail to answer the MEDEC evaluation question?
  2. How do the MS and UW construction methods differ?
  3. Why is sentence localization not the same as generating a safe correction?
  4. What makes the correction aggregate conditional, and what denominator would you request?
  5. Does P#2 uniformly improve GPT-4's displayed scores?
  6. Can a valid JSON object catch a medically false correction by itself?
  7. What does the GPT-4o aggregate inconsistency permit us to conclude?
  8. What further evidence would a proposed clinical workflow need?
Answers and reasoning
  1. QA asks for an answer; this task asks a system to validate and edit existing text, including correctly leaving correct text alone. The error distribution and output contract differ.
  2. MS is built from exam narratives/answers; UW uses selected real clinical notes with annotator-injected errors and a DUA requirement. Neither is a random sample of all naturally occurring documentation errors.
  3. The identified sentence can be replaced with another false statement. Correction requires supported content, not merely an address.
  4. The paper scores generated corrections when both reference and system corrections are non-NA. Request the count and identity of included examples and the detection/abstention outcomes excluded from that score.
  5. No. Its displayed aggregate increases, flag accuracy decreases, and sentence accuracy increases. Do not call this a general reasoning-prompt gain.
  6. No. It enforces a parseable structure, not factual or clinical validity.
  7. The displayed components do not average to the displayed aggregate. It does not identify which source number or evaluation step is wrong; report the discrepancy rather than inventing an erratum.
  8. Intended-use and population definition, authorized representative data, matched evaluation, subgroup/error-severity analysis, prospective workflow assessment, privacy/security controls and appropriate clinical/regulatory oversight.

What I Learned

The most important reading habit is to connect every number to its task, subset and denominator. A ranking can reverse between detection and generation metrics. A source's “aggregate score” is not necessarily the outcome a clinician cares about, and a source's own arithmetic deserves checking. A generated summary should not replace reading the data construction and evaluation protocol.

Remaining research questions

The article now supplies the benchmark construction, exact selected result rows, actual prompts, metric definitions and limitations that the earlier TODO list deferred. It does not reproduce model inference, adjudicate individual clinical corrections, listen to private generated audio, or resolve the source's GPT-4o aggregate discrepancy. The concise model-family comparison above covers the original medical-model orientation without claiming a new leaderboard. Jurisdiction-specific deployment approval remains an intended-use question; no unsupported legal conclusion substitutes for it.

Offline evaluation recipe without patient-data execution

For an authorized future evaluation, freeze the data-use agreement and allowed subset, model snapshot, exact P#1/P#2 text, decoding settings and output parser before inference. Keep the source note immutable. Parse CORRECT separately from sentence-ID/correction output; count malformed outputs and abstentions explicitly rather than dropping them. Compute flag/sentence outcomes on the declared full population, then disclose the identities/count of non-NA pairs used for generation metrics. Have qualified adjudicators review newly introduced errors and clinically acceptable synonyms under a written rubric. Compare models and humans only on matched cases if making a head-to-head claim.

A small nonclinical negative control illustrates the denominator trap: systemA corrects9 of10 emitted edits but emits on only10 of100 erroneous records; systemB corrects60 of80 edits. Conditional edit correctness is.9 versus.75, while successful edits per erroneous record are.09 versus.60. Neither quantity alone measures false edits on originally correct records. Those need a third count. This is arithmetic, not clinical scoring or model inference.

Sources and verification boundary

Only dataset-count arithmetic, displayed-score arithmetic and synthetic metric calculations were executed. No patient data, medical model, clinical validation, private audio, cloud service or prospective deployment was run.

Pause / Recall / Apply

Can you explain it without the page?

Close the example. Reconstruct the core idea, then change one assumption. Mark complete when you’re ready; you can always undo it.

Stored in this browser only. No account, no sync. Clearing browser data removes your record.