r/clinicalinformatics • u/Fearless-Banana-6964 • 10h ago
A production miss in my PubMed-grounded tool: literal keyword retrieval walked past preeclampsia. What actually fixed it wasn't the model.
Third time posting about this project here — after the Ontario scribe-audit thread and the eval-bench re-run. This one's a specific production miss and the two fixes that came out of it, because the failure was more instructive than any benchmark I've run.
A real user typed one line into the tool: "mother presents with proteinuria, headache and lower bp."
The system confidently returned a differential led by ACE-inhibitor side effects. It missed the one thing you can't miss there: preeclampsia.
(Yes, "lower bp" is clinically backwards — preeclampsia is defined by HIGH bp, at least 140/90 with proteinuria. That line is verbatim from the production log. Real users type things that are ambiguous and partly wrong. That ambiguity is the whole point — a literal keyword match took "lower bp" at face value and let go of the pattern that proteinuria + headache in a pregnant woman should never let go of.)
Not a hallucinated citation. Every reference was a real, verifiable PubMed paper. The failure was upstream, in retrieval: one literal search built from the symptom string latched onto "proteinuria + headache + low BP" and pulled drug-side-effect papers. The lethal hypothesis was never even searched for. A confident, well-cited, wrong answer — worse than an obvious error because nothing about it looks wrong.
Two fixes:
A pre-LLM red-flag gate (clinical design worked out with an IM physician). Triggers (passive pattern detection in the free text) and gate questions (findings the clinician has to actively confirm) are kept disjoint — that's what defeats alert fatigue. Answers live on a 2D matrix, not a single confidence score: "unknown" (never assessed) halts synthesis; "not performed" (a deliberate triage decision) proceeds but injects a stark [CLINICAL BLINDSPOT: ... DO NOT DISCHARGE] line rather than a filtered-out banner. Preeclampsia is now one of the patterns.
Differential-first retrieval. Instead of one combined symptom query, generate the differential first, then run a separate PubMed search per hypothesis in parallel and merge. Each candidate diagnosis gets its own literature, so the lethal one can't be crowded out by a keyword match.
The humbling part was measuring it. Our eval cases weren't written in the language real users actually type, and that path quietly skipped the exact differential step we'd just rebuilt — so we'd have "validated" a fix the test never exercised. Rebuilt the bench on the real user path, added the failing cases. Honest numbers on that bench: 100% citation validity (0 fabricated PMIDs), ~80% relevance (not high enough yet), 97% diagnosis match, and the preeclampsia case now resolves correctly.
Deliberately narrow: the gate is a safety net for a handful of can't-miss diagnoses, not a diagnostic engine. Covering every diagnosis would both fail clinically and push it into regulated-medical-device territory (MHRA class 2+, FDA SaMD). It stays a research/education evidence tool.
Questions for this sub:
For anyone running clinical NLP in production — how are you handling the eval-vs-production language/phrasing gap? Our bench was textbook-clean; the real miss came from a messy, self-contradictory input the bench never contained.
The HALT-on-unknown behavior: is refusing to synthesize until a specific finding is confirmed realistic in a real workflow, or does it just get abandoned like every other hard-stop? Genuinely unsure.
Per-claim / per-hypothesis retrieval traceability — is anyone asking for this in vendor eval yet, or still academic?
The red-flag pattern dictionary is going open source. I work on the tool (medevidence.pro) — linking the full write-up once as the concrete example: medevidence.pro/go/reddit?c=post-prod-miss. Happy to drop the link if it reads as self-promo for the sub; the architecture questions stand without it.