EleutherAI/gpt-j-6B cover image

EleutherAI/gpt-j-6B

GPT-J 6B is a 6 billion parameter transformer model trained using Ben Wang's Mesh Transformer JAX. It was trained on the Pile, a large-scale curated dataset created by EleutherAI. The model consists of 28 layers with a model dimension of 4096, and a feedforward dimension of 16384.

GPT-J 6B is a 6 billion parameter transformer model trained using Ben Wang's Mesh Transformer JAX. It was trained on the Pile, a large-scale curated dataset created by EleutherAI. The model consists of 28 layers with a model dimension of 4096, and a feedforward dimension of 16384.

Public
$0.0005 / sec
2k

Input

text to generate from

maximum length of the newly generated generated text.If not set or None defaults to model's max context length minus input length. (Default: 512, 1 ≤ max_new_tokens ≤ 100000)

Temperature

temperature to use for sampling. 0 means the output is deterministic. Values greater than 1 encourage more diversity (Default: 0.7, 0 ≤ temperature ≤ 100)

Sample from the set of tokens with highest probability such that sum of probabilies is higher than p. Lower values focus on the most probable tokens.Higher values sample more low-probability tokens (Default: 0.9, 0 < top_p ≤ 1)

Sample from the best k (number of) tokens. 0 means off (Default: 0, 0 ≤ top_k < 100000)

Repetition Penalty

repetition penalty. Value of 1 means no penalty, values greater than 1 discourage repetition, smaller than 1 encourage repetition. (Default: 1, 0.01 ≤ repetition_penalty ≤ 5)

Up to 16 strings that will terminate generation immediately. Please separate items by comma

Num Responses

Number of output sequences to return. Incompatible with streaming (Default: 1, 1 ≤ num_responses ≤ 2)

How to format the response 2

Presence Penalty

Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. (Default: 0, -2 ≤ presence_penalty ≤ 2)

Frequency Penalty

Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics. (Default: 0, -2 ≤ frequency_penalty ≤ 2)

You need to login to use this model

Output

I have this dream about the day I got a job at a tech company. I just woke up on a plane. I sat down on the floor and started getting work done. After getting up around 6 p.m., I looked around and

GPT-J 6B

Model Description

GPT-J 6B is a transformer model trained using Ben Wang's Mesh Transformer JAX. "GPT-J" refers to the class of model, while "6B" represents the number of trainable parameters.

HyperparameterValue
\(n_{parameters}\)6053381344
\(n_{layers}\)28*
\(d_{model}\)4096
\(d_{ff}\)16384
\(n_{heads}\)16
\(d_{head}\)256
\(n_{ctx}\)2048
\(n_{vocab}\)50257/50400† (same tokenizer as GPT-2/3)
Positional EncodingRotary Position Embedding (RoPE)
RoPE Dimensions64

* Each layer consists of one feedforward block and one self attention block.

Although the embedding matrix has a size of 50400, only 50257 entries are used by the GPT-2 tokenizer.

The model consists of 28 layers with a model dimension of 4096, and a feedforward dimension of 16384. The model dimension is split into 16 heads, each with a dimension of 256. Rotary Position Embedding (RoPE) is applied to 64 dimensions of each head. The model is trained with a tokenization vocabulary of 50257, using the same set of BPEs as GPT-2/GPT-3.

Intended Use and Limitations

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

Out-of-scope use

GPT-J-6B is not intended for deployment without fine-tuning, supervision, and/or moderation. It is not a in itself a product and cannot be used for human-facing interactions. For example, the model may generate harmful or offensive text. Please evaluate the risks associated with your particular use case.

GPT-J-6B was trained on an English-language only dataset, and is thus not suitable for translation or generating text in other languages.

GPT-J-6B has not been fine-tuned for downstream contexts in which language models are commonly deployed, such as writing genre prose, or commercial chatbots. This means GPT-J-6B will not respond to a given prompt the way a product like ChatGPT does. This is because, unlike this model, ChatGPT was fine-tuned using methods such as Reinforcement Learning from Human Feedback (RLHF) to better “follow” human instructions.

Limitations and Biases

The core functionality of GPT-J is taking a string of text and predicting the next token. While language models are widely used for tasks other than this, there are a lot of unknowns with this work. When prompting GPT-J it is important to remember that the statistically most likely next token is often not the token that produces the most "accurate" text. Never depend upon GPT-J to produce factually accurate output.

GPT-J was trained on the Pile, a dataset known to contain profanity, lewd, and otherwise abrasive language. Depending upon use case GPT-J may produce socially unacceptable text. See Sections 5 and 6 of the Pile paper for a more detailed analysis of the biases in the Pile.

As with all language models, it is hard to predict in advance how GPT-J will respond to particular prompts and offensive content may occur without warning. We recommend having a human curate or filter the outputs before releasing them, both to censor undesirable content and to improve the quality of the results.

Training data

GPT-J 6B was trained on the Pile, a large-scale curated dataset created by EleutherAI.

Training procedure

This model was trained for 402 billion tokens over 383,500 steps on TPU v3-256 pod. It was trained as an autoregressive language model, using cross-entropy loss to maximize the likelihood of predicting the next token correctly.

Evaluation results

ModelPublicTraining FLOPsLAMBADA PPL ↓LAMBADA Acc ↑Winogrande ↑Hellaswag ↑PIQA ↑Dataset Size (GB)
Random Chance0~a lot~0%50%25%25%0
GPT-3 Ada‡-----9.9551.6%52.9%43.4%70.5%-----
GPT-2 1.5B-----10.6351.21%59.4%50.9%70.8%40
GPT-Neo 1.3B‡3.0e217.5057.2%55.0%48.9%71.1%825
Megatron-2.5B*2.4e21-----61.7%---------------174
GPT-Neo 2.7B‡6.8e215.6362.2%56.5%55.8%73.0%825
GPT-3 1.3B*‡2.4e215.4463.6%58.7%54.7%75.1%~800
GPT-3 Babbage‡-----5.5862.4%59.0%54.5%75.5%-----
Megatron-8.3B*7.8e21-----66.5%---------------174
GPT-3 2.7B*‡4.8e214.6067.1%62.3%62.8%75.6%~800
Megatron-11B†1.0e22-------------------------161
GPT-J 6B‡1.5e223.9969.7%65.3%66.1%76.5%825
GPT-3 6.7B*‡1.2e224.0070.3%64.5%67.4%78.0%~800
GPT-3 Curie‡-----4.0069.3%65.6%68.5%77.9%-----
GPT-3 13B*‡2.3e223.5672.5%67.9%70.9%78.5%~800
GPT-3 175B*‡3.1e233.0076.2%70.2%78.9%81.0%~800
GPT-3 Davinci‡-----3.075%72%78%80%-----

Models roughly sorted by performance, or by FLOPs if not available.

* Evaluation numbers reported by their respective authors. All other numbers are provided by running lm-evaluation-harness either with released weights or with API access. Due to subtle implementation differences as well as different zero shot task framing, these might not be directly comparable. See this blog post for more details.

Megatron-11B provides no comparable metrics, and several implementations using the released weights do not reproduce the generation quality and evaluations. (see 1 2 3) Thus, evaluation was not attempted.

These models have been trained with data which contains possible test set contamination. The OpenAI GPT-3 models failed to deduplicate training data for certain test sets, while the GPT-Neo models as well as this one is trained on the Pile, which has not been deduplicated against any test sets.

BibTeX entry

To cite this model:

@misc{gpt-j,
  author = {Wang, Ben and Komatsuzaki, Aran},
  title = {{GPT-J-6B: A 6 Billion Parameter Autoregressive Language Model}},
  howpublished = {\url{https://github.com/kingoflolz/mesh-transformer-jax}},
  year = 2021,
  month = May
}

To cite the codebase that trained this model:

@misc{mesh-transformer-jax,
  author = {Wang, Ben},
  title = {{Mesh-Transformer-JAX: Model-Parallel Implementation of Transformer Language Model with JAX}},
  howpublished = {\url{https://github.com/kingoflolz/mesh-transformer-jax}},
  year = 2021,
  month = May
}

If you use this model, we would love to hear about it! Reach out on GitHub, Discord, or shoot Ben an email.

Acknowledgements

This project would not have been possible without compute generously provided by Google through the TPU Research Cloud, as well as the Cloud TPU team for providing early access to the Cloud TPU VM Alpha.

Thanks to everyone who have helped out one way or another (listed alphabetically):