🚀 MMedLM
本項目是用於醫學領域的多語言語言模型,提供了官方模型權重,可用於醫學問答等任務,在常見英文基準測試中表現出色。
🚀 快速開始
模型可以按如下方式加載:
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Henrychur/MMed-Llama-3-8B-EnIns")
model = AutoModelForCausalLM.from_pretrained("Henrychur/MMed-Llama-3-8B-EnIns", torch_dtype=torch.float16)
- 推理格式與 Llama 3-Instruct 類似,你可以在此處查看推理代碼。
- 對於多項選擇題和問答任務,建議使用以下指令:
from model import MedS_Llama3
sdk_api = MedS_Llama3(model_path="Henrychur/MMed-Llama-3-8B-EnIns", gpu_id=0)
INSTRUCTION = "Given a question and a list of options, select the correct answer from the options directly."
input_ = "Question: A mother brings her 3 - week - old infant to the pediatrician's office because she is concerned about his feeding habits. He was born without complications and has not had any medical problems up until this time. However, for the past 4 days, he has been fussy, is regurgitating all of his feeds, and his vomit is yellow in color. On physical exam, the child's abdomen is minimally distended but no other abnormalities are appreciated. Which of the following embryologic errors could account for this presentation?\nOptions: A: Abnormal migration of ventral pancreatic bud\tB: Complete failure of proximal duodenum to recanalize\tC: Abnormal hypertrophy of the pylorus\tD: Failure of lateral body folds to move ventrally and fuse in the midline\t"
results = sdk_api.chat([], input_, INSTRUCTION)
print(results)
✨ 主要特性
本倉庫包含基於 MMed-Llama 3-8B 的 MMed-Llama 3-8B-EnIns。我們在英文指令微調數據集(來自 PMC-LLaMA)上對該模型進行了進一步微調,以便在常用的英文基準測試中與現有模型進行公平比較。
需要注意的是,MMed-Llama 3-8B-EnIns 僅在 pmc_llama_instructions 上進行了訓練,這是一個專注於問答任務的英文醫學 SFT 數據集。因此,該模型對多語言輸入的響應能力仍然有限。
📚 詳細文檔
最新消息
- [2024.2.21] 我們的預印本論文在 ArXiv 上發佈,你可以在此處查看研究結果。
- [2024.2.20] 我們發佈了 MMedLM 和 MMedLM 2。通過在 MMedC 上進行自迴歸持續訓練,這些模型與所有其他開源模型相比取得了更優的性能,甚至在 MMedBench 上可與 GPT - 4 相媲美。
- [2023.2.20] 我們發佈了 MMedC,這是一個包含 255 億個標記的多語言醫學語料庫。
- [2023.2.20] 我們發佈了 MMedBench,這是一個新的帶有推理依據的多語言醫學多項選擇題問答基準測試。你可以在此處查看排行榜。
常用英文基準測試評估
進一步預訓練的 MMed-Llama3 在不同的英文基準測試的醫學領域中也展現出了出色的性能。
方法 |
規模 |
年份 |
MedQA |
MedMCQA |
PubMedQA |
MMLU_CK |
MMLU_MG |
MMLU_AN |
MMLU_PM |
MMLU_CB |
MMLU_CM |
平均 |
MedAlpaca |
7B |
2023.3 |
41.7 |
37.5 |
72.8 |
57.4 |
69.0 |
57.0 |
67.3 |
65.3 |
54.3 |
58.03 |
PMC-LLaMA |
13B |
2023.9 |
56.4 |
56.0 |
77.9 |
- |
- |
- |
- |
- |
- |
- |
MEDITRON |
7B |
2023.11 |
57.2 |
59.2 |
74.4 |
64.6 |
59.9 |
49.3 |
55.4 |
53.8 |
44.8 |
57.62 |
Mistral |
7B |
2023.12 |
50.8 |
48.2 |
75.4 |
68.7 |
71.0 |
55.6 |
68.4 |
68.1 |
59.5 |
62.97 |
Gemma |
7B |
2024.2 |
47.2 |
49.0 |
76.2 |
69.8 |
70.0 |
59.3 |
66.2 |
79.9 |
60.1 |
64.19 |
BioMistral |
7B |
2024.2 |
50.6 |
48.1 |
77.5 |
59.9 |
64.0 |
56.5 |
60.4 |
59.0 |
54.7 |
58.97 |
Llama 3 |
8B |
2024.4 |
60.9 |
50.7 |
73.0 |
72.1 |
76.0 |
63.0 |
77.2 |
79.9 |
64.2 |
68.56 |
MMed-Llama 3~(我們的) |
8B |
- |
65.4 |
63.5 |
80.1 |
71.3 |
85.0 |
69.6 |
77.6 |
74.3 |
66.5 |
72.59 |
📄 許可證
本項目使用 llama3 許可證。
📦 模型信息
屬性 |
詳情 |
模型類型 |
MMed-Llama 3-8B-EnIns |
訓練數據 |
Henrychur/MMedC、axiong/pmc_llama_instructions |
支持語言 |
英語、中文、日語、法語、俄語、西班牙語 |
標籤 |
醫學 |
基礎模型 |
Henrychur/MMed-Llama-3-8B |
庫名稱 |
transformers |
📞 聯繫我們
如果您有任何問題,請隨時聯繫 qiupengcheng@pjlab.org.cn。
📚 引用
@misc{qiu2024building,
title={Towards Building Multilingual Language Model for Medicine},
author={Pengcheng Qiu and Chaoyi Wu and Xiaoman Zhang and Weixiong Lin and Haicheng Wang and Ya Zhang and Yanfeng Wang and Weidi Xie},
year={2024},
eprint={2402.13963},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
GitHub 倉庫 arXiv 論文