MedReason
is a large-scale high-quality medical reasoning dataset designed to enable faithful and explainable medical problem-solving in large language models (LLMs).
We utilize a structured medical knowledge graph (KG) to convert clinical QA pairs into logical chains of reasoning, or “thinking paths”.
Our pipeline generates detailed reasoning for various medical questions from 7 medical datasets, resulting in a dataset of
32,682
question-answer pairs, each with detailed, step-by-step explanations.
Deploy
: we provide a example code for direct inference with MedReason-8B.
Also, MedReason-8B can be deployed with tools like
vllm
or
Sglang
, we provide code for model deployment using Sglang in
./src/evaluation/eval.py
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained('UCSC-VLAA/MedReason-8B',torch_dtype="auto",device_map="auto", use_safetensors= True)
model.eval()
tokenizer = AutoTokenizer.from_pretrained('UCSC-VLAA/MedReason-8B', trust_remote_code=True, padding_side='left')
input_text = "How to stop a cough?"
messages = [{"role": "user", "content": input_text}]
inputs = tokenizer(tokenizer.apply_chat_template(messages, tokenize=False,add_generation_prompt=True), return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=2048)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
🙏🏼 Acknowledgement
We gratefully acknowledge the inspiring work of
HuatuoGPT-o1
, which laid important groundwork for this research. We also thank the developers of the excellent tools
curator
,
trl
, and
sglang
for making this work possible.
📖 Citation
@misc{wu2025medreasonelicitingfactualmedical,
title={MedReason: Eliciting Factual Medical Reasoning Steps in LLMs via Knowledge Graphs},
author={Juncheng Wu and Wenlong Deng and Xingxuan Li and Sheng Liu and Taomian Mi and Yifan Peng and Ziyang Xu and Yi Liu and Hyunjin Cho and Chang-In Choi and Yihan Cao and Hui Ren and Xiang Li and Xiaoxiao Li and Yuyin Zhou},
year={2025},
eprint={2504.00993},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2504.00993},
}
Runs of UCSC-VLAA MedReason-Llama on huggingface.co
0
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs
More Information About MedReason-Llama huggingface.co Model
MedReason-Llama huggingface.co is an AI model on huggingface.co that provides MedReason-Llama's model effect (), which can be used instantly with this UCSC-VLAA MedReason-Llama model. huggingface.co supports a free trial of the MedReason-Llama model, and also provides paid use of the MedReason-Llama. Support call MedReason-Llama model through api, including Node.js, Python, http.
MedReason-Llama huggingface.co is an online trial and call api platform, which integrates MedReason-Llama's modeling effects, including api services, and provides a free online trial of MedReason-Llama, you can try MedReason-Llama online for free by clicking the link below.
UCSC-VLAA MedReason-Llama online free url in huggingface.co:
MedReason-Llama is an open source model from GitHub that offers a free installation service, and any user can find MedReason-Llama on GitHub to install. At the same time, huggingface.co provides the effect of MedReason-Llama install, users can directly use MedReason-Llama installed effect in huggingface.co for debugging and trial. It also supports api for free installation.