1AI Collaborative Centre, University Health Network, Toronto, Canada 2Princess Margaret Cancer Centre, University Health Network, Toronto, Canada 3Department of Electrical and Computer Engineering, University of Toronto, Toronto, Canada 4Division of Urology, Department of Surgery, St. Michael's Hospital, Unity Health Toronto and University of Toronto, Toronto, Canada 5Peter Munk Cardiac Centre, University Health Network, Toronto, Canada 6Department of Laboratory Medicine and Pathobiology, University of Toronto, Toronto, Canada 7Department of Computer Science, University of Toronto, Toronto, Canada 8Vector Institute for Artificial Intelligence, Toronto, Canada
Highlights
LoRA fine-tuned GPT-OSS 20B for structured radiology differential diagnosis
Trained on 1,894 EuroRad medical cases spanning diverse imaging modalities and specialties
Lightweight adapter (2.27 GB) compatible with 4-bit quantization for on-device deployment
Part of a broader benchmark study comparing on-device LLMs across medical tasks
Model Overview
This model is a LoRA fine-tuned version of unsloth/gpt-oss-20b for medical radiology diagnosis, developed as part of a study benchmarking and adapting on-device large language models for clinical decision support. Trained on EuroRad clinical cases, it generates step-by-step diagnostic reasoning from patient history and imaging findings, mapping symptoms to differentials and converging on a final diagnosis with supporting evidence.
The model employs a systematic diagnostic framework: (1) relating clinical history to imaging findings, (2) mapping findings to each differential, (3) systematic elimination of alternatives, and (4) converging on a final diagnosis with confidence reasoning.
1from unsloth import FastLanguageModel
2from peft import PeftModel
34# Load base model5model, tokenizer = FastLanguageModel.from_pretrained(6 model_name="unsloth/gpt-oss-20b",7 dtype=None,8 max_seq_length=4096,9 load_in_4bit=True,10 full_finetuning=False,11)1213# Load LoRA adapter14model = PeftModel.from_pretrained(15 model,16"wanglab/on-device-LLM-gpt-oss-20b",17 is_trainable=False18)1920# Enable inference mode21FastLanguageModel.for_inference(model)2223# Example inference24prompt ="""You are an expert radiologist demonstrating step-by-step diagnostic reasoning.
2526Case presentation:
27{combined_description}
2829Differential diagnoses to consider:
30{dd_formatted}
3132Generate systematic Chain-of-Thought reasoning that shows how clinicians think through cases:
331. **Connect symptoms to findings**: Link clinical presentation with imaging observations
342. **Map to differentials**: Show how findings support or contradict each differential diagnosis
353. **Systematic elimination**: Explicitly rule out less likely options with reasoning
364. **Converge to answer**: Demonstrate the logical path to the correct diagnosis"""3738inputs = tokenizer(prompt.format(39 combined_description="...",# clinical history + imaging findings40 dd_formatted="Diagnosis A, Diagnosis B, Diagnosis C"41), return_tensors="pt").to("cuda")4243outputs = model.generate(**inputs, max_new_tokens=1024, temperature=0.1)44print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Citation will be updated upon arXiv submission and journal publication.
bibtex
1@article{munim2025ondevice,
2 title={Benchmarking and Adapting On-Device Large Language Models for Clinical Decision Support},
3 author={Munim, Alif and Ma, Jun and Ibrahim, Omar and Abdalla, Alhusain and Yin, Shuolin and Chen, Leo and Wang, Bo},
4 journal={},
5 year={2025}
6}
Limitations
Clinical Validation Required: This model has not been clinically validated and should not be used for actual patient diagnosis
Research Purposes Only: Designed for research in medical AI and diagnostic systems
Not for Clinical Use: Not intended for direct patient care without clinical validation
May reflect biases present in the EuroRad training data
Performance may vary across imaging modalities and medical specialties
Like all LLMs, may generate plausible but incorrect information ("hallucinations")
Contact
For issues and questions, please open a discussion in this repository.
Corresponding author: Bo Wang — bowang@vectorinstitute.ai
Disclaimer: This model is for research purposes only and has not been approved for clinical use. Always consult qualified healthcare professionals for medical decisions.