Base 7b V0.2
モデル概要
モデル特徴
モデル能力
使用事例
🚀 Internist.ai 7b
Internist.ai 7bは、医師によって訓練された医療分野の大規模言語モデルで、「医師が関与する」アプローチの利点を実証します。訓練データは、医師によって慎重に選り抜かれ、臨床的な関連性と臨床実践に必要な品質が確保されています。
🚀 クイックスタート
Internist.ai 7bは、医師によって設計された医療分野の大規模言語モデルです。このモデルは、高品質で関連性のある医療文献と一般データを使用することの利点を実証するために訓練されています。
✨ 主な機能
- この70億パラメータのモデルは、MedQA(USMLE)で60%の合格基準を超える最初の70億パラメータモデルであり、ほとんどの医療評価において同サイズのモデルを上回っています。
- 医療専門家にとって、臨床判断の支援や文書作成などのアシスタントとして役立ちます。
📦 インストール
このREADMEにはインストール手順が記載されていないため、このセクションをスキップします。
💻 使用例
基本的な使用法
from transformers import AutoModelForCausalLM, AutoTokenizer
device = "cuda" # the device to load the model onto
model = AutoModelForCausalLM.from_pretrained("internistai/base-7b-v0.2")
tokenizer = AutoTokenizer.from_pretrained("internistai/base-7b-v0.2")
messages = [
{"role": "user", "content": "Describe the anatomy of nutcracker syndrome"},
]
encodeds = tokenizer.apply_chat_template(messages, add_generation_prompt=True ,return_tensors="pt")
model_inputs = encodeds.to(device)
model.to(device)
generated_ids = model.generate(model_inputs, max_new_tokens=1000, do_sample=True)
decoded = tokenizer.batch_decode(generated_ids)
print(decoded[0])
📚 ドキュメント
モデルの詳細
属性 | 詳情 |
---|---|
開発元 | UCLouvain と Cliniques Universitaires Saint-Luc |
言語 | 主に英語 |
モデルのライセンス | APACHE 2.0 LICENSE |
コードのライセンス | APACHE 2.0 LICENSE |
事前学習モデル | Mistral-7B-v0.1 |
コンテキスト長 | 4096トークン |
知識の締め切り | 2023年10月 |
モデルのソース
- トレーナー: Axolotl
- 論文: Impact of High-Quality, Mixed-Domain Data on the Performance of Medical Language Models
使用方法
このモデルは、高品質で関連性のある医療文献と一般データを使用することの利点を実証するために訓練されています。したがって、このモデルは特定の用途に向けて訓練されておらず、安全性を確保するための追加の命令微調整の恩恵を受けていません。
現在の状態では、このモデルは医療専門家にとってアシスタントとして役立つ可能性があります。ただし、エラーを見つける能力がない非専門家による使用は推奨されません。
実世界の設定でこのモデルを使用する前に、追加のタスク固有の訓練と安全性評価を行うことをお勧めします。
スコープ外の使用
このモデルを本番環境での自然言語生成に使用することは推奨されません。
専門家評価
100問の自由回答評価データセットを作成し、このモデルとGPT - 4に質問を提示して比較しました。その後、質問と回答のペアを収集し、10人の異なる専門分野の医師に提示し、7段階のリッカート尺度で回答させました(詳細は論文を参照)。
訓練の詳細
訓練データ
Internist.ai 7bは合計23億トークンを含んでいます。
- 一般ドメイン: OpenOrca - GPT4は、Flanプロンプトを使用してGPT - 4から生成された最先端の一般ドメインデータセットです。
- 医療ガイドライン: UpToDateからの11,332本の記事と、医師によって提供されたドメイン固有のガイドラインが含まれ、[USMLE Content Outline](https://www.usmle.org/sites/default/files/2021 - 08/USMLE_Content_Outline.pdf)をカバーしています。
- 医療書籍: PMC LitArchと大学図書館から10,376冊の教科書を収集しました。
- 合成データ: 医療ガイドラインからの抜粋を変換および適応させる命令を大規模モデルに与えることで、40億トークンを生成しました。
データの可用性: データセットには独自の情報が含まれているため、データセットを公開する予定はありません。合成データセットに関しては、論文で示したように、このデータセットのみで訓練されたモデルの性能は非常に低く、基準に達していません。品質が低いため、公開しないことにしました。
訓練手順
4つのNVIDIA A100 80GB GPUを搭載したサーバーでAxolotlを使用して、合計450GPU時間の訓練を行いました。FlashAttention、NEFTune、サンプルパッキングを以下のパラメータで使用しました。
訓練ハイパーパラメータ
bf16 | true |
lr | 6e - 6 |
eps | 1e - 5 |
epochs | 4 |
betas | [0.9, 0.95] |
weight decay | 0.1 |
Batch size | 192,000トークン |
seq length | 4096 |
lr scheduler | cosine |
min lr | 1e - 8 |
NEFT alpha | 5 |
warmup iteration | 100 |
評価
テストデータとメトリクス
テストデータ
メトリクス
- 精度: [lm - evaluation - harness](https://github.com/maximegmd/lm - evaluation - harness/tree/big - refactor/lm_eval)を使用して標準化された0ショットベンチマークを実行しました。
結果
MedQA(4選択)、MedMCQA、PubMedQAのベンチマークを行い、同サイズのモデルと比較しました。MedQAベンチマークでは、初めてUSMLEの60%の合格点を達成しました。
Internist.ai 7b | PMC LLaMA 7b* | Mistral 7b | Meditron 7b** | |
---|---|---|---|---|
MedQA | 60.5 | 27.7 (44.7) | 48.7 | 52.0 |
MedMCQA | 55.8 | 32.2 (51.4) | 45.7 | 59.2 |
PubMedQA | 79.4 | 67.8 (74.6) | 75.8 | 74.4 |
MMLU Professional Medicine | 76.1 | 19.5 | 65.8 | 26.6 |
MMLU Clinical Knowledge | 70.6 | 23.8 | 61.1 | 35.5 |
MMLU Anatomy | 65.9 | 18.5 | 52.6 | 42.6 |
MMLU College Medicine | 63.0 | 23.7 | 55.5 | 28.9 |
MMLU Medical Genetics | 71.0 | 32.0 | 68.0 | 46.0 |
*: PMC LLaMA 7bはベンチマークで低い性能を示しました。これはおそらくフォーマットの不一致と命令微調整の不足によるものです。可能な場合は、著者によって報告された結果を括弧内に記載しています。
**: Meditron 7bのMMLUの結果は透明性のために報告していますが、彼らの論文で報告された平均54.2と一致していません。各カテゴリの詳細をお知らせいただければ、表を更新します。
引用
BibTeX: Internist.ai 7bを使用する場合は、以下のように引用してください。
@article{10.1093/jamia/ocae120,
author = {Griot, Maxime and Hemptinne, Coralie and Vanderdonckt, Jean and Yuksel, Demet},
title = "{Impact of high-quality, mixed-domain data on the performance of medical language models}",
journal = {Journal of the American Medical Informatics Association},
volume = {31},
number = {9},
pages = {1875-1883},
year = {2024},
month = {05},
abstract = "{To optimize the training strategy of large language models for medical applications, focusing on creating clinically relevant systems that efficiently integrate into healthcare settings, while ensuring high standards of accuracy and reliability.We curated a comprehensive collection of high-quality, domain-specific data and used it to train several models, each with different subsets of this data. These models were rigorously evaluated against standard medical benchmarks, such as the USMLE, to measure their performance. Furthermore, for a thorough effectiveness assessment, they were compared with other state-of-the-art medical models of comparable size.The models trained with a mix of high-quality, domain-specific, and general data showed superior performance over those trained on larger, less clinically relevant datasets (P < .001). Our 7-billion-parameter model Med5 scores 60.5\\% on MedQA, outperforming the previous best of 49.3\\% from comparable models, and becomes the first of its size to achieve a passing score on the USMLE. Additionally, this model retained its proficiency in general domain tasks, comparable to state-of-the-art general domain models of similar size.Our findings underscore the importance of integrating high-quality, domain-specific data in training large language models for medical purposes. The balanced approach between specialized and general data significantly enhances the model’s clinical relevance and performance.This study sets a new standard in medical language models, proving that a strategically trained, smaller model can outperform larger ones in clinical relevance and general proficiency, highlighting the importance of data quality and expert curation in generative artificial intelligence for healthcare applications.}",
issn = {1527-974X},
doi = {10.1093/jamia/ocae120},
url = {https://doi.org/10.1093/jamia/ocae120},
eprint = {https://academic.oup.com/jamia/article-pdf/31/9/1875/58868289/ocae120.pdf},
}
⚠️ 重要提示
このモデルは医師向けに設計されており、非医療専門家による使用時の潜在的なセキュリティ問題に対処するための特定の訓練を受けていません。前向きな臨床試験による広範な評価と、必要な安全レベルを満たすための追加の訓練なしに、このモデルを実環境で使用することは強く推奨されません。
💡 使用建议
実世界の設定でこのモデルを使用する前に、追加のタスク固有の訓練と安全性評価を行うことをお勧めします。



