/ Модель

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

Контекст
4 096 токенов
Параметры
2,7 млрд
Размер весов
11,2 ГБ
Лицензия
CC BY-SA 4.0
Архитектура
stablelm · dense
Опубликована
28 мар 2024

ReMask-3B

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

ReMask-3B — дообученная разговорная модель StableLM для генерации ответов по инструкциям и диалогам, обученная методом ReMask с упором на устойчивость генерации и задачи рассуждения.

86скачиваний за 30 дней16лайковвеса обновлены10 авг 2024

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

  • MMLU-PRO

    MMLU-PRO Raw · выше — лучше

    Результат

    0,1357

    Open LLM v2 · архив

    Публичная таблицаревизия совпадает

  • GPQA

    GPQA Raw · выше — лучше

    Результат

    0,2668

    Open LLM v2 · архив

    Публичная таблицаревизия совпадает

  • MATH Lvl 5

    MATH Lvl 5 Raw · выше — лучше

    Результат

    0,0196

    Open LLM v2 · архив

    Публичная таблицаревизия совпадает

  • BBH

    BBH Raw · выше — лучше

    Результат

    0,3517

    Open LLM v2 · архив

    Публичная таблицаревизия совпадает

  • MUSR

    MUSR Raw · выше — лучше

    Результат

    0,3341

    Open LLM v2 · архив

    Публичная таблицаревизия совпадает

  • IFEval

    IFEval Raw · выше — лучше

    Результат

    0,2419

    Open LLM v2 · архив

    Публичная таблицаревизия совпадает

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

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

ReMask-3B — разговорная языковая модель семейства StableLM, опубликованная euclaise. Это дообученная версия StableLM-3B-4e1t с архитектурой плотной авторегрессионной трансформерной модели; в метаданных указано 2,7 млрд параметров и контекст до 4096 токенов. Модель предназначена для генерации текста в ответ на инструкции и диалоги, включая задачи с пошаговыми рассуждениями и ответами на вопросы.

При обучении применялся метод ReMask: модель училась предсказывать ответы как на исходных, так и на случайно замаскированных последовательностях, а расхождение между предсказаниями ограничивалось дивергенцией KL. Для задач с CoT часть разметки рассуждений могла маскироваться, тогда как метки ответа сохранялись. Обучение проводилось на TinyCoT, а также на небольших поднаборах reddit-instruct-curated и oasst2-curated. Карточка описывает эксперименты с бенчмарками, но не даёт оснований считать качество универсально подтверждённым. Указана лицензия CC BY-SA 4.0.

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

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

Ограничения

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

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

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

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

Также подходит для

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

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

Открыть на Hugging Face

ReMask: Improving autoregressive language models via regularized masking

Background

Self-Play Finetuning (SPIN) is a recent finetuning method which outperforms standard supervised finetuning (SFT). Instead of just performing next-token prediction, SPIN it an iterative method which contrasts generations from the previous iteration of the model with the ground-truth completions. Unlike methods like reinforcement learning or ranking losses, SPIN does not require preference data, which makes it an attractive method since preference data can be hard to gather. However, SPIN's popularity has been limited by the need to repeatedly generate sequences from the model -- generation is much slower than training, so SPIN is much more slow and expensive compared to SFT.

With this problem in mind, I sought out to create an alternative to SPIN which doesn't require generation.

Why does SPIN work?

SFT trains models to predict the next token given all the ground-truth previous tokens. However, in generation, the model doesn't have access to a ground-truth to predict from, and instead repeatedly predicts on top of its own predictions. This creates a bias known as "exposure bias": Models often can pick reasonable choices for the next token on average, but can't keep this up for the full sequence. In particular, it might be easy to predict a reasonable next token, but much more difficult to predict the full sequence.

For instance, consider the following case:

The astronomer pointed his telescope at the distant star, hoping to see

The correct prediction here might be "signs of life.". However, the model might predict "and" rather than "signs", since "and" is reasonable in the immediate context - it's gramatically correct, but implies a strange ending to the sentence. As a result, the model might end up with something like "The astronomer pointed his telescope at the distant star, hoping to see and hear." - which makes little sense.

SPIN's advantage over SFT likely comes from its partial mitigation of exposure bias. SPIN doesn't only train the model to predict the next token accurately, it repeatedly trains the model to identify and fix discrepancies between its generations and the ground-truth. In order to do this, the model must implicitly learn to think ahead, as exposure bias is likely what causes many of the discrepancies.

How can we simplify this?

Unfortunately, explicitly predicting ahead for many steps is very expensive, and considering full model generations requires a slow generation process.

An obvious option is to simply randomly corrupt tokens in the sequence. The model must keep an internal estimate of what the corrupted tokens ought to be in order to predict the token after them, forcing the model to think ahead.

The most obvious ways to do this are to randomly replace input tokens with a special [mask] token, or to randomly replace input tokens with other random tokens. These approaches were tried in Masked Thought, albeit with somewhat different motivations.

However, these approaches have a problem: Models can detect when a token is [mask] or is highly unlikely, so the model may only learn to think ahead when the corruptions are present.

To avoid this issue, we can run the model twice - once with a masked sequence, and once on the full sequence. Then, we penalize deviations between these two runs, which forces the model to act the same regardless of if the [mask] token is present or not.

This approach was initially introduced with R-TeaFor for abstractive summarization, but can be easily applied to standard generation tasks too.

ReMask and ReMask-CoT:

ReMask applies an approach similar to R-TeaFor to typical chat/instruction tuning.

Consider the following chat interaction:

User: What is 1+1?

Assistant: 1+1=2

User:

The model must predict the bolded parts. So, we randomly mask tokens from the bolded parts, and run the model once on the masked sequence and once on the full sequence.

We then compute a divergence loss D(p_masked, p_full) between the two predictions. For this, I used the average of the backwards and forwards KL divergences between the predictions.

Finally, we add this loss to the standard cross-entropy language modeling losses from each prediction, with a weighting value:

loss = 0.5*(CE(p_masked, labels) + CE(p_full, labels)) + weight*D(p_masked, p_full)

ReMask-CoT:

For CoT tasks where the reasoning is explicitly separated from the answer, we can add some further improvements.

First, note that CoT rationales are noisy -- there are many correct rationales which might lead to the same correct answer, and rationales are impacted by things like writing style which don't matter for the actual correctness of the reasoning.

Keeping this in mind:

  • We also randomly mask a small portion of the labels of the rationale, but not the answer, such that an accurate answer is more important than a rationale that is word-for-word identical to the annotated rationale.
  • The exact answer is always important and is always a few tokens. Hence, we do not mask the labels or input tokens for the answer value.
  • Rarely, we ignore the rationale labels entirely, such that the model is only pushed to learn what leads to the best answer.

Results

I trained StableLM-3B-4e1t repeatedly on TinyCoT, along with 1000 examples from reddit-instruct-curated and 1000 examples from oasst2-curated.

I trained once with ReMask/ReMask-CoT, once without regularization to match Masked Thought (w/ partial label-masking for CoT), and once with SFT.

If my hypothesis regarding exposure bias is correct, ReMask should significantly improve generative benchmarks like GSM8K, but would not necessarily improve logprob-based benchmarks like ARC-c (as implemented by the evaluation harness):

Here are some benchmark results, computed using the the LM Evaluation Harness with vllm:

ModelGSM8K (strict, 5-shot)ARC-c (acc_norm, 25-shot)
SFT24.34%42.92%
Masked Thought24.18%43.60%
ReMask27.90%43.26%

As I expected, it improves GSM8K, but doesn't do much to ARC.

Training details

  • Framework: PyTorch Lightning
  • Optimizer: Lilith
  • Training sequence length: 256
  • Input masking probability: 40%
  • Label masking probability: 10%
  • Answer-only (full rationale label masking) probability: 10%
  • Batch size: 16, accumulated to 256
  • Epochs: 6
  • Learning rate: 1e-5
  • Learning rate schedule: One Cycle, cosine, no cycle_momentum
  • Regularization weight: 0.1

Prompt format

The format for reddit-instruct and oasst2 was:

<|user|>
[insert instruction here]
<|assistant|>
[insert response here]
<|user|>
...

The format for TinyCoT was:

<|user|>
[insert instruction here]
<|rationale|>
[insert reasoning here]
<|answer|>
[insert direct answer here]

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей