HubCloneHubClone

GPT-2

OpenAI's GPT-2 is a causal language model. See the model card for details.

Model description

GPT-2 is a transformers model pretrained on a very large corpus of English data in a self-supervised fashion. It was trained to guess the next word in sentences.

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

Intended uses & limitations

You can use the raw model for text generation or fine-tune it to a downstream task.

How to use

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

Limitations and bias

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.

Training data

The OpenAI team wanted to train this model on a corpus as large as possible.

Training procedure

Preprocessing

The texts are tokenized using byte-level BPE with a vocabulary size of 50,257.

Evaluation results

The model achieves the following results without any fine-tuning (zero-shot):

DatasetLAMBADA (PPL)LAMBADA (ACC)CBT-CN (ACC)CBT-NE (ACC)
35.1345.9987.6583.4

BibTeX entry and citation info

@misc{radford2019language,
  title={Language Models are Unsupervised Multitask Learners},
  author={Radford, Alec and Wu, Jeffrey and Child, Rewon and Luan, David and Amodei, Dario and Sutskever, Ilya},
  year={2019}
}