/ Модель

Характеристики

Контекст
8 192 токена
Параметры
7,5 млрд
Лицензия
Llama 3
Архитектура
llama · dense
Опубликована
20 июн 2024

Llama-3-Physician-8B-Instruct

Генерация текстаТекст → текст3 профессии

Медицинская инструкция-настроенная модель на базе Llama 3 для ответов на вопросы и выполнения задач с медицинским текстом.

26скачиваний за 30 дней6лайковвеса обновлены2 июл 2024

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Llama-3-Physician-8B-Instruct — медицинская языковая модель от авторов работы «Efficient Continual Pre-training by Mitigating the Stability Gap», созданная на основе Llama 3. Это плотная авторегрессионная модель семейства Llama с 7,5 млрд параметров и контекстом 8192 токена; репозиторий содержит веса PyTorch.

Модель прошла дополнительное непрерывное предобучение на медицинской подвыборке RefinedWeb, затем была настроена на медицинских и общих инструкциях. Она предназначена для ответов на медицинские вопросы и других задач работы с медицинским текстом, включая классификацию, извлечение отношений, логический вывод и суммаризацию. В README приведены результаты оценки на медицинских наборах данных, однако они не гарантируют точность в клинической практике.

Лицензия — Llama 3 Community License (llama3). Модель ориентирована на английский медицинский текст; применять её для диагностики или выбора лечения без проверки специалистом не следует.

Сценарии применения

  • ответы на вопросы по медицинским знаниям
  • помощь в подготовке ответов на медицинские запросы
  • классификация медицинских текстов
  • извлечение связей между лекарствами и медицинскими сущностями
  • логический вывод по биомедицинским текстам
  • суммаризация медицинских документов

Ограничения

Ответы могут содержать ошибки и не заменяют профессиональную медицинскую оценку; приведённые в карточке результаты бенчмарков сами по себе не подтверждают клиническую надёжность. Контекст ограничен 8192 токенами.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

The official instruct model weights for "Efficient Continual Pre-training by Mitigating the Stability Gap".

Introduction

This repo contains Llama-3-Physician-8B-Instruct, a medical language model with 8 billion parameters. This model builds upon the foundation of Llama 3 and has been firstly continual pretrained on high-quality medical sub-corpus from the RefinedWeb dataset and then tuned with diverse medical and general instructions. We also use the three strategies in the paper to mitigate the stability gap during continual pretraining and instruction tuning, which boosts the model's medical task performance and reduces the computation consumption.

💻 Usage

from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
import torch
model_name = "YiDuo1999/Llama-3-Physician-8B-Instruct"
device_map = 'auto'
model = AutoModelForCausalLM.from_pretrained( model_name, trust_remote_code=True,use_cache=False,device_map=device_map)
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
tokenizer.pad_token = tokenizer.eos_token
def askme(question):
    sys_message = ''' 
    You are an AI Medical Assistant trained on a vast dataset of health information. Please be thorough and
    provide an informative answer. If you don't know the answer to a specific medical inquiry, advise seeking professional help.
    '''   
    # Create messages structured for the chat template
    messages = [{"role": "system", "content": sys_message}, {"role": "user", "content": question}]
    
    # Applying chat template
    prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
    inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
    outputs = model.generate(**inputs, max_new_tokens=100, use_cache=True)
    
    # Extract and return the generated text, removing the prompt
    response_text = tokenizer.batch_decode(outputs)[0].strip()
    answer = response_text.split('<|im_start|>assistant')[-1].strip()
    return answer
# Example usage
# - Context: First describe your problem.
# - Question: Then make the question.
question = '''What is HIV?'''
print(askme(question))

the type of answer is :

HIV, or Human Immunodeficiency Virus, is a retrovirus that primarily infects cells of the human immune system, particularly CD4+ T cells, which are crucial to the body's ability to fight off infection. HIV infection can lead to AIDS, or Acquired Immune Deficiency Syndrome, a condition that causes severe damage to the immune system and makes individuals more susceptible to life-threatening infections. HIV
is transmitted through sexual contact, sharing needles, or through mother-to-child transmission during pregnancy.

🏆 Evaluation

For question-answering tasks, we have

ModelMMLU-MedicalPubMedQAMedMCQAMedQA-4-OptionAvg
Mistral-7B-instruct55.817.840.241.137.5
Zephyr-7B-instruct-β63.346.043.048.548.7
PMC-Llama-7B59.759.257.649.253.6
Medalpaca-13B55.250.421.220.236.7
AlpaCare-13B60.253.838.530.445.7
BioMedGPT-LM 7B52.058.634.939.346.2
Me-Llama-13B-70.044.942.7-
Llama-3-8B instruct82.074.657.160.368.5
JSL-Med-Sft-Llama-3-8B83.075.457.574.872.7
GPT-3.5-turbo-110674.072.634.939.360.6
GPT-485.569.269.583.977.0
Llama-3-physician-8B instruct (ours)80.076.080.260.374.1

For Medical claasification, relation extraction, natural language inference, summarization tasks, we have

Task typeClassificationRelation extractionNatural Language InferenceSummarization
DatasetsHOCDDI-2013BioNLIMIMIC-CXR
Mistral-7B-instruct35.814.116.712.5
Zephyr-7B-instruct-β26.119.419.910.5
PMC-Llama-7B18.414.715.913.9
Medalpaca-13B24.65.816.41.0
AlpaCare-13B26.711.017.013.4
BioMedGPT-LM 7B23.415.517.96.2
Me-Llama-13B33.521.419.540.0
JSL-Med-Sft-Llama-3-8B25.619.716.613.8
Llama-3-8B instruct31.015.118.810.3
GPT-3.5-turbo-110654.521.631.713.5
GPT-460.229.257.815.2
Llama-3-physician-8B instruct (ours)78.933.676.237.7

Citation

@inproceedings{Guo2024EfficientCP,
  title={Efficient Continual Pre-training by Mitigating the Stability Gap},
  author={Yiduo Guo and Jie Fu and Huishuai Zhang and Dongyan Zhao and Yikang Shen},
  year={2024},
  url={https://api.semanticscholar.org/CorpusID:270688100}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм

Можно запустить

Подбираем GPU…

Класс архитектуры
LlamaForCausalLM
Ревизия весов
182dba7

0 моделей