EricHallahan commited on
Commit
d3d2956
•
1 Parent(s): 4824bed

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +72 -78
README.md CHANGED
@@ -6,52 +6,54 @@ tags:
6
  - causal-lm
7
  license: apache-2.0
8
  datasets:
9
- - the Pile
 
10
  ---
11
 
12
  # GPT-J 6B
13
 
14
  ## Model Description
15
 
16
- GPT-J 6B is a transformer model designed using Ben Wang's [Jax implementation of the GPT-3 architecture](https://github.com/kingoflolz/mesh-transformer-jax/). GPT-J refers to the class of models, while 6B represents the number of parameters of this particular pre-trained model.
17
 
18
- | Hyperparameter | Value |
19
- |-------------------|--------|
20
- | n_parameters | 6,053,381,344 |
21
- | n_layers | 28* |
22
- | d_model | 4,096 |
23
- | d_ff | 16,384 |
24
- | n_heads | 16 |
25
- | d_head | 256 |
26
- | n_ctx | 2,048 |
27
- | n_vocab | 50,257 (same tokenizer as GPT-2/3) |
28
- | position encoding | [Rotary position encodings (RoPE)](https://arxiv.org/abs/2104.09864) |
29
- | RoPE dimensions | [64](https://github.com/kingoflolz/mesh-transformer-jax/blob/f2aa66e0925de6593dcbb70e72399b97b4130482/mesh_transformer/layers.py#L223) |
30
 
31
- `*` each layer consists of one feedforward block and one self attention block
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
  The model consists of 28 layers with a model dimension of 4096, and a feedforward dimension of 16384. The model
34
- dimension is split into 16 heads, each with a dimension of 256. Rotary position encodings (RoPE) was applied to 64
35
  dimensions of each head. The model is trained with a tokenization vocabulary of 50257, using the same set of BPEs as
36
  GPT-2/GPT-3.
37
 
38
  ## Training data
39
 
40
- GPT-J 6B was trained on the [Pile](pile.eleuther.ai), a large scale curated dataset created by EleutherAI for the purpose of training this model.
41
 
42
  ## Training procedure
43
 
44
- This model was trained for [number] billion tokens over [number] steps. It was trained as a masked autoregressive language model, using cross-entropy loss.
45
 
46
  ## Intended Use and Limitations
47
 
48
- 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.
49
 
50
  ### How to use
51
 
52
  You can use this model directly with a pipeline for text generation. This example generates a different sequence each time it's run:
53
 
54
- ```py
55
  >>> from transformers import pipeline
56
  >>> generator = pipeline('text-generation', model='EleutherAI/gpt-j-6B')
57
  >>> generator("EleutherAI has", do_sample=True, min_length=50)
@@ -61,61 +63,58 @@ You can use this model directly with a pipeline for text generation. This exampl
61
 
62
  ### Limitations and Biases
63
 
64
- GPT-J was trained as an autoregressive language model. This means that its core functionality 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 with er that the statistically most likely next token is often not the same thing as the most accurate,
65
-
66
- GPT-J was trained on the Pile, a dataset known to contain profanity, lewd, and otherwise abrasive language. Depending on your usecase GPT-Neo 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.
67
-
68
- As with all language models, it is hard to predict in advance how GPT-Neo 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.
69
-
70
- ## Eval results
71
-
72
- Models roughly sorted by performance, or by FLOPs if not available.
73
-
74
- | Model | Public | Training FLOPs | LAMBADA PPL ↓ | LAMBADA Acc ↑ | Winogrande ↑ | Hellaswag ↑ | PIQA ↑ | Dataset Size (GB) |
75
- |-----------------|---------|----------------|--- |--- |--- |--- |--- |-------------------|
76
- | Chance | ✔ | 0 | ~a lot | ~0% | 50% | 25% | 25% | 0 |
77
- | GPT-3-Ada‡ | ✘ | ----- | 9.95 | 51.6% | 52.9% | 43.4% | 70.5% | ----- |
78
- | GPT-2-1.5B | ✔ | ----- | 10.63 | 51.21% | 59.4% | 50.9% | 70.8% | 40 |
79
- | GPTNeo-1.3B‡ | ✔ | 3.0e21 | 7.50 | 57.2% | 55.0% | 48.9% | 71.1% | 825 |
80
- | Megatron-2.5B* | ✘ | 2.4e21 | ----- | 61.7% | ----- | ----- | ----- | 174 |
81
- | GPTNeo-2.7B‡ | ✔ | 6.8e21 | 5.63 | 62.2% | 56.5% | 55.8% | 73.0% | 825 |
82
- | GPT-3-1.3B*‡ | ✘ | 2.4e21 | 5.44 | 63.6% | 58.7% | 54.7% | 75.1% | ~800 |
83
- | GPT-3-Babbage‡ | ✘ | ----- | 5.58 | 62.4% | 59.0% | 54.5% | 75.5% | ----- |
84
- | Megatron-8.3B* | ✘ | 7.8e21 | ----- | 66.5% | ----- | ----- | ----- | 174 |
85
- | GPT-3-2.7B*‡ | ✘ | 4.8e21 | 4.60 | 67.1% | 62.3% | 62.8% | 75.6% | ~800 |
86
- | Megatron-11B† | ✔ | 1.0e22 | ----- | ----- | ----- | ----- | ----- | 161 |
87
- | **GPT-J-6B**‡ | ✔ | **1.5e22** | **3.99** | **69.7%** | **65.3%** | **66.1%** | **76.5%** | **825** |
88
- | GPT-3-6.7B*‡ | ✘ | 1.2e22 | 4.00 | 70.3% | 64.5% | 67.4% | 78.0% | ~800 |
89
- | GPT-3-Curie‡ | ✘ | ----- | 4.00 | 69.3% | 65.6% | 68.5% | 77.9% | ----- |
90
- | GPT-3-13B*‡ | ✘ | 2.3e22 | 3.56 | 72.5% | 67.9% | 70.9% | 78.5% | ~800 |
91
- | GPT-3-175B*‡ | ✘ | 3.1e23 | 3.00 | 76.2% | 70.2% | 78.9% | 81.0% | ~800 |
92
- | GPT-3-Davinci‡ | ✘ | ----- | 3.0 | 75% | 72% | 78% | 80% | ----- |
93
-
94
- `*` represents evaluation numbers reported by their respective authors, all other numbers are provided by
95
- running the [lm-evaluation-harness](https://github.com/EleutherAI/lm-evaluation-harness/) either with the released
 
96
  weights or with API access. Due to subtle implementation differences as well as different zero shot task framing, these
97
- might not be directly comparable. See [this blog post](https://www.eleuther.ai/research-log/gpt3-model-sizes/) for more
98
- details.
99
 
100
- `†` The Megatron-11B model provides no comparable metrics, and several implementations using the released weights do not
101
- reproduce the generation quality and evaluations. (see [1](https://github.com/huggingface/transformers/pull/10301)
102
- [2](https://github.com/pytorch/fairseq/issues/2358) [3](https://github.com/pytorch/fairseq/issues/2719))
103
- Thus, evaluation was not attempted.
104
 
105
- `‡` These models have been trained with data which contains possible test set contamination. The OpenAI GPT-3 models
106
  failed to deduplicate training data for certain test sets, while the GPT-Neo models as well as this one is
107
- trained on The Pile, which has not been deduplicated against any test sets.
108
-
109
- ### Down-Stream Applications
110
 
111
- TBD
112
-
113
- ## Citation and Related Info
114
 
115
  ### BibTeX entry
116
 
117
  To cite this model:
118
- ```
119
  @misc{gpt-j,
120
  author = {Wang, Ben and Komatsuzaki, Aran},
121
  title = {{GPT-J-6B: A 6 Billion Parameter Autoregressive Language Model}},
@@ -125,9 +124,8 @@ To cite this model:
125
  }
126
  ```
127
 
128
-
129
  To cite the codebase that trained this model:
130
- ```
131
  @misc{mesh-transformer-jax,
132
  author = {Wang, Ben},
133
  title = {{Mesh-Transformer-JAX: Model-Parallel Implementation of Transformer Language Model with JAX}},
@@ -137,21 +135,17 @@ To cite the codebase that trained this model:
137
  }
138
  ```
139
 
140
- If you use this repository or any of the pretrained weights to do something cool, we would love to hear about it! Reach out on the [GitHub repo](https://github.com/kingoflolz/mesh-transformer-jax), Discord, or shoot Ben an email.
141
 
142
  ## Acknowledgements
143
 
144
-
145
- This project would not have been possible without compute generously provided by the
146
- [TPU Research Cloud](https://sites.research.google/trc/) and [EleutherAI](https://eleuther.ai/).
147
-
148
- Thanks to the Cloud TPU team at Google for providing early access to the Cloud TPU VM alpha
149
- ([now publicly available!](https://cloud.google.com/blog/products/compute/introducing-cloud-tpu-vms))
150
 
151
  Thanks to everyone who have helped out one way or another (listed alphabetically):
152
  - [James Bradbury](https://twitter.com/jekbradbury) for valuable assistance with debugging JAX issues.
153
- - [Stella Biderman](https://www.stellabiderman.com), Kurumuz, and [Finetune](https://github.com/finetuneanon/) for converting the model to be compatible with the `transformers` package.
154
  - [Leo Gao](https://twitter.com/nabla_theta) for running zero shot evaluations for the baseline models for the table.
155
- - [Laurence Golding](https://github.com/researcher2) for adding some features to the web demo.
156
  - [Aran Komatsuzaki](https://twitter.com/arankomatsuzaki) for advice with experiment design and writing the blog posts.
157
- - [Janko Prester](https://github.com/jprester) for creating the web demo frontend.
 
6
  - causal-lm
7
  license: apache-2.0
8
  datasets:
9
+ - The Pile
10
+
11
  ---
12
 
13
  # GPT-J 6B
14
 
15
  ## Model Description
16
 
17
+ GPT-J 6B is a transformer model trained using Ben Wang's [Mesh Transformer JAX](https://github.com/kingoflolz/mesh-transformer-jax/). "GPT-J" refers to the class of model, while "6B" represents the number of trainable parameters.
18
 
19
+ <figure>
 
 
 
 
 
 
 
 
 
 
 
20
 
21
+ | Hyperparameter | Value |
22
+ |----------------------|---------------|
23
+ | \\(n_{parameters}\\) | 6,053,381,344 |
24
+ | \\(n_{layers}\\) | 28&ast; |
25
+ | \\(d_{model}\\) | 4,096 |
26
+ | \\(d_{ff}\\) | 16,384 |
27
+ | \\(n_{heads}\\) | 16 |
28
+ | \\(d_{head}\\) | 256 |
29
+ | \\(n_{ctx}\\) | 2,048 |
30
+ | \\(n_{vocab}\\) | 50,257 (same tokenizer as GPT-2/3) |
31
+ | Positional Encoding | [Rotary Position Embedding (RoPE)](https://arxiv.org/abs/2104.09864) |
32
+ | RoPE Dimensions | [64](https://github.com/kingoflolz/mesh-transformer-jax/blob/f2aa66e0925de6593dcbb70e72399b97b4130482/mesh_transformer/layers.py#L223) |
33
+ <figcaption><strong>&ast;</strong> Each layer consists of one feedforward block and one self attention block.</figcaption></figure>
34
 
35
  The model consists of 28 layers with a model dimension of 4096, and a feedforward dimension of 16384. The model
36
+ dimension is split into 16 heads, each with a dimension of 256. Rotary Position Embedding (RoPE) is applied to 64
37
  dimensions of each head. The model is trained with a tokenization vocabulary of 50257, using the same set of BPEs as
38
  GPT-2/GPT-3.
39
 
40
  ## Training data
41
 
42
+ GPT-J 6B was trained on [the Pile](https://pile.eleuther.ai), a large-scale curated dataset created by [EleutherAI](https://www.eleuther.ai).
43
 
44
  ## Training procedure
45
 
46
+ 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.
47
 
48
  ## Intended Use and Limitations
49
 
50
+ 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.
51
 
52
  ### How to use
53
 
54
  You can use this model directly with a pipeline for text generation. This example generates a different sequence each time it's run:
55
 
56
+ ```python
57
  >>> from transformers import pipeline
58
  >>> generator = pipeline('text-generation', model='EleutherAI/gpt-j-6B')
59
  >>> generator("EleutherAI has", do_sample=True, min_length=50)
 
63
 
64
  ### Limitations and Biases
65
 
66
+ 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.
67
+
68
+ 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](https://arxiv.org/abs/2101.00027) for a more detailed analysis of the biases in the Pile.
69
+
70
+ 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.
71
+
72
+ ## Evaluation results
73
+
74
+ <figure>
75
+
76
+ | Model | Public | Training FLOPs | LAMBADA PPL ↓ | LAMBADA Acc ↑ | Winogrande ↑ | Hellaswag ↑ | PIQA ↑ | Dataset Size (GB) |
77
+ |--------------------------|-------------|----------------|--- |--- |--- |--- |--- |-------------------|
78
+ | Random Chance | &check; | 0 | ~a lot | ~0% | 50% | 25% | 25% | 0 |
79
+ | GPT-3 Ada&ddagger; | &cross; | ----- | 9.95 | 51.6% | 52.9% | 43.4% | 70.5% | ----- |
80
+ | GPT-2 1.5B | &check; | ----- | 10.63 | 51.21% | 59.4% | 50.9% | 70.8% | 40 |
81
+ | GPT-Neo 1.3B&ddagger; | &check; | 3.0e21 | 7.50 | 57.2% | 55.0% | 48.9% | 71.1% | 825 |
82
+ | Megatron-2.5B&ast; | &cross; | 2.4e21 | ----- | 61.7% | ----- | ----- | ----- | 174 |
83
+ | GPT-Neo 2.7B&ddagger; | &check; | 6.8e21 | 5.63 | 62.2% | 56.5% | 55.8% | 73.0% | 825 |
84
+ | GPT-3 1.3B&ast;&ddagger; | &cross; | 2.4e21 | 5.44 | 63.6% | 58.7% | 54.7% | 75.1% | ~800 |
85
+ | GPT-3 Babbage&ddagger; | &cross; | ----- | 5.58 | 62.4% | 59.0% | 54.5% | 75.5% | ----- |
86
+ | Megatron-8.3B&ast; | &cross; | 7.8e21 | ----- | 66.5% | ----- | ----- | ----- | 174 |
87
+ | GPT-3 2.7B&ast;&ddagger; | &cross; | 4.8e21 | 4.60 | 67.1% | 62.3% | 62.8% | 75.6% | ~800 |
88
+ | Megatron-11B&dagger; | &check; | 1.0e22 | ----- | ----- | ----- | ----- | ----- | 161 |
89
+ | **GPT-J 6B&ddagger;** | **&check;** | **1.5e22** | **3.99** | **69.7%** | **65.3%** | **66.1%** | **76.5%** | **825** |
90
+ | GPT-3 6.7B&ast;&ddagger; | &cross; | 1.2e22 | 4.00 | 70.3% | 64.5% | 67.4% | 78.0% | ~800 |
91
+ | GPT-3 Curie&ddagger; | &cross; | ----- | 4.00 | 69.3% | 65.6% | 68.5% | 77.9% | ----- |
92
+ | GPT-3 13B&ast;&ddagger; | &cross; | 2.3e22 | 3.56 | 72.5% | 67.9% | 70.9% | 78.5% | ~800 |
93
+ | GPT-3 175B&ast;&ddagger; | &cross; | 3.1e23 | 3.00 | 76.2% | 70.2% | 78.9% | 81.0% | ~800 |
94
+ | GPT-3 Davinci&ddagger; | &cross; | ----- | 3.0 | 75% | 72% | 78% | 80% | ----- |
95
+ <figcaption><p>Models roughly sorted by performance, or by FLOPs if not available.</p>
96
+
97
+ <p><strong>&ast;</strong> Evaluation numbers reported by their respective authors. All other numbers are provided by
98
+ running <a href="https://github.com/EleutherAI/lm-evaluation-harness/"><code>lm-evaluation-harness</code></a> either with released
99
  weights or with API access. Due to subtle implementation differences as well as different zero shot task framing, these
100
+ might not be directly comparable. See <a href="https://blog.eleuther.ai/gpt3-model-sizes/">this blog post</a> for more
101
+ details.</p>
102
 
103
+ <p><strong>†</strong> Megatron-11B provides no comparable metrics, and several implementations using the released weights do not
104
+ reproduce the generation quality and evaluations. (see <a href="https://github.com/huggingface/transformers/pull/10301">1</a>
105
+ <a href="https://github.com/pytorch/fairseq/issues/2358">2</a> <a href="https://github.com/pytorch/fairseq/issues/2719">3</a>)
106
+ Thus, evaluation was not attempted.</p>
107
 
108
+ <p><strong>‡</strong> These models have been trained with data which contains possible test set contamination. The OpenAI GPT-3 models
109
  failed to deduplicate training data for certain test sets, while the GPT-Neo models as well as this one is
110
+ trained on the Pile, which has not been deduplicated against any test sets.</p></figcaption></figure>
 
 
111
 
112
+ ## Citation and Related Information
 
 
113
 
114
  ### BibTeX entry
115
 
116
  To cite this model:
117
+ ```bibtex
118
  @misc{gpt-j,
119
  author = {Wang, Ben and Komatsuzaki, Aran},
120
  title = {{GPT-J-6B: A 6 Billion Parameter Autoregressive Language Model}},
 
124
  }
125
  ```
126
 
 
127
  To cite the codebase that trained this model:
128
+ ```bibtex
129
  @misc{mesh-transformer-jax,
130
  author = {Wang, Ben},
131
  title = {{Mesh-Transformer-JAX: Model-Parallel Implementation of Transformer Language Model with JAX}},
 
135
  }
136
  ```
137
 
138
+ If you use this model, we would love to hear about it! Reach out on [GitHub](https://github.com/kingoflolz/mesh-transformer-jax), Discord, or shoot Ben an email.
139
 
140
  ## Acknowledgements
141
 
142
+ This project would not have been possible without compute generously provided by Google through the
143
+ [TPU Research Cloud](https://sites.research.google/trc/), as well as the Cloud TPU team for providing early access to the [Cloud TPU VM](https://cloud.google.com/blog/products/compute/introducing-cloud-tpu-vms) Alpha.
 
 
 
 
144
 
145
  Thanks to everyone who have helped out one way or another (listed alphabetically):
146
  - [James Bradbury](https://twitter.com/jekbradbury) for valuable assistance with debugging JAX issues.
147
+ - [Stella Biderman](www.stellabiderman.com), [Kurumuz](https://github.com/kurumuz/), and [Finetune](https://github.com/finetuneanon/) for converting the model to be compatible with the `transformers` package.
148
  - [Leo Gao](https://twitter.com/nabla_theta) for running zero shot evaluations for the baseline models for the table.
149
+ - [Laurence Golding](https://github.com/researcher2/) for adding some features to the web demo.
150
  - [Aran Komatsuzaki](https://twitter.com/arankomatsuzaki) for advice with experiment design and writing the blog posts.
151
+ - [Janko Prester](https://github.com/jprester/) for creating the web demo frontend.