Evaluation Methodology#

This page is published from the blueprint’s source repository. Code paths mentioned here refer to files in that repository — see Clinical Diagnostic Assistant on GitHub to browse them.

This document explains why this blueprint ships an evaluation harness, what the benchmark dataset actually is, and how each metric is computed — including where a human domain expert’s judgment is the ground truth and where an LLM acts as judge. For how to run an evaluation or deploy the harness, see the pointers in Related docs below; this page is about methodology, not operation.

Motivation#

A clinical differential-diagnosis assistant makes a claim about its own usefulness that can’t be taken on faith: that its output is actually good. “Transparent and inspectable” is one of this blueprint’s stated design goals (see the main README) — every pipeline stage’s intermediate output can be traced, and the same principle extends to quality itself. Rather than asserting the pipeline works well, this blueprint ships:

  • A small, domain-expert-labeled benchmark of real clinical notes with reference answers, so quality can be measured against a human clinician’s judgment rather than an LLM’s own opinion of itself.

  • A repeatable, automated scoring run (not manual spot-checking) that produces the same result today as it will after a prompt change, a model swap, or a knowledge-graph update — so regressions are caught, not discovered later.

  • Documented limitations of the benchmark itself (see Known limitations below) — a small reference set is still useful for regression detection, but only if its boundaries are stated plainly instead of implied to be more than they are.

  • Every score traced end-to-end through a self-hosted Langfuse instance, alongside the underlying LLM judge call that produced it, so a reported number is always one click away from the reasoning behind it.

The harness is optional and off by default (evaluator.enabled: false) — it’s a tool for people iterating on the pipeline’s diagnostic accuracy, not a runtime dependency of the pipeline itself.

The dataset#

66 real clinical SOAP notes, each annotated by a domain expert reviewer. The annotated case file is the single source of truth; the per-metric splits and the flattened table used for analysis are derived from it and regenerated, never hand-edited. The dataset and the scripts that build it ship with the blueprint source.

Each case carries:

Field

What it is

Who provides it

input.text

The raw SOAP note

Source data

sufficiency.sufficient

Whether the note has enough information for a reliable differential

Domain expert

sufficiency.soap_quality

1–5 graded note-quality signal

Domain expert

ddx.golden_ddx

The reference differential diagnosis (ranked, ICD-10-coded, with a human-reviewed SNOMED CT CUI where one was approved)

Domain expert

ddx.rubric

1–5 scores on completeness / cleanliness / prioritization, against the note’s own actual differential

Domain expert

review.*

Free-text reviewer commentary (kept for provenance, not scored)

Domain expert

A case doesn’t necessarily carry all of this — ddx is null for sufficiency-only cases that never received a golden differential or rubric scores. The exact JSON shape, the full field-level schema, and the SNOMED CT enrichment process are documented with the dataset in the blueprint source repository.

How cases are routed to metrics#

Each case’s eval_targets flags decide which metric(s) it’s scored on:

Metric task

Routing rule

Cases

Sufficiency classification

Every case

66

DDx precision

Sufficient input and has a golden differential

30

Insufficient-input degradation

Insufficient input and has rubric scores

8

Intake gate visibility is not routed by eval_targets; it runs on every case (see Metrics). The full routing table, including one deliberate edge case (an insufficient-input case that has a golden differential but is intentionally excluded from the precision metric), is documented with the dataset in the blueprint source repository.

Known limitations#

Stated here rather than left implicit, in the same spirit as the transparency goal above:

  • Small-n reference set. 66 cases (30 for DDx precision) — enough for regression detection between runs, not enough for tight statistical confidence. Report results with that in mind.

  • Single annotator, no inter-rater reliability check yet. All expert labels come from one reviewer; no second-reviewer agreement has been measured.

  • Possible train-set contamination for case-report-style inputs that may resemble material an underlying model was trained on.

  • This is a regression / smoke-test suite, not a clinical validation study. It answers “did this change make the pipeline better or worse against a fixed reference,” not “is this pipeline safe or effective for clinical use.”

Metrics#

Every scorer falls into one of two categories, matching the two kinds of ground truth the dataset provides:

Scorer

Type

Applies to

What it measures

Sufficiency classification

Deterministic

All 66 cases

Compares the same sufficiency heuristic the frontend uses against the domain expert’s sufficient label — a plain match/no-match, no LLM involved.

DDx precision

LLM-as-judge

30 cases (sufficient input, golden DDx present)

Scores the pipeline’s predicted differential against the domain expert’s golden differential, on the expert’s own three rubric axes.

Insufficient-input degradation

LLM-as-judge

8 cases (insufficient input, rubric scores present)

Same rubric-judge mechanism and axes as DDx precision, but applied to insufficient-input cases — measures whether the pipeline degrades gracefully rather than confidently hallucinating a differential when the input doesn’t support one.

Intake gate visibility

Deterministic

All 66 cases

Reports the orchestrator’s own intake-gate rejection decision as a rate, plus a calibration check against a small, explicitly-documented set of cases with a known expected gate verdict.

Domain-expert ground truth#

Two of the four metrics (sufficiency classification, intake gate calibration) are pure code — comparing a deterministic pipeline output against a label a human already assigned. No LLM is involved in producing or checking the score, so these numbers are exactly reproducible.

LLM-as-judge, grounded in the domain expert’s own rubric#

The other two metrics (DDx precision, insufficient-input degradation) score something a plain diff can’t: whether a free-text, ranked list of diagnoses is clinically good. For that, the harness uses an LLM judge — but constrained so the judge’s opinion doesn’t drift from the human reviewer’s:

  • The judge is given the exact same rubric the domain expert used to score the golden differentials — three axes (completeness, cleanliness, prioritization), each with worded 1–5 anchors, read directly from the stored rubric into the judge’s prompt so there’s no risk of the prompt drifting from a duplicated copy of the rubric text.

  • The judge is the same self-hosted MedGemma model the orchestrator itself uses in production (not a separate or larger “judge model”) — called at temperature=0.0 and required to return strict JSON matching the rubric’s axes, so runs are as reproducible as an LLM call can be.

  • Every judge call is traced as a Langfuse generation observation (prompt, output, token usage), so any score can be traced back to the exact reasoning behind it.

  • Failure modes are kept distinguishable rather than collapsed into one generic “error”: a failed pipeline call, a scorer’s own routing/precondition failure, and a judge-call failure (bad connection, malformed JSON, missing rubric keys) are each reported under their own named metric suffix in Langfuse, so a spike in judge errors is never mistaken for a spike in genuine quality regressions.