A 1.5B-parameter model fine-tuned to produce a ranked differential diagnosis (most likely first, with probabilities) given a clinical case description. Runs comfortably on CPU.
release_evidences.json mapping.| Metric | Zero-shot base model | This fine-tune |
|---|---|---|
| Top-1 accuracy | 12.4% | 75.2% |
| Top-3 accuracy | 15.7% | 93.6% |
| Top-5 accuracy | 18.5% | 97.2% |
| Top-10 accuracy | 23.2% | 98.3% |
| nDCG@10 | 0.140 | 0.952 |
Top-k accuracy = the fraction of cases where the ground-truth PATHOLOGY appears within the first k entries of the generated ranked list (AMIE's evaluation protocol).
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "saurabhb2412/qwen2.5-1.5b-ddx-ranker"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, dtype=torch.bfloat16, device_map="cpu")
case = """Patient case: 49-year-old female.
Findings:
- Chest pain (present)
- Chest pain character: sharp
- History of gastroesophageal reflux disease (present)"""
system = ("You are a clinical decision support assistant. Given a patient case, produce a ranked "
"differential diagnosis. List the most likely diagnoses first, one per line, in the exact "
"format 'N. Diagnosis (p=probability)'. Include up to 10 diagnoses.")
messages = [{"role": "system", "content": system}, {"role": "user", "content": case}]
inputs = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
out = model.generate(inputs, max_new_tokens=300, do_sample=False)
print(tok.decode(out[0][inputs.shape[1]:], skip_special_tokens=True))
# 1. GERD (p=0.18)
# 2. Bronchitis (p=0.20)
# ...
On a modern CPU the 1.5B model generates a full ranked list in a few seconds.
@article{mcduff2025towards,
title = {Towards accurate differential diagnosis with large language models},
author = {McDuff, Daniel and others},
journal = {Nature},
year = {2025},
doi = {10.1038/s41586-025-08869-4},
note = {arXiv:2312.00164}
}
Have the files? Publish a torrent.
Publish a torrentmodel.safetensors 3.1 GBtraining_args.bin 5.8 kB