/ Модель

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

Контекст
2 048 токенов
Параметры
15,4 млрд
Размер весов
47,4 ГБ
Лицензия
Apache 2.0
Архитектура
gpt_neox · dense
Опубликована
23 июн 2023

merlyn-education-corpus-qa

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

Дообученная Merlyn Mind модель GPT-NeoX для ответов на вопросы по предоставленным учебным фрагментам в системах диалога с поиском.

80скачиваний за 30 дней12лайковвеса обновлены27 июн 2023

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Merlyn-education-corpus-qa — языковая модель Merlyn Mind для образовательной сферы, построенная на архитектуре GPT-NeoX и дообученная на базе Pythia-12B. Карточка README указывает размер 12 млрд параметров, а метаданные Hugging Face — 15,4 млрд; поэтому точный размер по доступным сведениям расходится. Модель принимает текст и генерирует ответы, опираясь на предоставленные фрагменты информации; её предполагаемый сценарий — вопросно-ответный диалог по корпусу документов в составе системы с поиском и извлечением контекста. Контекст модели составляет 2048 токенов.

Модель предназначена для образовательных сценариев в классе и вне его, например для ответов на вопросы по учебным материалам. README сообщает, что запуск в полной точности требует более 48 ГБ видеопамяти; в качестве примера указана одна A100 с 80 ГБ, а для меньших ресурсов предлагается снижать точность или использовать несколько GPU. Лицензия — Apache-2.0.

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

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

Ограничения

Для полной точности требуется более 48 ГБ видеопамяти; при меньших ресурсах README рекомендует снижать точность или распределять модель на несколько GPU. Ответы ориентированы на предоставленные фрагменты, поэтому качество зависит от полноты и релевантности найденного контекста.

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

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

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

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

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

Открыть на Hugging Face

Merlyn-education-corpus-qa

Merlyn-education-corpus-qa is a 12b parameter decoder-style transformer model for the education domain. It is fine-tuned from a pythia-12b base-model.

This model was trained by Merlyn Mind.

Merlyn-education-corpus-qa is part of the family of Merlyn Mind models designed specifically for use in in- and out-of-classroom education.

Merlyn-education-corpus-qa is a corpus-grounded question-answering model that grounds answers in the provided information snippets. A typical use-case is as part of a larger retrieval-based corpus-grounded dialog system.

Model Date

June 26, 2023

Model License

Apache-2.0

Documentation

Usage

At full precision the model needs > 48G GPU memory. A single A100-80GB GPU suffices, for example. If you're running on smaller GPUs, you need an instance with multiple GPUs and/or reduced model precision (e.g. use model.half() before moving to device)

Loading model and tokenizer:

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

model_path = "MerlynMind/merlyn-education-corpus-qa"
device = torch.device("cuda:0") # change device id as necessary
model = AutoModelForCausalLM.from_pretrained(model_path)    
tokenizer = AutoTokenizer.from_pretrained(model_path, fast_tokenizer=True)
model.to(device) # move to device

Prompt example:

info = '''Information:\tThe Solar System is about 4.6 billion years old. The Sun formed by gravity in a large molecular cloud. It is mainly hydrogen, which it converts into helium.
Information:\tThe formation and evolution of the Solar System began 4.6 billion years ago with the gravitational collapse of a small part of a giant molecular cloud.
Information:\tAstronomers are now more or less certain that the order of the planets was not always as it is today. Knowing what we know today, we can see the Solar System is strange. All other planetary system we are able to study have their largest planet close to their star. Also we have noticed other oddities in the Solar System. Mars is smaller than it ought to be, and the asteroid belt has been disturbed.
Information:\tFor thousands of years, people had no need for a name for the "Solar System". They thought the Earth stayed still at the center of everything (geocentrism). The Greek philosopher Aristarchus of Samos suggested that there was a special order in the sky. Nicolaus Copernicus was the first to develop a mathematical system that described what we now call the "Solar System". This was called a "new system of the world". In the 17th century, Galileo Galilei, Johannes Kepler and Isaac Newton began to understand physics more clearly. People began to accept the idea that the Earth is a planet that moves around the Sun, and that the planets are worlds, and that all worlds are governed by the same same physical laws. More recently, telescopes and space probes sometimes let us see details directly. All inner planets have surface features. The gas giants (as the name suggests) have surfaces whose make-up is gradually being discovered.
Information:\tThere are eight planets in the Solar System. From closest to farthest from the Sun, they are: Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus and Neptune. The first four planets are called terrestrial planets. They are mostly made of rock and metal, and they are mostly solid. The last four planets are called gas giants. This is because they are much larger than other planets and are mostly made of gas.
'''
qs = "Question:\tHow old is the Solar System?"

prompt = tokenizer.bos_token
prompt += '''Instruction:\tYou are to try to answer the following question using only the pieces of information given.
Instruction:\tYour response should be a well formed JSON object with an 'answerable' property followed by an 'answer' property.
Instruction:\tIf you cannot answer the question given the information, the value of the 'answerable' should be 'false' and the 'answer' should be an empty string.
Instruction:\tIf you can answer the question given the information, the value of the 'answerable' should be 'true' and your answer should be the string value of the 'answer' property.
''' + info + qs

Inference:

We recommend using newline character for stopping criterion, as follows:

from transformers import StoppingCriteria, StoppingCriteriaList

eos_tokens = [tokenizer.eos_token,'\n']
eos_token_ids = [tokenizer.encode(token)[0] for token in eos_tokens]

class MultipleEOSTokensStoppingCriteria(StoppingCriteria):
    def __init__(self, eos_token_ids):
        self.eos_token_ids = set(eos_token_ids)
    def __call__(self, input_ids, scores) -> bool:
        if input_ids.shape[-1] <= 1:
            return False
        for eos_token_id in self.eos_token_ids:
            if eos_token_id == input_ids[0, -1].item():
                return True
        return False

# Define stopping criteria
multiple_eos_tokens_processor = MultipleEOSTokensStoppingCriteria(eos_token_ids)
stopping_criteria = StoppingCriteriaList([multiple_eos_tokens_processor])

It can be used in inference as follows:

inputs = tokenizer(prompt, return_tensors="pt").to(device)
generate_ids = model.generate(
    **inputs,
    max_new_tokens=1024,
    temperature=0.0,
    num_beams=2,
    stopping_criteria=stopping_criteria
)
response = tokenizer.decode(generate_ids[0],
                      skip_special_tokens=True,
                      clean_up_tokenization_spaces=True)

Example output (after response processing):

[{"answerable": "true", "answer": "4.6 billion years"}]

Citation

To cite this model, please use:

@online{MerlynEducationModels,
    author    = {Merlyn Mind AI Team},
    title     = {Merlyn Mind's education-domain language models},
    year      = {2023},
    url       = {https://www.merlyn.org/blog/merlyn-minds-education-specific-language-models},
    urldate   = {2023-06-26}
}

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей