Model Card for MedCase-R1

Model Details

MedCase-R1 is a fine-tuned version of Qwen3-1.7B designed to enhance clinical and medical reasoning capabilities. The model was trained on 13,000 complex medical cases from the zou-lab/MedCaseReasoning dataset, which includes real-world diagnostic questions requiring step-by-step reasoning, differential diagnosis, and treatment selection. The objective is to create a compact yet competent medical assistant capable of reasoning over clinical scenarios, supporting both research and non-commercial medical education.

Uses

Direct Use

This model is intended for:

  • Medical reasoning research: Assisting in developing and evaluating reasoning capabilities of LLMs in the healthcare domain.
  • Medical education: Supporting students and professionals in learning through structured clinical cases and reflective diagnosis.
  • Clinical decision support (experimental): As a brainstorming tool in academic settings—not for real patient care.

Bias, Risks, and Limitations

  • Not for real-time medical diagnosis or treatment: This model is not approved by regulatory bodies (e.g., FDA, EMA) and should not be used in clinical practice.
  • Hallucination risk: Like other LLMs, it may generate plausible but incorrect or harmful content, especially for rare diseases or edge cases.
  • Bias and generalization: The model may reflect dataset biases and may not generalize well to populations or healthcare systems outside of the dataset's scope.

How to Get Started with the Model

Use the code below to get started with the model.

from huggingface_hub import login
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel

login(token="")  

tokenizer = AutoTokenizer.from_pretrained("unsloth/Qwen3-1.7B",)
base_model = AutoModelForCausalLM.from_pretrained(
    "unsloth/Qwen3-1.7B",
    device_map={"": 0}, token=""
)

model = PeftModel.from_pretrained(base_model,"Rustamshry/MedCase-R1")

question = """
A 23-year-old man presented with a 1-month history of epigastric pain, nausea, postprandial vomiting, anorexia, generalized malaise, and an 11-kg weight loss. He had no prior gastrointestinal disease, abdominal surgeries, or hospitalizations, and was not on medications. On examination, vital signs were stable, and abdominal examination revealed only mild epigastric tenderness without organomegaly or peritoneal signs.
Laboratory tests showed normal hemoglobin, hematocrit, white-cell count, and liver and kidney function. HIV serology was negative. Syphilis serologies were positive (VDRL and Treponema pallidum reagents).
Upper endoscopy revealed diminished gastric expandability and diffuse mucosal lesions from the cardia to the pylorus. The gastric mucosa appeared thickened, friable, nodular, and had multiple ulcerations. Gastric biopsies demonstrated a dense inflammatory infiltrate rich in plasma cells.
"""

messages = [
    {"role" : "user", "content" : question}
]
text = tokenizer.apply_chat_template(
    messages,
    tokenize = False,
    add_generation_prompt = True,
    enable_thinking = True,
)

from transformers import TextStreamer
_ = model.generate(
    **tokenizer(text, return_tensors = "pt").to("cuda"),
    max_new_tokens = 1800,
    temperature = 0.6,
    top_p = 0.95,
    top_k = 20,
    streamer = TextStreamer(tokenizer, skip_prompt = True),
)

Training Details

Training Data

  • Dataset: zou-lab/MedCaseReasoning
  • Size: 13,000 cases
  • Type: Synthetic and curated real-world medical reasoning scenarios, structured into:
    • Case descriptions
    • Step-by-step diagnostic reasoning (thought process)
    • Final answers (diagnosis or treatment)
  • Domains covered: Internal medicine, neurology, infectious diseases, cardiology, and more.
  • Source: Created by Zou Lab, designed to benchmark complex clinical reasoning in LLMs.

Speeds, Sizes, Times

  • Hours used: 11 hours
  • Speed: 0.15 it/s

Result

  • Training loss: 2.51 >> 1.49
  • Val loss: 2.47 >> 1.54

Framework versions

  • PEFT 0.14.0
Downloads last month
72
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Rustamshry/MedCase-R1

Finetuned
Qwen/Qwen3-1.7B
Finetuned
unsloth/Qwen3-1.7B
Adapter
(4)
this model

Dataset used to train Rustamshry/MedCase-R1