lastmass/Qwen3_Medical_GRPO-Q4_K_M-GGUF

This model was converted to GGUF format from lastmass/Qwen3_Medical_GRPO using llama.cpp via the ggml.ai's GGUF-my-repo space. Refer to the original model card for more details on the model.

Use with llama.cpp

Install llama.cpp through brew (works on Mac and Linux)

brew install llama.cpp

Invoke the llama.cpp server or the CLI.

CLI:

llama-cli --hf-repo lastmass/Qwen3_Medical_GRPO-Q4_K_M-GGUF --hf-file qwen3_medical_grpo-q4_k_m.gguf -p "<start_working_out>The meaning to life and the universe is"

Server:

llama-server --hf-repo lastmass/Qwen3_Medical_GRPO-Q4_K_M-GGUF --hf-file qwen3_medical_grpo-q4_k_m.gguf -c 2048

Note: You can also use this checkpoint directly through the usage steps listed in the Llama.cpp repo as well.

Step 1: Clone llama.cpp from GitHub.

git clone https://github.com/ggerganov/llama.cpp

Step 2: Move into the llama.cpp folder and build it with LLAMA_CURL=1 flag along with other hardware-specific flags (for ex: LLAMA_CUDA=1 for Nvidia GPUs on Linux).

cd llama.cpp && LLAMA_CURL=1 make

Step 3: Run inference through the main binary.

./llama-cli --hf-repo lastmass/Qwen3_Medical_GRPO-Q4_K_M-GGUF --hf-file qwen3_medical_grpo-q4_k_m.gguf -p "<start_working_out>The meaning to life and the universe is"

or

./llama-server --hf-repo lastmass/Qwen3_Medical_GRPO-Q4_K_M-GGUF --hf-file qwen3_medical_grpo-q4_k_m.gguf -c 2048

System_Prompt

You are given a problem.
Think about the problem and provide your working out.
Place it between <start_working_out> and <end_working_out>.
Then, provide your solution between <SOLUTION></SOLUTION>

Param

temperature:0.6/0.7
min_p:0.00
top_p:0.95
top_k:20

Add <start_working_out> after user input for thinking mode

Using with Ollama

ollama run lastmass/Qwen3_Medical_GRPO

Qwen3_Medical_GRPO

This is a fine-tuned version of unsloth/Qwen3-4B-Base, specializing in the medical domain.

Model Introduction

This model first underwent multi-stage Supervised Fine-Tuning (SFT) to equip it with foundational knowledge and conversational abilities in the medical field. Subsequently, we employed the GRPO (Group Relative Policy Optimization) algorithm for further optimization. During the different stages of GRPO training, we designed and utilized various forms of accuracy (ACC) reward functions, aiming to enhance the model's accuracy, logical reasoning, and reliability in answering medical questions.

The model is designed to understand complex medical problems, provide detailed logical analysis, and deliver structured solutions.

Output Showcase

Note: To accurately demonstrate the model's capabilities in its primary language, the following inputs and outputs are presented in their original Chinese.

Example 1: Diabetic Ketoacidosis (DKA)

Input:

背景: 24岁女性,王XX,因“恶心、呕吐、意识模糊1天”被送入急诊。关键病史: 1型糖尿病史10年,使用胰岛素泵治疗。3天前有感冒症状,食欲差,自行减少了胰岛素用量。
核心体征与化验: 体征: 生命体征: P 125次/分, R 30次/分 (深大呼吸), BP 95/60 mmHg。神志嗜睡,皮肤干燥,呼吸有烂苹果味。
急诊化验: 血糖: 28.5 mmol/L, 动脉血气 (ABG): pH 7.15, PaCO₂ 22 mmHg, HCO₃⁻ 8 mmol/L, 尿常规: 尿酮 +++, 尿糖 ++++, 血钾: 3.2 mmol/L. 
问题1: 该患者最可能的诊断是什么? 
问题2: 诊断的核心依据是什么?(请列出三联征) 
问题3: 治疗该患者时,最优先、最紧急的初始治疗步骤是什么?
A. 立即静脉推注胰岛素 
B. 立即大量静脉补液 
C. 立即静脉滴注碳酸氢钠纠正酸中毒 
D. 立即静脉补钾 
问题4: 针对该患者当前的血钾水平(3.2 mmol/L),在开始胰岛素治疗时,需要遵循什么关键原则? 
问题5: 除了诊断出的急症,该患者白细胞计数可能出现什么变化?为什么?<start_working_out>

Model Output:

这位患者,24岁,女性,有1型糖尿病史,使用胰岛素泵治疗,已经十年了。最近三天她感冒了,还吃了点东西,但她自行减少了胰岛素的用量。这是个关键点,因为减少胰岛素会导致酮症酸中毒。
我看看她的生命体征,她的脉搏每分钟125次,呼吸每分钟30次,深而大,血压是95/60 mmHg。这些都提示她处于休克状态。还有,她的神志是嗜睡的,皮肤干燥,呼吸有烂苹果味,这些都是糖尿病酮症酸中毒的典型症状。
化验结果显示,她的血糖是28.5 mmol/L,动脉血气显示pH是7.15,PaCO₂是22 mmHg,HCO₃⁻是8 mmol/L,尿常规显示尿酮++,尿糖+++,血钾是3.2 mmol/L。这些数据都非常符合糖尿病酮症酸中毒的诊断标准。特别是,pH值低于7.35,PaCO₂低,HCO₃⁻低于15 mmol/L,尿酮和尿糖都很高,再加上她的症状,我们基本可以确定是糖尿病酮症酸中毒。
针对这个情况,最优先的治疗步骤应该是立即静脉补液。因为患者处于休克状态,需要补充足够的体液来纠正循环衰竭,然后才能开始胰岛素治疗。补钾也是重要的一环,但不能在没有补液的情况下进行。
关于她的血钾水平,3.2 mmol/L,确实低于正常值,但需要谨慎处理,不能急于静脉补钾,因为补液后可能会导致钾浓度升高。所以,要先补液,等循环稳定后再考虑补钾。
白细胞计数方面,由于患者处于感染状态,可能会上升。她的症状中提到有感冒史,这通常会导致白细胞计数增加,因为身体在应对感染。
综上所述,该患者最可能的诊断是糖尿病酮症酸中毒,最优先的初始治疗步骤是B. 立即大量静脉补液。在处理她的低钾血症时,需要等到循环稳定后再考虑补钾。此外,她的白细胞计数可能会上升,因为她在应对感染。<end_working_out>
<SOLUTION>
问题1: 该患者最可能的诊断是糖尿病酮症酸中毒。
问题2: 诊断的核心依据是三联征:①生命体征异常,如心率、呼吸和血压的改变;②临床表现,如神志嗜睡、皮肤干燥、呼吸有烂苹果味;③化验指标异常,如血糖升高、pH值下降、尿酮和尿糖阳性。
问题3: 治疗该患者时,最优先、最紧急的初始治疗步骤是B. 立即大量静脉补液。
问题4: 在开始胰岛素治疗时,需要遵循的关键原则是谨慎补钾,因为补液后可能会导致钾浓度升高,需要在循环稳定后再考虑补钾。
问题5: 该患者白细胞计数可能会上升,因为她在应对感染,白细胞是身体应对感染的重要指标。</SOLUTION>

Example 2: Bacterial Meningitis

Input:

背景:19岁男性,大学生,因“高热、剧烈头痛伴呕吐12小时”就诊急诊。关键病史:症状发展迅速,数小时内出现全脑炸裂样头痛,伴畏光、精神萎靡。既往健康,无外伤史。
核心体征与化验:体征:生命体征: T 39.8°C, P 115次/分, BP 110/70 mmHg。神志嗜睡,定向力差。
皮肤可见散在瘀点、瘀斑。颈部抵抗明显 (颈强直),克氏征(+)。辅助检查:头颅CT平扫: 未见异常。
腰椎穿刺脑脊液 (CSF) 检查:外观: 脓性、浑浊压力: 310 mmH₂O (增高)白细胞: 2500 x 10⁶/L (显著增高)分类: 中性粒细胞 95%糖: 1.2 mmol/L (同步指尖血糖 8.0 mmol/L)蛋白: 2.5 g/L (显著增高)
问题1: 该患者最可能的诊断是什么?
问题2: 诊断的最关键实验室检查是哪一项?请解读其支持诊断的四个典型改变。
问题3: 根据患者的年龄和皮肤表现(瘀点、瘀斑),最可能的可疑病原体是哪一种?
问题4: 对于这类危重患者,在临床高度怀疑诊断但正在等待脑脊液结果时,最关键的治疗决策是什么?<start_working_out>

Model Output:

这个案例里,19岁的男性患者突然出现了高热、剧烈头痛和呕吐的症状,这让我立刻想到可能是一种急性脑膜炎。患者的症状发展得非常快,而且出现了明显的颈强直和克氏征阳性,这提示我脑膜刺激征很严重。
再看看他的体征,生命体征显示体温很高,心跳和血压也有异常,神志方面也显得很萎靡。皮肤上还有散在的瘀点和瘀斑,这些瘀点和瘀斑提示我可能有血小板减少或者血管的异常。
然后是脑脊液检查结果,外观是脓性的,浑浊,这说明脑脊液有感染。白细胞计数显著增高,中性粒细胞占了95%,糖含量只有1.2 mmol/L,蛋白含量显著增高。这些结果和细菌性脑膜炎的特征很吻合。
从这些信息来看,细菌性脑膜炎是最可能的诊断。因为细菌性脑膜炎通常会导致脑脊液的白细胞显著增多,中性粒细胞占大部分,糖含量降低,蛋白含量增高。
至于最关键的实验室检查,我认为脑脊液检查是最重要的,因为它直接反映了脑膜的感染情况。脑脊液中白细胞显著增多,中性粒细胞比例很高,糖含量低,蛋白含量高,这些典型改变都指向了细菌性脑膜炎。
再考虑到这个患者的年龄和皮肤上的瘀点、瘀斑,这些提示我可能有败血症或者血管的异常。最可能的病原体可能是脑膜炎奈瑟菌,因为年轻人容易感染这种细菌,而且皮肤上的瘀点、瘀斑可能与血小板减少有关。
对于这类危重患者,如果怀疑是细菌性脑膜炎,但还在等脑脊液结果,最关键的是给予经验性抗生素治疗,以迅速控制感染。通常我们会选择广谱抗生素,比如头孢曲松和阿莫西林,以覆盖常见的致病菌。
综上所述,患者的最可能诊断是细菌性脑膜炎,最关键的检查是脑脊液分析,可疑病原体是脑膜炎奈瑟菌,而治疗上最关键的是经验性抗生素治疗。<end_working_out>
<SOLUTION>
问题1: 该患者最可能的诊断是细菌性脑膜炎。
问题2: 诊断的最关键实验室检查是脑脊液分析。这支持诊断的四个典型改变包括:脑脊液外观呈脓性、浑浊;白细胞计数显著增高;中性粒细胞比例显著增高;糖含量降低。
问题3: 根据患者的年龄和皮肤表现(瘀点、瘀斑),最可能的可疑病原体是脑膜炎奈瑟菌。
问题4: 对于这类危重患者,在临床高度怀疑诊断但正在等待脑脊液结果时,最关键的治疗决策是给予经验性抗生素治疗,以迅速控制感染,通常选择广谱抗生素如头孢曲松和阿莫西林。</SOLUTION>

Disclaimer

This model is fine-tuned from a large language model and is intended for academic research and technical communication purposes only. Any medical information, analysis, or suggestions provided by the model's output may contain errors, omissions, or inaccuracies and cannot replace the diagnosis and advice of licensed physicians, pharmacists, or other professional medical personnel.Do not use the output of this model as a basis for clinical decisions. Before making any medical decisions, be sure to consult a qualified professional healthcare provider. The author assumes no responsibility for any direct or indirect loss or damage resulting from the use of this model.

Citation

@software{tang_2025_qwen3_medical_grpo,
  author = {TANG ZHI XIONG},
  title = {{Qwen3_Medical_GRPO: A Medical Domain LLM fine-tuned with Group Relative Policy Optimization}},
  month = jun,
  year = 2025,
  publisher = {Hugging Face},
  version = {1.0},
  url = {[https://huggingface.co/lastmass/Qwen3_Medical_GRPO](https://huggingface.co/lastmass/Qwen3_Medical_GRPO)}
}
Downloads last month
24
GGUF
Model size
4.02B params
Architecture
qwen3
Hardware compatibility
Log In to view the estimation

4-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for lastmass/Qwen3_Medical_GRPO-Q4_K_M-GGUF

Base model

Qwen/Qwen3-4B-Base
Quantized
(1)
this model

Datasets used to train lastmass/Qwen3_Medical_GRPO-Q4_K_M-GGUF