- 🎉 [2025-05-06] MedXpertQA paper is accepted to ICML 2025!
- 🛠️ [2025-04-08] MedXpertQA has been successfully integrated into OpenCompass! Check out the PR!
- 💻 [2025-02-28] We release the evaluation code! Check out the Usage.
- 🌟 [2025-02-20] Leaderboard is on! Check out the results of o3-mini, DeepSeek-R1, and o1!
- 🤗 [2025-02-09] We release the MedXpertQA dataset.
- 🔥 [2025-01-31] We introduce MedXpertQA, a highly challenging and comprehensive benchmark to evaluate expert-level medical knowledge and advanced reasoning!
MedXpertQA includes 4,460 questions spanning 17 specialties and 11 body systems. It includes two subsets, MedXpertQA Text for text medical evaluation and MedXpertQA MM for multimodal medical evaluation. The following figure presents an overview.
More Details
The left side illustrates the diverse data sources, image types, and question attributes. The right side compares typical examples from MedXpertQA MM and a traditional benchmark (VQA-RAD).- Next-Generation Multimodal Medical Evaluation: MedXpertQA MM introduces expert-level medical exam questions with diverse images and rich clinical information, including patient records and examination results, setting it apart from traditional medical multimodal benchmarks with simple QA pairs generated from image captions.
- Highly Challenging: MedXpertQA introduces high-difficulty medical exam questions and applies rigorous filtering and augmentation, effectively addressing the insufficient difficulty of existing benchmarks like MedQA. The Text and MM subsets are currently the most challenging benchmarks in their respective fields.
- Clinical Relevance: MedXpertQA incorporates specialty board questions to improve clinical relevance and comprehensiveness by collecting questions corresponding to 17/25 member board exams (specialties) of the American Board of Medical Specialties. It showcases remarkable diversity across multiple dimensions.
- Mitigating Data Leakage: We perform data synthesis to mitigate data leakage risk and conduct multiple rounds of expert reviews to ensure accuracy and reliability.
- Reasoning-Oriented Evaluation: Medicine provides a rich and representative setting for assessing reasoning abilities beyond mathematics and code. We develop a reasoning-oriented subset to facilitate the assessment of o1-like models.
We evaluate 17 leading proprietary and open-source LMMs and LLMs including advanced inference-time scaled models with a focus on the latest progress in medical reasoning capabilities. Further details are available in the leaderboard and the paper.
- Clone the Repository:
git clone https://github.com/TsinghuaC3I/MedXpertQA
cd MedXpertQA/eval
- Install Dependencies:
pip3 install -r requirements.txt
- Inference:
bash scripts/run.sh
The run.sh script performs inference by calling main.py, which offers additional features such as multithreading. Additionally, you can modify model/api_agent.py to support more models.
To evaluate your custom model on MedXpertQA, follow these steps:
cd eval/data
python setup_datasets.py Edit config/model_info.json and add your model name to the API_MODEL list:
{
"API_MODEL": [
"existing-models...",
"your-custom-model-name",
"mistralai/Mistral-Small-3.2-24B-Instruct-2506",
"your-organization/your-model-name"
]
}Add your model implementation in model/api_agent.py. Add a new condition in the __init__ method:
elif model_name in [
"your-custom-model-name",
"your-organization/your-model-name"
]:
print("Custom Model")
# For vLLM-based models:
from vllm import LLM, SamplingParams
import os
os.environ['VLLM_USE_V1'] = '0'
self.client = LLM(
model=model_name,
tensor_parallel_size=4,
worker_use_ray=False,
gpu_memory_utilization=0.75,
trust_remote_code=True
)
self.sampling_params = SamplingParams(
max_tokens=self.max_tokens,
temperature=self.temperature if self.temperature > 0 else 0.15
)
self.is_vllm = True
# For API-based models:
# self.client = OpenAI(
# api_key="your-api-key",
# base_url="your-api-endpoint",
# )Create scripts/run_custom.sh for your model:
#!/bin/bash
set -e
models=${1:-"your-custom-model-name"}
datasets=${2:-"medxpertqa"}
tasks=${3:-"text,mm"}
output_dir=${4:-"dev"}
method=${5:-"zero_shot"}
prompting_type=${6:-"cot"}
temperature=${7:-0}
# Sequential execution to avoid memory issues
IFS=","
for model in $models; do
for dataset in $datasets; do
for task in $tasks; do
echo "Running: Model=${model}, Dataset=${dataset}, Task=${task}"
python main.py \
--model "${model}" \
--dataset "${dataset}" \
--task "${task}" \
--output-dir "${output_dir}" \
--method "${method}" \
--prompting-type "${prompting_type}" \
--temperature "${temperature}" \
--num-threads 1
# Clean GPU memory between tasks
python -c "import torch; torch.cuda.empty_cache()"
sleep 2
done
done
done# Make script executable
chmod +x scripts/run_custom.sh
# Run evaluation
bash scripts/run_custom.sh "your-custom-model-name"
- Evaluation:
We provide a script eval.ipynb to calculate accuracy on each subset.
Note
Please use this script when evaluating the QVQ and DeepSeek-R1. Through case studies, we found that the answer cleaning function in the utils.py is unsuitable for these two models.
-
Shang Qu: lindsay2864tt@gmail.com
-
Ning Ding: dn97@mail.tsinghua.edu.cn
This project is licensed under the MIT License.
If you find our work helpful, please use the following citation.
@article{zuo2025medxpertqa,
title={Medxpertqa: Benchmarking expert-level medical reasoning and understanding},
author={Zuo, Yuxin and Qu, Shang and Li, Yifei and Chen, Zhangren and Zhu, Xuekai and Hua, Ermo and Zhang, Kaiyan and Ding, Ning and Zhou, Bowen},
journal={arXiv preprint arXiv:2501.18362},
year={2025}
}


