/ Модель

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

Контекст
1 024 токена
Лицензия
MIT
Архитектура
gpt2 · dense
Опубликована
30 апр 2023

gpt2023

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

Англоязычная донастройка GPT-2 на веб-текстах 2023 года, arXiv и GitHub для генерации продолжений текста по подсказке.

168скачиваний за 30 дней18лайковвеса обновлены4 янв 2024

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

crumb/gpt2023 — англоязычная авторская донастройка модели GPT-2, созданная на основе GPT-2 с 124 млн параметров. Модель использует архитектуру GPT2LMHeadModel и генерирует продолжение текста по текстовой подсказке. Контекст — до 1024 токенов.

При дообучении использовано около 2,23 млрд токенов из веб-страниц Common Crawl за 2023 год, arXiv и GitHub. Модель подходит для экспериментов с генерацией текста, продолжения фрагментов и изучения влияния дополнительного обучения на небольшие языковые модели. В карточке приведены примеры генерации и результаты отдельных оценок, но оценивание обозначено как незавершённое.

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

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

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

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

GPT2(023) Model Card

This is the smallest GPT-2 model (124m) from OpenAi finetuned on approximately 2.23B tokens (almost the 2.48B needed to 'chinchilla-optimally' pretrain it! It's also more tokens than Cerebras-GPT-111M was trained on in total) consisting of 1.3B from common crawl sites from 2023, 540M from ArXiv, and 390M from GitHub.

The model was trained with a learning rate of 1e-4, with a warmup of 1024 steps, then decaying to 0. There were 4400 total steps during training at a batch size of 512 examples with a context length of 1024. The batch size and context length are the same as the pre-training of GPT2 itself. Training took a total of 1.18e+18 FLOs over the course of 79.32 hours locally with a 12gb RTX3060. Final train loss was 2.73.

Evaluation of GPT2023

(in progress)

modelpiqa accwinogrande acclambada ppllambada accarc accsciq accwsc acc
pythia-70m59.8551.22140.8121.4017.1565.0036.53
pythia-160m62.6851.0730.0336.7619.6276.2036.58
pythia-410m66.5452.2411.7549.9321.6780.8060.58
opt-125m63.0050.2726.0237.9018.9475.136.54
------------------------
gpt2 (124m)62.8951.6140.0632.5619.037543.27
gpt2023 (124m)62.0249.6434.5533.9818.9476.136.54

The resulting model achieves a puplexity of 339.38, making it competative with Cerebras-590m with only 21% of the parameters, and much better than the original GPT-2 which scores 491.57!

(metric explanation here: https://twitter.com/aicrumb/status/1650350363898265601 , tldr it's a joke)

To demonstrate how GPT2(023) is aware of recent events, let’s take a look at a given example:

# About Covid-19
 - -
The Covid-19

The model completes the text as:

# About Covid-19
 - -
The Covid-19 pandemic is the worldwide pandemic that has left thousands of people unable to enter and work in or continue their normal daily normal life. In this brief post, we examine three of the main factors that have accelerated the pandemic and predict the path the pandemic will take through the rest of the world.

As you can see, GPT2(023) can generate coherent and relevant text pertaining to the Covid-19 pandemic, showcasing its ability to understand recent events. However, it struggles with certain subjects that weren’t extremely relevant in it’s training data. As only 2.23 billion tokens were used during finetuning, the model may have missed out on many recent events. One of those events being the latest US election.

Given text in a question and answer format:

Q: Who is the last president?
A: Donald Trump

Q: Who is the most recent president?
A:

The model completes the text with: Barack Obama

Model description

(from GPT-2 model card)

GPT-2 is a transformer model pretrained on a very large corpus of English data in a self-supervised fashion. This means it was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots of publicly available data) with an automatic process to generate inputs and labels from those texts. More precisely, it was trained to guess the next word in sentences.

More precisely, inputs are sequences of continuous text of a certain length and the targets are the same sequence, shifted one token (word or piece of word) to the right. The model uses internally a mask-mechanism to make sure the predictions for the token i only uses the inputs from 1 to i but not the future tokens.

This way, the model learns an inner representation of the English language that can then be used to extract features useful for downstream tasks. The model is best at what it was pretrained for however, which is generating texts from a prompt.

This is the smallest version of GPT-2, with 124M parameters.

How to use

You can use this model directly with a pipeline for text generation. Since the generation relies on some randomness, we set a seed for reproducibility:

>>> from transformers import pipeline, set_seed
>>> generator = pipeline('text-generation', model='crumb/gpt2023')
>>> set_seed(42)
>>> generator("Hello, I'm a language model,", max_length=30, num_return_sequences=5)

[{'generated_text': "Hello, I'm a language model, a language for thinking, a language for expressing thoughts."},
 {'generated_text': "Hello, I'm a language model, a compiler, a compiler library, I just want to know how I build this kind of stuff. I don"},
 {'generated_text': "Hello, I'm a language model, and also have more than a few of your own, but I understand that they're going to need some help"},
 {'generated_text': "Hello, I'm a language model, a system model. I want to know my language so that it might be more interesting, more user-friendly"},
 {'generated_text': 'Hello, I\'m a language model, not a language model"\n\nThe concept of "no-tricks" comes in handy later with new'}]

Here is how to use this model to get the features of a given text in PyTorch:

from transformers import GPT2Tokenizer, GPT2Model
tokenizer = GPT2Tokenizer.from_pretrained('crumb/gpt2023')
model = GPT2Model.from_pretrained('crumb/gpt2023')
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)

Limitations and bias

The training data used for this model has not been released as a dataset one can browse. We know it contains a lot of unfiltered content from the internet, which is far from neutral. As the openAI team themselves point out in their model card:

Because large-scale language models like GPT-2 do not distinguish fact from fiction, we don’t support use-cases that require the generated text to be true.

Additionally, language models like GPT-2 reflect the biases inherent to the systems they were trained on, so we do not recommend that they be deployed into systems that interact with humans unless the deployers first carry out a study of biases relevant to the intended use-case. We found no statistically significant difference in gender, race, and religious bias probes between 774M and 1.5B, implying all versions of GPT-2 should be approached with similar levels of caution around use cases that are sensitive to biases around human attributes.

Open LLM Leaderboard Evaluation Results

Detailed results can be found here

MetricValue
Avg.24.85
ARC (25-shot)21.93
HellaSwag (10-shot)31.11
MMLU (5-shot)25.05
TruthfulQA (0-shot)40.71
Winogrande (5-shot)50.12
GSM8K (5-shot)0.3
DROP (3-shot)4.73

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей