/ Модель

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

Контекст
2 048 токенов
Размер весов
13,3 ГБ
Лицензия
Apache 2.0
Архитектура
mpt · dense
Опубликована
30 мая 2023

mpt-7b-qlora

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

Текстовая модель MPT-7B от MosaicML для продолжения текста и генерации по подсказке.

30скачиваний за 30 дней5лайковвеса обновлены30 мая 2023

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Gladiaio/mpt-7b-qlora — текстовая генеративная модель семейства MPT, основанная на декодерном трансформере MosaicML. README описывает MPT-7B как модель с 6,7 млрд параметров, обученную MosaicML с нуля на корпусе объёмом 1 трлн токенов, включающем английские тексты и код. В архитектуре используются FlashAttention и ALiBi вместо позиционных эмбеддингов; базовая модель обучалась с длиной последовательности 2048 токенов.

Модель предназначена для продолжения текста и генерации текста по текстовой подсказке. Указанная карточка описывает базовую MPT-7B, которая не предназначена для пользовательского развёртывания без дополнительного дообучения и защитных механизмов. Архитектура с ALiBi допускает работу с длинными входами, однако конкретный предел контекста для этого репозитория не задан.

В метаданных указаны формат PyTorch и лицензия Apache-2.0. Имя репозитория содержит «qlora», но карточка и метаданные не подтверждают, что загруженные веса являются QLoRA-адаптером или производной конкретной базовой модели, поэтому происхождение этой версии установить нельзя. Модель может выдавать фактически неверные, предвзятые или оскорбительные ответы.

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

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

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

MPT-7B

MPT-7B is a decoder-style transformer pretrained from scratch on 1T tokens of English text and code. This model was trained by MosaicML.

MPT-7B is part of the family of MosaicPretrainedTransformer (MPT) models, which use a modified transformer architecture optimized for efficient training and inference.

These architectural changes include performance-optimized layer implementations and the elimination of context length limits by replacing positional embeddings with Attention with Linear Biases (ALiBi). Thanks to these modifications, MPT models can be trained with high throughput efficiency and stable convergence. MPT models can also be served efficiently with both standard HuggingFace pipelines and NVIDIA's FasterTransformer.

This model uses the MosaicML LLM codebase, which can be found in the llm-foundry repository. It was trained by MosaicML’s NLP team on the MosaicML platform for LLM pretraining, finetuning, and inference.

How is this model different?

MPT-7B is

Models finetuned off MPT-7B:

The following models are finetuned on MPT-7B:

Model Date

May 5, 2023

Model License

Apache-2.0

Documentation

How to Use

This model is best used with the MosaicML llm-foundry repository for training and finetuning.

import transformers
model = transformers.AutoModelForCausalLM.from_pretrained(
  'mosaicml/mpt-7b',
  trust_remote_code=True
)

Note: This model requires that trust_remote_code=True be passed to the from_pretrained method. This is because we use a custom MPT model architecture that is not yet part of the Hugging Face transformers package. MPT includes options for many training efficiency features such as FlashAttention, ALiBi, QK LayerNorm, and more.

To use the optimized triton implementation of FlashAttention, you can load the model with attn_impl='triton' and move the model to bfloat16:

config = transformers.AutoConfig.from_pretrained(
  'mosaicml/mpt-7b',
  trust_remote_code=True
)
config.attn_config['attn_impl'] = 'triton'

model = transformers.AutoModelForCausalLM.from_pretrained(
  'mosaicml/mpt-7b',
  config=config,
  torch_dtype=torch.bfloat16,
  trust_remote_code=True
)
model.to(device='cuda:0')

Although the model was trained with a sequence length of 2048, ALiBi enables users to increase the maximum sequence length during finetuning and/or inference. For example:

config = transformers.AutoConfig.from_pretrained(
  'mosaicml/mpt-7b',
  trust_remote_code=True
)
config.update({"max_seq_len": 4096})
model = transformers.AutoModelForCausalLM.from_pretrained(
  'mosaicml/mpt-7b',
  config=config,
  trust_remote_code=True
)

This model was trained with the EleutherAI/gpt-neox-20b tokenizer.

from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-neox-20b")

Model Description

The architecture is a modification of a standard decoder-only transformer.

The model has been modified from a standard transformer in the following ways:

HyperparameterValue
n_parameters6.7B
n_layers32
n_heads32
d_model4096
vocab size50432
sequence length2048

Training Data

Streaming Datasets

Data was formatted using the MosaicML StreamingDataset library to host our data in object storage and efficiently stream it to our compute cluster during training. StreamingDataset obviates the need to download the whole dataset before starting training, and allows instant resumption of training from any point in the dataset.

Data Mix

The model was trained for 1T tokens (with batch size 1760 and sequence length 2048). It was trained on the following data mix:

Data SourceNumber of Tokens in SourceProportionEffective Number of TokensEpochs
mC4 3.1.0 - English417.99 B0.33330 B0.14
C4 - English - SemDedup 80%100.42 B0.299299 B2.98
RedPajama - CommonCrawl878.45 B0.1100 B0.11
The Stack - Selected Languages463.78 B0.1100 B0.22
RedPajama - Wikipedia - En4.87 B0.0440 B8.21
The Stack - Markdown107.07 B0.03535 B0.33
S2ORC48.85 B0.03333 B0.68
RedPajama - Books26.02 B0.0330B1.15
RedPajama - arXiv28.10 B0.01919 B0.68
RedPajama - StackExchange20.54 B0.01414 B0.68

Samples for each batch were selected from one of the datasets with the probability specified above. The examples were shuffled within each dataset, and each example was constructed from as many sequences from that dataset as were necessary to fill the 2048 sequence length.

The data was tokenized using the EleutherAI/gpt-neox-20b tokenizer. This BPE tokenizer has a number of desirable characteristics, most of which are relevant for tokenizing code: (1) It was trained on a diverse mix of data that includes code (The Pile) (2) It applies consistent space delimitation, unlike the GPT2 tokenizer which tokenizes inconsistently depending on the presence of prefix spaces (3) It contains tokens for repeated space characters, which allows superior compression of text with large amounts of repeated space characters.

The model vocabulary size of 50432 was set to be a multiple of 128 (as in MEGATRON-LM), model flop utilization (MFU) increased by up to four percentage points.

Training Configuration

This model was trained on 440 A100-40GBs for about 9.5 days using the MosaicML Platform. The model was trained with sharded data parallelism using FSDP and used the LION optimizer.

Limitations and Biases

The following language is modified from EleutherAI's GPT-NeoX-20B

MPT-7B (Base) is not intended for deployment without finetuning. It should not be used for human-facing interactions without further guardrails and user consent.

MPT-7B can produce factually incorrect output, and should not be relied on to produce factually accurate information. MPT-7B was trained on various public datasets. While great efforts have been taken to clean the pretraining data, it is possible that this model could generate lewd, biased or otherwise offensive outputs.

MosaicML Platform

If you're interested in training and deploying your own MPT or LLMs on the MosaicML Platform, sign up here.

Disclaimer

The license on this model does not constitute legal advice. We are not responsible for the actions of third parties who use this model. Please cosult an attorney before using this model for commercial purposes.

Citation

Please cite this model using the following format:

@online{MosaicML2023Introducing,
    author    = {MosaicML NLP Team},
    title     = {Introducing MPT-7B: A New Standard for Open-Source, 
    ly Usable LLMs},
    year      = {2023},
    url       = {www.mosaicml.com/blog/mpt-7b},
    note      = {Accessed: 2023-03-28}, % change this date
    urldate   = {2023-03-28} % change this date
}

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей