Model reference · open weights

gpt2-xl

LLMs openai-community Text gen 1 build Open weights 103k dl/mo

gpt2-xl is an open-weight language model from OpenAI. gpt2-xl (FP32) weighs 3.2 GB; the smallest configuration that runs it is RTX 3060 12 GB.

For self-hosting, compare this build's requirements below with the GPU you plan to rent.

  • GPT-2 XL is a transformer-based language model developed by OpenAI for text generation tasks.
  • It contains 1.6B parameters, supports a context length of 1024 tokens, and is trained on English data.
  • The model is released under the MIT license.

Summary of the openai-community/gpt2-xl model card, 2026-10-01

What it is

Released byOpenAI
Released2022-03-02
Parameters1.6B
VRAM3.2 GB for the weights

What it runs on

Memory and cards for gpt2-xl (FP32)

3.2 GBweights, file size
307 MBcache per 1K tokens
560 MBruntime overhead, at least
1,024 tokenscontext max
CardRequests at onceContext maxMemory
1K each
RTX 3060 12 GB24all 1K11.6 GB
RTX 4060 Ti 16 GB36all 1K15.4 GB
RTX 3090 24 GB62all 1K23.4 GB
RTX 4090 24 GB62all 1K23.4 GB
RTX 5090 32 GB86all 1K31.0 GB
L40S 48 GB127all 1K44.0 GB
A100 80 GB236all 1K78.2 GB
H100 80 GB227all 1K78.1 GB
RTX PRO 6000 Blackwell 96 GB276all 1K93.8 GB
DGX Spark (GB10) 128 GB unified319all 1K107 GB
H200 141 GB417all 1K138 GB
B200 180 GB537all 1K176 GB
Memory needed at each load
Requests at once1K tokens each
14.1 GB
55.3 GB
86.3 GB
168.8 GB
3213.8 GB
6423.9 GB

One card, with vLLM's small-card settings.

From the model card

What OpenAI says about gpt2-xl

Read the model card

Table of Contents

Model Details

Model Description: GPT-2 XL is the 1.5B 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) objective.

How to Get Started with the Model

Use the code below to get started with the model. 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='gpt2-xl')
set_seed(42)
generator("Hello, I'm a language model,", max_length=30, num_return_sequences=5)

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('gpt2-xl')
model = GPT2Model.from_pretrained('gpt2-xl')
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)

and in TensorFlow:

from transformers import GPT2Tokenizer, TFGPT2Model
tokenizer = GPT2Tokenizer.from_pretrained('gpt2-xl')
model = TFGPT2Model.from_pretrained('gpt2-xl')
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='tf')
output = model(encoded_input)

Uses

Direct Use

In their model card about GPT-2, OpenAI wrote:

The primary intended users of these models are AI researchers and practitioners.

We primarily imagine these language models will be used by researchers to better understand the behaviors, capabilities, biases, and constraints of large-scale generative language models.

Downstream Use

In their model card about GPT-2, OpenAI wrote:

Here are some secondary use cases we believe are likely:

  • Writing assistance: Grammar assistance, autocompletion (for normal prose or code)
  • Creative writing and art: exploring the generation of creative, fictional texts; aiding creation of poetry and other literary art.
  • Entertainment: Creation of games, chat bots, and amusing generations.
Misuse and Out-of-scope Use

In their model card about GPT-2, OpenAI wrote:

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.

Risks, Limitations and Biases

CONTENT WARNING: Readers should be aware this section contains content that is disturbing, offensive, and can propogate historical and current stereotypes.

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. For example:

from transformers import pipeline, set_seed
generator = pipeline('text-generation', model='gpt2-xl')
set_seed(42)
generator("The man worked as a", max_length=10, num_return_sequences=5)

set_seed(42)
generator("The woman worked as a", max_length=10, num_return_sequences=5)

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.

Risks and Limitations

When they released the 1.5B parameter model, OpenAI wrote in a [blog

Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms