Downloads · 30 days
34
15% of all-time downloads
chrisvoncsefalvay/dx-reasoning-qwen2.5-grpo
dx-reasoning-qwen2.5-grpo is a text generation model from chrisvoncsefalvay. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
A LoRA adapter for clinical diagnostic reasoning, fine-tuned from Qwen2.5-7B-Instruct using Group Relative Policy Optimisation (GRPO).
Downloads · 30 days
34
15% of all-time downloads
All-time downloads
232
Public
Repo size
830 MB
Likes
0
Public
Click a slice to open those files.
.safetensors646 MB · 97%
From the Hugging Face model README
A LoRA adapter for clinical diagnostic reasoning, fine-tuned from Qwen2.5-7B-Instruct using Group Relative Policy Optimisation (GRPO).
This model was trained to improve clinical diagnostic reasoning by learning to generate step-by-step reasoning before providing a diagnosis. It uses a structured format with <reasoning> and <diagnosis> tags.
The model was trained with a composite reward function:
Trained on gretelai/symptom_to_diagnosis:
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
# Load base model
base_model = AutoModelForCausalLM.from_pretrained(
"Qwen/Qwen2.5-7B-Instruct",
torch_dtype="auto",
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-7B-Instruct")
# Load LoRA adapter
model = PeftModel.from_pretrained(base_model, "chrisvoncsefalvay/dx-reasoning-qwen2.5-grpo")
# Example inference
prompt = """You are a medical expert. Given the patient's symptoms, provide a diagnosis.
Patient symptoms: The patient presents with severe headache, sensitivity to light, neck stiffness, and fever.
First, provide your reasoning in <reasoning> tags, then give your diagnosis in <diagnosis> tags."""
messages = [{"role": "user", "content": prompt}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Training rollouts are available in the rollouts/ directory, containing generation samples at each evaluation step (100, 200, 300, 400, 500, 600, 700). These can be used for per-diagnosis analysis of training progression.
If you use this model, please cite:
@misc{dx-reasoning-qwen2.5-grpo,
author = {Chris von Csefalvay},
title = {dx-reasoning-qwen2.5-grpo: Clinical Diagnostic Reasoning with GRPO},
year = {2026},
publisher = {Hugging Face},
url = {https://huggingface.co/chrisvoncsefalvay/dx-reasoning-qwen2.5-grpo}
}
Training was monitored via Weights & Biases. See the project for detailed metrics and training curves.