Add pipeline tag, library name, and improve model card formatting
#1
by
nielsr HF Staff - opened
README.md
CHANGED
|
@@ -1,14 +1,17 @@
|
|
| 1 |
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
language:
|
| 4 |
-
- en
|
| 5 |
base_model:
|
| 6 |
- meta-llama/Llama-3.1-8B-Instruct
|
|
|
|
|
|
|
|
|
|
| 7 |
tags:
|
| 8 |
- medical
|
| 9 |
- diagnosis
|
| 10 |
- RL
|
|
|
|
|
|
|
| 11 |
---
|
|
|
|
| 12 |
# DiagAgent-8B: RL-Optimized Diagnostic Agent
|
| 13 |
|
| 14 |
<div align="center">
|
|
@@ -25,6 +28,7 @@ DiagAgent‑8B is a reinforcement learning‑optimized large language model for
|
|
| 25 |
DiagAgent‑8B 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 |
|
|
@@ -58,27 +62,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 |
|
|
@@ -191,6 +213,7 @@ The following tables are taken directly from the project evaluation. For evaluat
|
|
| 191 |
| MDAgent | - | 2024.10| 21.64 |
|
| 192 |
| **Our Method** | | | |
|
| 193 |
| DiagAgent-14B | 14B | - | 32.86 |
|
|
|
|
| 194 |
|
| 195 |
## Training Details
|
| 196 |
|
|
@@ -207,7 +230,8 @@ DiagAgent‑8B is optimized with multi‑turn RL (GRPO) inside `DiagGym`.
|
|
| 207 |
|
| 208 |
For implementation and scripts, see `DiagAgent/train/rl/` in the GitHub.
|
| 209 |
|
| 210 |
-
## Citation
|
|
|
|
| 211 |
```
|
| 212 |
@misc{qiu2025evolvingdiagnosticagentsvirtual,
|
| 213 |
title={Evolving Diagnostic Agents in a Virtual Clinical Environment},
|
|
@@ -220,8 +244,4 @@ 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 |
- meta-llama/Llama-3.1-8B-Instruct
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
license: apache-2.0
|
| 7 |
tags:
|
| 8 |
- medical
|
| 9 |
- diagnosis
|
| 10 |
- RL
|
| 11 |
+
library_name: transformers
|
| 12 |
+
pipeline_tag: text-generation
|
| 13 |
---
|
| 14 |
+
|
| 15 |
# DiagAgent-8B: RL-Optimized Diagnostic Agent
|
| 16 |
|
| 17 |
<div align="center">
|
|
|
|
| 28 |
DiagAgent‑8B 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.
|
| 29 |
|
| 30 |
Details can be found in our paper https://arxiv.org/abs/2510.24654
|
| 31 |
+
Code: https://github.com/MAGIC-AI4Med/DiagGym
|
| 32 |
|
| 33 |
## Quickstart
|
| 34 |
|
|
|
|
| 62 |
|
| 63 |
SYSTEM_PROMPT = (
|
| 64 |
"You are a medical AI assistant. Analyze patient information, suggest relevant tests, "
|
| 65 |
+
"and provide a final diagnosis when sufficient information is available.
|
| 66 |
+
|
| 67 |
+
"
|
| 68 |
+
"RESPONSE FORMAT:
|
| 69 |
+
"
|
| 70 |
+
"If more information is needed:
|
| 71 |
+
"
|
| 72 |
+
"```
|
| 73 |
+
"
|
| 74 |
+
"Current diagnosis: <your current best diagnosis>
|
| 75 |
+
"
|
| 76 |
+
"Based on the patient's initial presentation, the following investigation(s) should be performed: <one additional test>
|
| 77 |
+
"
|
| 78 |
+
"Reason: <reason for the test>
|
| 79 |
+
"
|
| 80 |
+
"```
|
| 81 |
+
"
|
| 82 |
+
"If sufficient information exists for diagnosis:
|
| 83 |
+
"
|
| 84 |
+
"```
|
| 85 |
+
"
|
| 86 |
+
"The available information is sufficient to make a diagnosis.
|
| 87 |
+
"
|
| 88 |
+
"Diagnosis: <final diagnosis>
|
| 89 |
+
"
|
| 90 |
+
"Reason: <brief justification>
|
| 91 |
+
"
|
| 92 |
"```"
|
| 93 |
)
|
| 94 |
|
| 95 |
initial_inquiry = (
|
| 96 |
+
"- Patient Information: ___ y/o F
|
| 97 |
+
"
|
| 98 |
+
"- Chief Complaint: Early satiety, weight loss, abdominal pain
|
| 99 |
+
"
|
| 100 |
+
"- HPI: 1-month weight loss (10 lbs), early satiety, fatigue; prior emesis; reduced intake; denies fever/chills.
|
| 101 |
+
"
|
| 102 |
+
"- PMH: Asthma, hyperlipidemia, HTN, osteoarthritis, polymyalgia rheumatica, CAD (NSTEMI), osteoporosis, H. pylori, s/p TAH/USO.
|
| 103 |
+
"
|
| 104 |
"- Allergy: Lisinopril."
|
| 105 |
)
|
| 106 |
|
|
|
|
| 213 |
| MDAgent | - | 2024.10| 21.64 |
|
| 214 |
| **Our Method** | | | |
|
| 215 |
| DiagAgent-14B | 14B | - | 32.86 |
|
| 216 |
+
---
|
| 217 |
|
| 218 |
## Training Details
|
| 219 |
|
|
|
|
| 230 |
|
| 231 |
For implementation and scripts, see `DiagAgent/train/rl/` in the GitHub.
|
| 232 |
|
| 233 |
+
## 📝Citation & Contact
|
| 234 |
+
|
| 235 |
```
|
| 236 |
@misc{qiu2025evolvingdiagnosticagentsvirtual,
|
| 237 |
title={Evolving Diagnostic Agents in a Virtual Clinical Environment},
|
|
|
|
| 244 |
}
|
| 245 |
```
|
| 246 |
|
| 247 |
+
For any inquiries or feedback, don’t hesitate to contact henrychur@sjtu.edu.cn.
|
|
|
|
|
|
|
|
|
|
|
|