gpt2-large
Version: 18
Last updated April 2025
GPT-2 Large is the 774M parameter version of GPT-2, a transformer-based language model created and released by OpenAI. The model is a pretrained model on English language using a causal language modeling (CLM)

Training Details

See the associated paper for details on the modeling architecture, objective, compute infrastructure, and training details.

Training Data

The OpenAI team wanted to train this model on a corpus as large as possible. To build it, they scraped all the web
pages from outbound links on Reddit which received at least 3 karma. Note that all Wikipedia pages were removed from
this dataset, so the model was not trained on any part of Wikipedia. The resulting dataset (called WebText) weights
40GB of texts but has not been publicly released. You can find a list of the top 1,000 domains present in WebText
here .

Training Procedure

The model is 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 texts are tokenized using a byte-level version of Byte Pair Encoding (BPE) (for unicode characters) and a
vocabulary size of 50,257. The inputs are sequences of 1024 consecutive tokens.

Evaluation Results

The following evaluation information is extracted from the associated paper . The model achieves the following results without any fine-tuning (zero-shot):
DatasetLAMBADALAMBADACBT-CNCBT-NEWikiText2PTBenwiki8text8WikiText1031BW
(metric)(PPL)(ACC)(ACC)(ACC)(PPL)(PPL)(BPB)(BPC)(PPL)(PPL)
10.8760.1293.4588.019.9340.310.971.0222.0544.575

Limitations and Biases

Significant research has explored bias and fairness issues with language models (see, e.g., Sheng et al. (2021) and Bender et al. (2021) ). 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. Predictions generated by the model can include disturbing and harmful stereotypes across protected classes; identity characteristics; and sensitive, social, and occupational groups. Note: This bias will also affect all fine-tuned versions of this model. Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.

Model Evaluation samples

TaskUse caseDatasetPython sample (Notebook)CLI with YAML
Text generationText generation cnn_dailymail evaluate-model-text-generation.ipynb evaluate-model-text-generation.yml

Inference samples

Inference typePython sample (Notebook)
Real timesdk-example.ipynb
Real timetext-generation-online-endpoint.ipynb

Sample inputs and outputs

Sample input

{
    "input_data": [
        "I believe the meaning of life is"
    ],
    "params": {
        "top_p": 1.0,
        "temperature": 0.8,
        "max_new_tokens": 100,
        "do_sample": true,
        "return_full_text": true
    }
}

Sample output

[
  "I believe the meaning of life is to give way to you in the present moment to the things you love the most. We don't need to worry about your feelings of guilt, anger, or pain; we need to find ways to make things easier for you and help you get back to normal.\n\nAs a mother, I've always considered that the meaning of the world came from the love we gave each other. I believe that love is a life-sustaining energy that can help us reach our goal of one day"
]
Model Specifications
LicenseMit
Last UpdatedApril 2025
Provider
Languages1 Language