Improve model card with metadata and links

#1
by nielsr HF Staff - opened
Files changed (1) hide show
  1. README.md +97 -3
README.md CHANGED
@@ -1,3 +1,97 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ library_name: transformers
4
+ pipeline_tag: text-generation
5
+ ---
6
+
7
+ <p align="center">
8
+ <img src="./assets/figure2.png" width="100%" alt="teaser">
9
+ </p>
10
+
11
+ ----
12
+ <p align="center">
13
+ <a href="https://arxiv.org/pdf/2506.04405">📃 Paper</a>
14
+
15
+ <a href="https://wshi83.github.io/MedAgentGym-Page/">📜 Document</a>
16
+
17
+ <a href="https://huggingface.co/MedAgentGym" >🤗 Data & Models</a>
18
+ </p>
19
+
20
+ ## MedAgentGYM
21
+ This is the official repository for the paper: "MedAgentGym: Training LLM Agents for Code-Based Medical Reasoning at Scale". In the paper, we introduce MedAgentGYM, the first publicly available training environment designed to enhance coding-based medical reasoning capabilities in large language model (LLM) agents.
22
+
23
+ <p align="center">
24
+ <img src="./assets/figure1.png" width="100%" alt="teaser">
25
+ </p>
26
+
27
+ ### Dataset Access
28
+
29
+ #### EHR Data Access (<font color=#FF000>Important!!!</font>)
30
+ MedAgentGym has been carefully curated with strict adherence to ethical standards, leveraging datasets that are publicly available or that incorporate rigorous privacy protection and anonymization measures. Table 7 in the Appendix provides detailed access requirements for each of the 12 datasets included in MedAgentGym. Researchers seeking access to preprocessed task and data files should first obtain and attach all required data usage agreements and submit a formal request via email to `medagentgym@gmail.com`, using the subject line “MedAgentGym Preprocessed Data Access".
31
+
32
+ #### Tasks Definition and Access
33
+ We provide the basic data of `train_tasks.jsonl` and `test_tasks.jsonl` in this repository, which contains.
34
+ Once the previous step is taken and the access is approved, we will send the applicants a `download_data.py` file to down load the entire pre-processed dataset from HuggingFace. This will automatically download the full datasets we have prepared and uploaded in a private repository of an anonymous HuggingFace Account. Please download the data into the directory `./data/`. The downloaded dataset should be like `./data/biocoder/*`. The dataset details involved in the paper are listed below:
35
+
36
+ <p align="center">
37
+ <img src="./assets/figure3.png" width="100%" alt="teaser">
38
+ </p>
39
+
40
+
41
+ ### Build Docker Container
42
+ As our dataset is based on the docker environment for isolated coding and execution. Thus, you need to build the docker container first. Please run the following command:
43
+ ```bash
44
+ docker buildx build -t ehr_gym:latest .
45
+ ```
46
+ or directly run the command we have prepared:
47
+ ```bash
48
+ bash build_docker.sh
49
+ ```
50
+
51
+ ### Run Experiment
52
+ Please prepare the experiment scripts in the `entrypoint.sh` file. For example if we wnat to run the experiments on biocoder task and test the performance of gpt-4.1-mini. We can run the following command for 5-thread parallel running:
53
+ ```bash
54
+ python3 /home/main.py --config /home/configs/gpt_4_1_mini/exp-gpt_4_1_mini-biocoder.yaml --async_run --parallel_backend joblib --n_jobs 5
55
+ ```
56
+
57
+ ## Results
58
+
59
+ ### Sampled Data Helps Agent Training
60
+
61
+ Figure below highlights substantial performance gains from SFT across four OSS backbone LLMs of varying sizes.
62
+ <p align="center">
63
+ <img src="./assets/figure4.png" width="100%" alt="teaser">
64
+ </p>
65
+
66
+ ### Warmed-up DPO Works Best for Coding Agent Training
67
+ The table below compares several post-training methods, revealing that simple SFT over successful trajectories significantly boosts performance on structured coding tasks, demonstrating its effectiveness in capturing structured coding patterns. Besides, DPO is particularly beneficial for optimizing open-ended task performance. Although DPO alone slightly underperforms compared to SFT, combining an initial SFT warm-up with subsequent DPO further improves overall results by leveraging their complementary strengths.
68
+
69
+ <p align="center">
70
+ <img src="./assets/figure5.png" width="100%" alt="teaser">
71
+ </p>
72
+
73
+ ### MedAgentGym Enables Both Inference- and Training-Time Scaling
74
+
75
+ <p align="center">
76
+ <img src="./assets/figure6.png" width="100%" alt="teaser">
77
+ </p>
78
+
79
+
80
+ **Inference-Time Scaling:** The left figure illustrates performance scaling with increased trajectory sampling. Pass@K significantly improves from 17.0% at K = 1 to 45.0% at 16, while Best@K shows steady advancement from 17.0% to 41.7%. The relatively small gap between metrics indicates that our trained verifier effectively identifies successful trajectories, unleashing its potential as a reward model for integration into advanced online RL frameworks such as Proximal Policy Optimization (PPO) and Group Relative Policy Optimization (GRPO).
81
+
82
+ **Training-Time Scaling:** The right figure examines agent performance as a function of increased training data volumes (25%, 50%, 75%, and 100%) in SFT. We observe consistent performance improvements with greater training data availability, suggesting additional computational resources dedicated to sampling further trajectories are likely to yield continued performance gains.
83
+
84
+ ## 📚 Citation
85
+
86
+ ```bibtex
87
+ @misc{xu2025medagentgymtrainingllmagents,
88
+ title={MedAgentGym: Training LLM Agents for Code-Based Medical Reasoning at Scale},
89
+ author={Ran Xu and Yuchen Zhuang and Yishan Zhong and Yue Yu and Xiangru Tang and Hang Wu and May D. Wang and Peifeng Ruan and Donghan Yang and Tao Wang and Guanghua Xiao and Carl Yang and Yang Xie and Wenqi Shi},
90
+ year={2025},
91
+ eprint={2506.04405},
92
+ archivePrefix={arXiv},
93
+ primaryClass={cs.CL},
94
+ url={https://arxiv.org/abs/2506.04405},
95
+ }
96
+ ```
97
+ Code: https://github.com/MedAgentGym/MedAgentGym