MERLIN-DDxLearning Clinical Diagnostic Reasoning from Reference-Filtered Traces
Findings of EACL 2027
1Berliner Hochschule für Technik 2Charité – Universitätsmedizin Berlin 3Justus Liebig Universität Gießen
*Equal contribution †Project lead
Illustrative textbook case, not a MIMIC-IV admission.
Abstract
Large language models reason step by step in mathematics and code, but in clinical differential diagnosis (DDx) they still map notes straight to answers. One reason is that the supervision needed to teach clinical reasoning is largely missing, because clinical notes record conclusions rather than the reasoning traces behind them. We present a four-stage generator–verifier pipeline that builds this supervision. It generates diagnostic reasoning traces over real hospital admissions and checks the structured answer of every intermediate step against an external clinical reference (WikiDoc) and the recorded patient outcome (MIMIC-IV). The result is MERLIN-DDx, a dataset of 124,510 stage records over 10,400 admissions whose discharge diagnosis WikiDoc covers, of which 117,580 carry a verifier score; clinicians confirm the reference diagnosis in 77% of reviewed cases (inter-rater κ = 0.91).
We evaluate two admission-time tasks, differential diagnosis and ICD coding, predicting discharge codes from what was known on arrival. This is harder than coding finished discharge summaries, and closer to real decision support. Fine-tuning Qwen3 models (0.6B–32B) on MERLIN-DDx improves long-tail ICD performance (macro-F1) over the untuned base at every scale. Case-matched label-only controls, trained on the same cases and gold codes without traces, isolate what the traces add: 1.7 to 6.9 macro-F1 points at every scale, though not consistently on micro-F1. A data ablation at 8B shows macro-F1 rising with verifier-filter strictness, although stricter filtering retains fewer traces. An error analysis shows the gain reaches every frequency stratum and is especially large on low-frequency codes, which are improved but not solved. We release the dataset, pipeline, and prompts.
The pipeline
| Stage | Task | Reference target | Verifier | Accept at |
|---|---|---|---|---|
| V1 | Symptom extraction | WikiDoc symptom list for the confirmed disease | NormDot | ≥ 0.60 |
| V2 | Diagnosis ranking | WikiDoc differential for the chief complaint | Reciprocal rank | ≥ 0.50 |
| V3 | Lab-informed reranking (labs ≤ 12 h) | as V2 | Reciprocal rank | ≥ 0.80 |
| V4 | Discharge ICD-code prediction | MIMIC-IV discharge codes | micro-F1 | ≥ 0.55 |
Generators: Qwen3-32B, MedGemma-27B and Llama-3.3-70B-Instruct, 30 candidates per round, up to 4 rounds per stage.
What the verifier checks. The verifiers measure agreement with a reference target, not whether the reasoning is correct. A blinded clinician audit finds that the verifier loop does not improve clinician-rated rationale validity. Read "accepted trace" as "reference-filtered", not "verified".
Results
| Diagnosis ranking | ICD codes | |||||
|---|---|---|---|---|---|---|
| Model | R@1 | R@3 | F1mic | F1mac | Rmac | Pmac |
| Untuned baselines | ||||||
| MedGemma-27B | 51.8±0.2 | 74.5±0.3 | 29.4±0.2 | 7.6±0.1 | 9.1±0.3 | 11.8±0.3 |
| Llama-3.3-70B-Instruct | 51.1±0.5 | 72.5±0.6 | 29.7±0.6 | 11.8±0.7 | 14.4±0.5 | 18.0±0.4 |
| Baichuan-M2-32B | 49.6±0.3 | 71.8±0.7 | 32.4±1.1 | 11.1±0.9 | 14.8±1.1 | 13.2±1.0 |
| Qwen3 base and fine-tuned | ||||||
| Qwen3-0.6B | 34.2±0.3 | 52.9±0.4 | 1.2±0.1 | 0.1±0.0 | 0.1±0.0 | 0.4±0.0 |
| + label-only† | 11.4±2.9 | 13.5±3.3 | 33.4±0.3 | 3.5±0.0 | 3.6±0.1 | 4.7±0.4 |
| + MERLIN | 51.0±0.5 | 73.1±0.7 | 43.6±0.7 | 10.4±0.4 | 10.4±0.4 | 12.5±0.6 |
| Qwen3-8B | 45.5±0.5 | 66.6±0.5 | 19.7±0.1 | 5.0±0.1 | 4.9±0.2 | 9.1±0.2 |
| + label-only†* | 51.2±1.4 | 68.7±1.3 | 44.1±0.6 | 11.3±0.1 | 10.9±0.1 | 14.6±0.1 |
| + MERLIN* | 53.9±0.5 | 76.3±0.4 | 39.8±4.2 | 13.0±1.3 | 13.3±0.9 | 17.8±0.9 |
| Qwen3-14B | 49.0±0.1 | 68.9±0.3 | 30.7±0.3 | 11.2±0.2 | 14.0±0.3 | 14.6±0.3 |
| + label-only† | 50.5±2.2 | 65.3±2.4 | 47.0±0.3 | 14.5±0.1 | 14.9±0.2 | 17.6±0.4 |
| + MERLIN | 46.6±1.3 | 68.7±4.7 | 48.8±0.5 | 18.2±0.6 | 17.9±0.8 | 21.5±0.7 |
| Qwen3-32B | 50.5±0.7 | 70.3±0.2 | 33.6±0.1 | 13.1±0.4 | 16.2±0.6 | 15.9±0.6 |
| + label-only† | 27.9±5.6 | 40.4±8.2 | 47.3±0.5 | 16.6±0.5 | 17.1±0.3 | 19.7±0.8 |
| + MERLIN | 36.0±1.5 | 76.8±1.5 | 50.7±0.2 | 20.9±0.3 | 20.9±0.5 | 23.6±0.1 |
| Encoder classifier | ||||||
| BioClinical ModernBERT‡ | – | – | 26.4±0.8 | 8.2±0.1 | 13.8±2.3 | 7.0±0.7 |
Held-out test split (n = 2,184), admission-time protocol: no lab values, no reranking, dev-selected best epoch. F1mac over three-character ICD codes is the primary metric. Bold best, underline second best. ± is std over three evaluation repeats of one checkpoint; * rows are over three training seeds. †Label-only control: same cases, instructions, gold outputs and ICD-row oversampling, traces removed; at 0.6B and 32B it produces valid diagnosis-stage JSON for only about 21% and 46% of cases, which lowers its R@1/R@3. ‡Strongest of three encoder classifiers retrained on our MIMIC-IV subset; ± over three training seeds.
Release
- Code, prompts and splits: DATEXIS/merlin (MIT). The aggregate result tables there reproduce every figure and table without MIMIC-IV access.
- Dataset (MIMIC-IV-Ext-MERLIN-DDx): PhysioNet, credentialed access under the PhysioNet Credentialed Health Data License 1.5.0, available on publication.
- Clinician studies: annotation interface, protocol, rubric and analysis at DATEXIS/merlin-ddx-annotator.
MERLIN-DDx is a research resource, not a diagnostic tool. It must not inform clinical decisions without prospective validation and regulatory review.
Citation
@misc{frick2026merlinddx,
title = {{MERLIN-DDx}: Learning Clinical Diagnostic Reasoning from Reference-Filtered Traces},
author = {Frick, Jan and Fast, Dennis and Fallon, Conor and Schl{\"u}ter, Konstantin and Neusch{\"a}fer, Roseli and Cittadino, Jonas Antonio and Gers, Felix and L{\"o}ser, Alexander},
year = {2026},
eprint = {2611.37309},
archivePrefix = {arXiv},
primaryClass = {cs.CL},
note = {Findings of EACL 2027}
}