Mmed Llama 3 8B EnIns
MMedLMは医学分野に特化した多言語言語モデルで、Llama 3アーキテクチャに基づいており、医学質問応答などのタスクで優れた性能を発揮します。
ダウンロード数 786
リリース時間 : 5/22/2024
モデル概要
このモデルはLlama 3-8Bアーキテクチャに基づく医学分野専用の言語モデルで、英語の指令微調整データセットで訓練されており、特に医学質問応答タスクに長けています。
モデル特徴
医学分野最適化
医学分野に特化して最適化訓練が行われ、医学質問応答タスクで優れた性能を発揮します
多言語対応
英語、中国語などの複数の言語の医学質問応答に対応しています
指令微調整
PMC - LLaMAの英語指令微調整データセットでさらに訓練されています
高性能
複数の医学ベンチマークテストで同類のオープンソースモデルを上回っています
モデル能力
医学質問応答
多肢選択問題解答
医学知識推論
多言語医学テキスト理解
使用事例
医療教育
医学試験問題解答
医学学生が医学試験の選択問題を解くのを支援します
MedQAなどのベンチマークテストで65.4%の正解率を達成しました
臨床決定支援
臨床症例分析
症状の記述に基づいて可能な診断提案を提供します
🚀 MMedLM
「Towards Building Multilingual Language Model for Medicine」の公式モデルウェイトです。
üíªGithub Repo üñ®Ô∏èarXiv Paper
🚀 クイックスタート
このリポジトリには、MMed-Llama 3-8BをベースにしたMMed-Llama 3-8B-EnInsが含まれています。我々は、一般的に使用される英語のベンチマークで既存のモデルと公平な比較を行うために、英語の命令微調整データセット(PMC-LLaMAから)でモデルをさらに微調整しました。
MMed-Llama 3-8B-EnInsは、QAタスクに焦点を当てた英語の医療SFTデータセットであるpmc_llama_instructionsでのみトレーニングされています。したがって、このモデルの多言語入力に対する応答能力は依然として限られています。
モデルは以下のように読み込むことができます。
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 # https://github.com/MAGIC-AI4Med/MedS-Ins/blob/main/Inference/model.py
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)
✨ 主な機能
- 多言語対応:英語、中国語、日本語、フランス語、ロシア語、スペイン語などの複数の言語に対応しています。
- 医療分野への特化:医療分野のタスクに特化したモデルで、医療データセットでトレーニングされています。
- 高性能:一般的な英語のベンチマークで優れた性能を発揮します。
📦 インストール
このセクションでは、モデルのインストール方法について説明します。
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)
💻 使用例
基本的な使用法
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)
高度な使用法
from model import MedS_Llama3 # https://github.com/MAGIC-AI4Med/MedS-Ins/blob/main/Inference/model.py
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)
📚 ドキュメント
ニュース
- [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ライセンスの下で提供されています。
🔧 技術詳細
データセット
- 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}
}
Phi 2 GGUF
その他
Phi-2はマイクロソフトが開発した小型ながら強力な言語モデルで、27億のパラメータを持ち、効率的な推論と高品質なテキスト生成に特化しています。
大規模言語モデル 複数言語対応
P
TheBloke
41.5M
205
Roberta Large
MIT
マスク言語モデリングの目標で事前学習された大型英語言語モデルで、改良されたBERTの学習方法を採用しています。
大規模言語モデル 英語
R
FacebookAI
19.4M
212
Distilbert Base Uncased
Apache-2.0
DistilBERTはBERT基礎モデルの蒸留バージョンで、同等の性能を維持しながら、より軽量で高効率です。シーケンス分類、タグ分類などの自然言語処理タスクに適しています。
大規模言語モデル 英語
D
distilbert
11.1M
669
Llama 3.1 8B Instruct GGUF
Meta Llama 3.1 8B Instructは多言語大規模言語モデルで、多言語対話ユースケースに最適化されており、一般的な業界ベンチマークで優れた性能を発揮します。
大規模言語モデル 英語
L
modularai
9.7M
4
Xlm Roberta Base
MIT
XLM - RoBERTaは、100言語の2.5TBのフィルタリングされたCommonCrawlデータを使って事前学習された多言語モデルで、マスク言語モデリングの目標で学習されています。
大規模言語モデル 複数言語対応
X
FacebookAI
9.6M
664
Roberta Base
MIT
Transformerアーキテクチャに基づく英語の事前学習モデルで、マスク言語モデリングの目標を通じて大量のテキストでトレーニングされ、テキスト特徴抽出と下流タスクの微調整をサポートします。
大規模言語モデル 英語
R
FacebookAI
9.3M
488
Opt 125m
その他
OPTはMeta AIが公開したオープンプリトレーニングトランスフォーマー言語モデルスイートで、パラメータ数は1.25億から1750億まであり、GPT-3シリーズの性能に対抗することを目指しつつ、大規模言語モデルのオープンな研究を促進するものです。
大規模言語モデル 英語
O
facebook
6.3M
198
1
transformersライブラリに基づく事前学習モデルで、様々なNLPタスクに適用可能
大規模言語モデル
Transformers

1
unslothai
6.2M
1
Llama 3.1 8B Instruct
Llama 3.1はMetaが発表した多言語大規模言語モデルシリーズで、8B、70B、405Bのパラメータ規模を持ち、8種類の言語とコード生成をサポートし、多言語対話シーンを最適化しています。
大規模言語モデル
Transformers 複数言語対応

L
meta-llama
5.7M
3,898
T5 Base
Apache-2.0
T5ベーシック版はGoogleによって開発されたテキスト-to-テキスト変換Transformerモデルで、パラメータ規模は2.2億で、多言語NLPタスクをサポートしています。
大規模言語モデル 複数言語対応
T
google-t5
5.4M
702
おすすめAIモデル
Llama 3 Typhoon V1.5x 8b Instruct
タイ語専用に設計された80億パラメータの命令モデルで、GPT-3.5-turboに匹敵する性能を持ち、アプリケーションシナリオ、検索拡張生成、制限付き生成、推論タスクを最適化
大規模言語モデル
Transformers 複数言語対応

L
scb10x
3,269
16
Cadet Tiny
Openrail
Cadet-TinyはSODAデータセットでトレーニングされた超小型対話モデルで、エッジデバイス推論向けに設計されており、体積はCosmo-3Bモデルの約2%です。
対話システム
Transformers 英語

C
ToddGoldfarb
2,691
6
Roberta Base Chinese Extractive Qa
RoBERTaアーキテクチャに基づく中国語抽出型QAモデルで、与えられたテキストから回答を抽出するタスクに適しています。
質問応答システム 中国語
R
uer
2,694
98