Add pipeline tag, library name, paper, project, and GitHub links
Browse filesThis PR significantly improves the model card for `Henrychur/DiagAgent-14B` by:
- Adding `pipeline_tag: text-generation` to correctly classify the model's functionality and enable the inference widget on the Hugging Face Hub.
- Adding `library_name: transformers` to integrate with the automated "how to use" widget, as evidenced by the `transformers` code snippets in the "Quickstart" section.
- Adding explicit links to the [paper](https://arxiv.org/abs/2510.24654), [project page](https://arxiv.org/html/2510.24654v1), and [GitHub repository](https://github.com/MAGIC-AI4Med/DiagGym) at the top of the card for easy access.
- Updating relative GitHub links in the "Evaluation Results" and "Training Details" sections to absolute URLs for improved navigation.
- Removing redundant paper link text in the description to keep the model card concise.
- Formatting the GitHub link in the "Contact" section as a Markdown link.
These updates enhance the model's discoverability, usability, and overall documentation quality.
|
@@ -1,14 +1,17 @@
|
|
| 1 |
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
language:
|
| 4 |
-
- en
|
| 5 |
base_model:
|
| 6 |
- Qwen/Qwen2.5-14B-Instruct
|
|
|
|
|
|
|
|
|
|
| 7 |
tags:
|
| 8 |
- medical
|
| 9 |
- diagnosis
|
| 10 |
- RL
|
|
|
|
|
|
|
| 11 |
---
|
|
|
|
| 12 |
# DiagAgent-14B: RL-Optimized Diagnostic Agent
|
| 13 |
|
| 14 |
<div align="center">
|
|
@@ -16,6 +19,10 @@ tags:
|
|
| 16 |
<div align="center"></div>
|
| 17 |
</div>
|
| 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
DiagAgent‑14B is a reinforcement learning‑optimized large language model for interactive, multi‑turn diagnostic reasoning. Unlike one‑shot medical LLMs, it can:
|
| 21 |
- recommend the most informative examinations,
|
|
@@ -24,8 +31,6 @@ DiagAgent‑14B is a reinforcement learning‑optimized large language model for
|
|
| 24 |
|
| 25 |
DiagAgent‑14B is trained end‑to‑end inside the `DiagGym` virtual clinical environment with multi‑turn RL (GRPO), enabling safe, closed‑loop learning without real‑world risk.
|
| 26 |
|
| 27 |
-
Details can be found in our paper https://arxiv.org/abs/2510.24654
|
| 28 |
-
|
| 29 |
## Quickstart
|
| 30 |
|
| 31 |
### Run locally with `transformers`
|
|
@@ -58,27 +63,45 @@ def chat(messages, max_new_tokens=1024, temperature=0.0):
|
|
| 58 |
|
| 59 |
SYSTEM_PROMPT = (
|
| 60 |
"You are a medical AI assistant. Analyze patient information, suggest relevant tests, "
|
| 61 |
-
"and provide a final diagnosis when sufficient information is available.
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
"
|
| 65 |
-
|
| 66 |
-
"
|
| 67 |
-
|
| 68 |
-
"```
|
| 69 |
-
|
| 70 |
-
"
|
| 71 |
-
|
| 72 |
-
"
|
| 73 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
"```"
|
| 75 |
)
|
| 76 |
|
| 77 |
initial_inquiry = (
|
| 78 |
-
"- Patient Information: ___ y/o F
|
| 79 |
-
|
| 80 |
-
"-
|
| 81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
"- Allergy: Lisinopril."
|
| 83 |
)
|
| 84 |
|
|
@@ -118,11 +141,9 @@ resp = client.chat.completions.create(
|
|
| 118 |
print(resp.choices[0].message.content)
|
| 119 |
```
|
| 120 |
|
| 121 |
-
|
| 122 |
-
|
| 123 |
## Evaluation Results
|
| 124 |
|
| 125 |
-
The following tables are taken directly from the project evaluation. For evaluation details and scripts, see the paper and the GitHub repository.
|
| 126 |
|
| 127 |
**Single‑Turn Evaluation**
|
| 128 |
|
|
@@ -184,8 +205,8 @@ The following tables are taken directly from the project evaluation. For evaluat
|
|
| 184 |
| Qwen3 | 235B | 2025.7 | 24.49 |
|
| 185 |
| GPT-OSS | 120B | 2025.8 | 22.26 |
|
| 186 |
| OpenbioLLM | 70B | 2024.4 | 14.11 |
|
| 187 |
-
| Baichuan-M1 | 14B
|
| 188 |
-
| MedGemma | 27B
|
| 189 |
| **Agentic System** | | | |
|
| 190 |
| MedAgent | - | 2024.1 | 19.49 |
|
| 191 |
| MDAgent | - | 2024.10| 21.64 |
|
|
@@ -205,7 +226,7 @@ DiagAgent‑14B is optimized with multi‑turn RL (GRPO) inside `DiagGym`.
|
|
| 205 |
- Examination Recommendation F1 (overlap with reference EHR exams)
|
| 206 |
- Turn Penalty (discourages >12 interaction turns)
|
| 207 |
|
| 208 |
-
For implementation and scripts, see `DiagAgent/train/rl/` in the GitHub.
|
| 209 |
|
| 210 |
## Citation
|
| 211 |
```
|
|
@@ -220,8 +241,7 @@ For implementation and scripts, see `DiagAgent/train/rl/` in the GitHub.
|
|
| 220 |
}
|
| 221 |
```
|
| 222 |
|
| 223 |
-
|
| 224 |
## Contact
|
| 225 |
|
| 226 |
- Email: henrychur@sjtu.edu.cn
|
| 227 |
-
- GitHub: https://github.com/MAGIC-AI4Med/DiagGym
|
|
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
| 2 |
base_model:
|
| 3 |
- Qwen/Qwen2.5-14B-Instruct
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
license: apache-2.0
|
| 7 |
tags:
|
| 8 |
- medical
|
| 9 |
- diagnosis
|
| 10 |
- RL
|
| 11 |
+
pipeline_tag: text-generation
|
| 12 |
+
library_name: transformers
|
| 13 |
---
|
| 14 |
+
|
| 15 |
# DiagAgent-14B: RL-Optimized Diagnostic Agent
|
| 16 |
|
| 17 |
<div align="center">
|
|
|
|
| 19 |
<div align="center"></div>
|
| 20 |
</div>
|
| 21 |
|
| 22 |
+
This model was presented in the paper [Evolving Diagnostic Agents in a Virtual Clinical Environment](https://arxiv.org/abs/2510.24654).
|
| 23 |
+
Project page: [https://arxiv.org/html/2510.24654v1](https://arxiv.org/html/2510.24654v1)
|
| 24 |
+
Code: [https://github.com/MAGIC-AI4Med/DiagGym](https://github.com/MAGIC-AI4Med/DiagGym)
|
| 25 |
+
|
| 26 |
|
| 27 |
DiagAgent‑14B is a reinforcement learning‑optimized large language model for interactive, multi‑turn diagnostic reasoning. Unlike one‑shot medical LLMs, it can:
|
| 28 |
- recommend the most informative examinations,
|
|
|
|
| 31 |
|
| 32 |
DiagAgent‑14B is trained end‑to‑end inside the `DiagGym` virtual clinical environment with multi‑turn RL (GRPO), enabling safe, closed‑loop learning without real‑world risk.
|
| 33 |
|
|
|
|
|
|
|
| 34 |
## Quickstart
|
| 35 |
|
| 36 |
### Run locally with `transformers`
|
|
|
|
| 63 |
|
| 64 |
SYSTEM_PROMPT = (
|
| 65 |
"You are a medical AI assistant. Analyze patient information, suggest relevant tests, "
|
| 66 |
+
"and provide a final diagnosis when sufficient information is available.
|
| 67 |
+
|
| 68 |
+
"
|
| 69 |
+
"RESPONSE FORMAT:
|
| 70 |
+
"
|
| 71 |
+
"If more information is needed:
|
| 72 |
+
"
|
| 73 |
+
"```
|
| 74 |
+
"
|
| 75 |
+
"Current diagnosis: <your current best diagnosis>
|
| 76 |
+
"
|
| 77 |
+
"Based on the patient's initial presentation, the following investigation(s) should be performed: <one additional test>
|
| 78 |
+
"
|
| 79 |
+
"Reason: <reason for the test>
|
| 80 |
+
"
|
| 81 |
+
"```
|
| 82 |
+
"
|
| 83 |
+
"If sufficient information exists for diagnosis:
|
| 84 |
+
"
|
| 85 |
+
"```
|
| 86 |
+
"
|
| 87 |
+
"The available information is sufficient to make a diagnosis.
|
| 88 |
+
"
|
| 89 |
+
"Diagnosis: <final diagnosis>
|
| 90 |
+
"
|
| 91 |
+
"Reason: <brief justification>
|
| 92 |
+
"
|
| 93 |
"```"
|
| 94 |
)
|
| 95 |
|
| 96 |
initial_inquiry = (
|
| 97 |
+
"- Patient Information: ___ y/o F
|
| 98 |
+
"
|
| 99 |
+
"- Chief Complaint: Early satiety, weight loss, abdominal pain
|
| 100 |
+
"
|
| 101 |
+
"- HPI: 1-month weight loss (10 lbs), early satiety, fatigue; prior emesis; reduced intake; denies fever/chills.
|
| 102 |
+
"
|
| 103 |
+
"- PMH: Asthma, hyperlipidemia, HTN, osteoarthritis, polymyalgia rheumatica, CAD (NSTEMI), osteoporosis, H. pylori, s/p TAH/USO.
|
| 104 |
+
"
|
| 105 |
"- Allergy: Lisinopril."
|
| 106 |
)
|
| 107 |
|
|
|
|
| 141 |
print(resp.choices[0].message.content)
|
| 142 |
```
|
| 143 |
|
|
|
|
|
|
|
| 144 |
## Evaluation Results
|
| 145 |
|
| 146 |
+
The following tables are taken directly from the project evaluation. For evaluation details and scripts, see the [paper](https://arxiv.org/abs/2510.24654) and the [GitHub repository](https://github.com/MAGIC-AI4Med/DiagGym).
|
| 147 |
|
| 148 |
**Single‑Turn Evaluation**
|
| 149 |
|
|
|
|
| 205 |
| Qwen3 | 235B | 2025.7 | 24.49 |
|
| 206 |
| GPT-OSS | 120B | 2025.8 | 22.26 |
|
| 207 |
| OpenbioLLM | 70B | 2024.4 | 14.11 |
|
| 208 |
+
| Baichuan-M1 | 14B | 2025.2 | 17.43 |
|
| 209 |
+
| MedGemma | 27B | 2025.7 | 20.72 |
|
| 210 |
| **Agentic System** | | | |
|
| 211 |
| MedAgent | - | 2024.1 | 19.49 |
|
| 212 |
| MDAgent | - | 2024.10| 21.64 |
|
|
|
|
| 226 |
- Examination Recommendation F1 (overlap with reference EHR exams)
|
| 227 |
- Turn Penalty (discourages >12 interaction turns)
|
| 228 |
|
| 229 |
+
For implementation and scripts, see [`DiagAgent/train/rl/` in the GitHub repository](https://github.com/MAGIC-AI4Med/DiagGym/tree/main/DiagAgent/train/rl/).
|
| 230 |
|
| 231 |
## Citation
|
| 232 |
```
|
|
|
|
| 241 |
}
|
| 242 |
```
|
| 243 |
|
|
|
|
| 244 |
## Contact
|
| 245 |
|
| 246 |
- Email: henrychur@sjtu.edu.cn
|
| 247 |
+
- GitHub: [https://github.com/MAGIC-AI4Med/DiagGym](https://github.com/MAGIC-AI4Med/DiagGym)
|