/ Модель

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

Контекст
2 048 токенов
Размер весов
40,5 ГБ
Лицензия
Apache 2.0
Архитектура
gpt2 · dense
Опубликована
29 июн 2023

palmyra-med-20b

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

Англоязычная медицинская языковая модель на 20 млрд параметров для диалога и ответов на медицинские и биомедицинские вопросы.

484скачиваний за 30 дней37лайковвеса обновлены17 авг 2024

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Palmyra-Med-20b — медицинская языковая модель Writer с 20 млрд параметров, созданная дообучением Palmyra-Large на специально собранном наборе медицинских данных PubMedQA и MedQA. Это авторегрессионная модель с архитектурой GPT-2, предназначенная для медицинского диалога и ответов на вопросы по биомедицинским публикациям и медицинским темам. Модель принимает текст и генерирует текст на английском языке; длина контекста составляет 2048 токенов.

По данным README, на наборах PubMedQA и MedQA модель показала результаты 75,6 и 44,6 соответственно. Разработчик сообщает, что модель снята с поддержки и не рекомендует применять её в производстве или критически важных сценариях. Модель может наследовать предубеждения из обучающих данных, плохо работать на других языках, а её точность и эффективность в практических медицинских условиях не установлены; она не заменяет консультацию специалиста. Лицензия — Apache 2.0.

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

  • ответы на вопросы по биомедицинским статьям
  • подготовка ответов на медицинские вопросы
  • создание прототипа медицинского диалогового ассистента

Ограничения

Модель снята с поддержки; разработчик не рекомендует использовать её в производстве или критически важных сценариях. Она преимущественно обучена на английских данных, может наследовать предубеждения корпуса, а её практическая точность не установлена и она не заменяет медицинского специалиста.

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

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

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

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

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

Открыть на Hugging Face

DEPRECATED MODEL NOTICE

Please note that this model is no longer maintained or supported by our team. We strongly advise against using it in production or for any critical applications.

Instead, we recommend using our latest and greatest models, which can be found at:

https://huggingface.co/collections/Writer/palmyra-writer-license-66476fa8156169f8720a2c89

==========================

Palmyra-med-20b

Model description

Palmyra-Med-20b is a 20 billion parameter Large Language Model that has been uptrained on Palmyra-Large with a specialized custom-curated medical dataset. The main objective of this model is to enhance performance in tasks related to medical dialogue and question-answering.

Model Source

Palmyra-Med: Instruction-Based Fine-Tuning of LLMs Enhancing Medical Domain Performance

Uses

Out-of-Scope Use

Production use without adequate assessment of risks and mitigation; any use cases which may be considered irresponsible or harmful.

Bias, Risks, and Limitations

Palmyra-Med-20B is mostly trained on English data, and will not generalize appropriately to other languages. Furthermore, as it is trained on a large-scale corpora representative of the web, it will carry the stereotypes and biases commonly encountered online.

Recommendations

We recommend users of Palmyra-Med-20B to develop guardrails and to take appropriate precautions for any production use.

Usage

The model is compatible with the huggingface AutoModelForCausalLM and can be easily run on a single 40GB A100.

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

model_name = "Writer/palmyra-med-20b"

tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False)

model = AutoModelForCausalLM.from_pretrained(
    model_name,
    device_map="auto",
    torch_dtype=torch.float16,
)

prompt = "Can you explain in simple terms how vaccines help our body fight diseases?"

input_text = (
    "A chat between a curious user and an artificial intelligence assistant. "
    "The assistant gives helpful, detailed, and polite answers to the user's questions. "
    "USER: {prompt} "
    "ASSISTANT:"
)

model_inputs = tokenizer(input_text.format(prompt=prompt), return_tensors="pt").to(
    "cuda"
)

gen_conf = {
    "temperature": 0.7,
    "repetition_penalty": 1.0,
    "max_new_tokens": 512,
    "do_sample": True,
}

out_tokens = model.generate(**model_inputs, **gen_conf)

response_ids = out_tokens[0][len(model_inputs.input_ids[0]) :]
output = tokenizer.decode(response_ids, skip_special_tokens=True)

print(output)
## output ##
# Vaccines stimulate the production of antibodies by the body's immune system.
# Antibodies are proteins produced by B lymphocytes in response to foreign substances,such as viruses and bacteria.
# The antibodies produced by the immune system can bind to and neutralize the pathogens, preventing them from invading and damaging the host cells.
# Vaccines work by introducing antigens, which are components of the pathogen, into the body.
# The immune system then produces antibodies against the antigens, which can recognize and neutralize the pathogen if it enters the body in the future.
# The use of vaccines has led to a significant reduction in the incidence and severity of many diseases, including measles, mumps, rubella, and polio. 

It can also be used with text-generation-inference

model=Writer/palmyra-med-20b
volume=$PWD/data

docker run --gpus all --shm-size 1g -p 8080:80 -v $volume:/data ghcr.io/huggingface/text-generation-inference --model-id $model

Dataset

For the fine-tuning of our LLMs, we used a custom-curated medical dataset that combines data from two publicly available sources: PubMedQA (Jin et al. 2019) and MedQA (Zhang et al. 2018).The PubMedQA dataset, which originated from the PubMed abstract database, consists of biomedical articles accompanied by corresponding question-answer pairs. In contrast, the MedQA dataset features medical questions and answers that are designed to assess the reasoning capabilities of medical question-answering systems. We prepared our custom dataset by merging and processing data from the aforementioned sources, maintaining the dataset mixture ratios detailed in Table 1. These ratios were consistent for finetuning both Palmyra-20b and Palmyra-40b models. Upon fine-tuning the models with this dataset, we refer to the resulting models as Palmyra-Med-20b and Palmyra-Med-40b, respectively.

DatasetRatioCount
PubMedQA75%150,000
MedQA25%10,178

Evaluation

we present the findings of our experiments, beginning with the evaluation outcomes of the fine-tuned models and followed by a discussion of the base models’ performance on each of the evaluation datasets. Additionally, we report the progressive improvement of the Palmyra-Med-40b model throughout the training process on the PubMedQA dataset.

ModelPubMedQAMedQA
Palmyra-20b49.831.2
Palmyra-40b64.843.1
Palmyra-Med-20b75.644.6
Palmyra-Med-40b81.172.4

Limitation

The model may not operate efficiently beyond the confines of the healthcare field. Since it has not been subjected to practical scenarios, its real-time efficacy and precision remain undetermined. Under no circumstances should it replace the advice of a medical professional, and it must be regarded solely as a tool for research purposes.

Citation and Related Information

To cite this model:

@misc{Palmyra-Med-20B,
  author = {Writer Engineering team},
  title = {{Palmyra-Large Parameter Autoregressive Language Model}},
  howpublished = {\url{https://dev.writer.com}},
  year = 2023,
  month = March 
}

Contact

Hello@writer.com

Open LLM Leaderboard Evaluation Results

Detailed results can be found here

MetricValue
Avg.40.02
ARC (25-shot)46.93
HellaSwag (10-shot)73.51
MMLU (5-shot)44.34
TruthfulQA (0-shot)35.47
Winogrande (5-shot)65.35
GSM8K (5-shot)2.65
DROP (3-shot)11.88

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
GPT2LMHeadModel
Ревизия весов
a9ba352

0 моделей