πŸ“‹ Model Description

Quantization made by Richard Erkhov.

Github

Discord

Request more models

Llama3-Med42-70B - GGUF

  • Model creator: https://huggingface.co/m42-health/
  • Original model: https://huggingface.co/m42-health/Llama3-Med42-70B/

NameQuant methodSize
Llama3-Med42-70B.Q2K.ggufQ2K24.56GB
Llama3-Med42-70B.IQ3XS.ggufIQ3XS27.29GB
Llama3-Med42-70B.IQ3S.ggufIQ3S28.79GB
Llama3-Med42-70B.Q3KS.ggufQ3K_S28.79GB
Llama3-Med42-70B.IQ3M.ggufIQ3M29.74GB
Llama3-Med42-70B.Q3K.ggufQ3K31.91GB
Llama3-Med42-70B.Q3KM.ggufQ3K_M31.91GB
Llama3-Med42-70B.Q3KL.ggufQ3K_L34.59GB
Llama3-Med42-70B.IQ4XS.ggufIQ4XS35.64GB
Llama3-Med42-70B.Q40.ggufQ4037.22GB
Llama3-Med42-70B.IQ4NL.ggufIQ4_NL37.58GB
Llama3-Med42-70B.Q4KS.ggufQ4K_S37.58GB
Llama3-Med42-70B.Q4K.ggufQ4_K39.6GB
Llama3-Med42-70B.Q4KM.ggufQ4K_M39.6GB
Llama3-Med42-70B.Q41.ggufQ4_141.27GB
Llama3-Med42-70B.Q50.ggufQ5_045.32GB
Llama3-Med42-70B.Q5KS.ggufQ5K_S45.32GB
Llama3-Med42-70B.Q5K.ggufQ5_K46.52GB
Llama3-Med42-70B.Q5KM.ggufQ5K_M46.52GB
Llama3-Med42-70B.Q51.ggufQ5_149.36GB
Llama3-Med42-70B.Q6K.ggufQ6_K53.91GB
Llama3-Med42-70B.Q80.ggufQ8_069.83GB

Original model description:



language:
  • en

license: llama3
tags:
  • m42
  • health
  • healthcare
  • clinical-llm

pipeline_tag: text-generation
inference: false
license_name: llama3


Med42-v2 - A Suite of Clinically-aligned Large Language Models


Med42-v2 is a suite of open-access clinical large language models (LLM) instruct and preference-tuned by M42 to expand access to medical knowledge. Built off LLaMA-3 and comprising either 8 or 70 billion parameters, these generative AI systems provide high-quality answers to medical questions.

Key performance metrics:

  • Med42-v2-70B outperforms GPT-4.0 in most of the MCQA tasks.
  • Med42-v2-70B achieves a MedQA zero-shot performance of 79.10, surpassing the prior state-of-the-art among all openly available medical LLMs.
  • Med42-v2-70B sits at the top of the Clinical Elo Rating Leaderboard.
ModelsElo Score
Med42-v2-70B1764
Llama3-70B-Instruct1643
GPT4-o1426
Llama3-8B-Instruct1352
Mixtral-8x7b-Instruct970
Med42-v2-8B924
OpenBioLLM-70B657
JSL-MedLlama-3-8B-v2.0447

Limitations & Safe Use

  • The Med42-v2 suite of models is not ready for real clinical use. Extensive human evaluation is undergoing as it is essential to ensure safety.
  • Potential for generating incorrect or harmful information.
  • Risk of perpetuating biases in training data.

Use this suite of models responsibly! Do not rely on them for medical usage without rigorous safety testing.

Model Details

Disclaimer: This large language model is not yet ready for clinical use without further testing and validation. It should not be relied upon for making medical decisions or providing patient care.

Beginning with Llama3 models, Med42-v2 were instruction-tuned using a dataset of ~1B tokens compiled from different open-access and high-quality sources, including medical flashcards, exam questions, and open-domain dialogues.

Model Developers: M42 Health AI Team

Finetuned from model: Llama3 - 8B & 70B Instruct

Context length: 8k tokens

Input: Text only data

Output: Model generates text only

Status: This is a static model trained on an offline dataset. Future versions of the tuned models will be released as we enhance the model's performance.

License: Llama 3 Community License Agreement

Research Paper: Med42-v2: A Suite of Clinical LLMs

Intended Use

The Med42-v2 suite of models is being made available for further testing and assessment as AI assistants to enhance clinical decision-making and access to LLMs for healthcare use. Potential use cases include:
  • Medical question answering
  • Patient record summarization
  • Aiding medical diagnosis
  • General health Q&A

Run the model

You can use the πŸ€— Transformers library text-generation pipeline to do inference.

import transformers
import torch

modelnameor_path = "m42-health/Llama3-Med42-70B"

pipeline = transformers.pipeline(
"text-generation",
model=modelnameor_path,
torch_dtype=torch.bfloat16,
device_map="auto",
)

messages = [
{
"role": "system",
"content": (
"You are a helpful, respectful and honest medical assistant. You are a second version of Med42 developed by the AI team at M42, UAE. "
"Always answer as helpfully as possible, while being safe. "
"Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. "
"Please ensure that your responses are socially unbiased and positive in nature. If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. "
"If you don’t know the answer to a question, please don’t share false information."
),
},
{"role": "user", "content": "What are the symptoms of diabetes?"},
]

prompt = pipeline.tokenizer.applychattemplate(
messages, tokenize=False, addgenerationprompt=False
)

stop_tokens = [
pipeline.tokenizer.eostokenid,
pipeline.tokenizer.converttokenstoids("<|eotid|>"),
]

outputs = pipeline(
prompt,
maxnewtokens=512,
eostokenid=stop_tokens,
do_sample=True,
temperature=0.4,
top_k=150,
top_p=0.75,
)

print(outputs[0]["generated_text"][len(prompt) :])

Hardware and Software

The training was conducted on the NVIDIA DGX cluster with H100 GPUs, utilizing PyTorch's Fully Sharded Data Parallel (FSDP) framework.

Evaluation Results

Open-ended question generation

To ensure a robust evaluation of our model's output quality, we employ the LLM-as-a-Judge approach using Prometheus-8x7b-v2.0. Our assessment uses 4,000 carefully curated publicly accessible healthcare-related questions, generating responses from various models. We then use Prometheus to conduct pairwise comparisons of the answers. Drawing inspiration from the LMSYS Chatbot-Arena methodology, we present the results as Elo ratings for each model.

To maintain fairness and eliminate potential bias from prompt engineering, we used the same simple system prompt for every model throughout the evaluation process.

Below is the scoring rubric we used to prompt Prometheus to select the best answer:

### Score Rubric:
Which response is of higher overall quality in a medical context? Consider:
  • Relevance: Does it directly address the question?
  • Completeness: Does it cover all important aspects, details and subpoints?
  • Safety: Does it avoid unsafe practices and address potential risks?
  • Ethics: Does it maintain confidentiality and avoid biases?
  • Clarity: Is it professional, clear and easy to understand?

#### Elo Ratings




ModelsElo Score
Med42-v2-70B1764
Llama3-70B-Instruct1643
GPT4-o1426
Llama3-8B-Instruct1352
Mixtral-8x7b-Instruct970
Med42-v2-8B924
OpenBioLLM-70B657
JSL-MedLlama-3-8B-v2.0447

#### Win-rate

!plot

MCQA Evaluation

Med42-v2 improves performance on every clinical benchmark compared to our previous version, including MedQA, MedMCQA, USMLE, MMLU clinical topics, and MMLU Pro clinical subset. For all evaluations reported so far, we use EleutherAI's evaluation harness library and report zero-shot accuracies (except otherwise stated). We integrated chat templates into harness and computed the likelihood for the full answer instead of only the tokens "a.", "b.", "c." or "d.".

ModelMMLU ProMMLUMedMCQAMedQAUSMLE
Med42v2-70B64.3687.1273.2079.1083.80
Med42v2-8B54.3075.7661.3462.8467.04
OpenBioLLM-70B64.2490.4073.1876.9079.01
GPT-4.0-87.0069.5078.9084.05
MedGemini*---84.00-
Med-PaLM-2 (5-shot)*-87.7771.3079.70-
Med42-76.7260.9061.5071.85
ClinicalCamel-70B-69.7547.0053.4054.30
GPT-3.5-66.6350.1050.8053.00
Llama3-8B-Instruct48.2472.8959.6561.6460.38
Llama3-70B-Instruct64.2485.9972.0378.8883.57
For MedGemini, results are reported for MedQA without self-training and without search. We note that 0-shot performance is not reported for Med-PaLM 2. Further details can be found at https://github.com/m42health/med42*.

Results as reported in the paper Capabilities of GPT-4 on Medical Challenge Problems.

Accessing Med42 and Reporting Issues

Please report any software "bug" or other problems through one of the following means:

Acknowledgements

We thank the Torch FSDP team for their robust distributed training framework, the EleutherAI harness team for their valuable evaluation tools, and the Hugging Face Alignment team for their contributions to responsible AI development.

Citation

@misc{med42v2,
Author = {Cl{\'e}ment Christophe and Praveen K Kanithi and Tathagata Raha and Shadab Khan and Marco AF Pimentel},
Title = {Med42-v2: A Suite of Clinical LLMs},
Year = {2024},
Eprint = {arXiv:2408.06142},
url={https://arxiv.org/abs/2408.06142}, 
}

πŸ“‚ GGUF File List

πŸ“ Filename πŸ“¦ Size ⚑ Download
Llama3-Med42-70B.IQ3_M.gguf
LFS Q3
29.74 GB Download
Llama3-Med42-70B.IQ3_S.gguf
LFS Q3
28.79 GB Download
Llama3-Med42-70B.IQ3_XS.gguf
LFS Q3
27.29 GB Download
Llama3-Med42-70B.IQ4_XS.gguf
LFS Q4
35.64 GB Download
Llama3-Med42-70B.Q2_K.gguf
LFS Q2
24.56 GB Download
Llama3-Med42-70B.Q3_K.gguf
LFS Q3
31.91 GB Download
Llama3-Med42-70B.Q3_K_L.gguf
LFS Q3
34.59 GB Download
Llama3-Med42-70B.Q3_K_M.gguf
LFS Q3
31.91 GB Download
Llama3-Med42-70B.Q3_K_S.gguf
LFS Q3
28.79 GB Download
Llama3-Med42-70B.Q4_0.gguf
Recommended LFS Q4
37.22 GB Download