rskuzma commited on
Commit
1462e43
1 Parent(s): 035aabf

First README 13B

Browse files
Files changed (1) hide show
  1. README.md +187 -0
README.md CHANGED
@@ -1,3 +1,190 @@
1
  ---
 
 
 
 
 
2
  license: apache-2.0
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language:
3
+ - en
4
+ tags:
5
+ - pytorch
6
+ - causal-lm
7
  license: apache-2.0
8
+ datasets:
9
+ - the_pile
10
+ pipeline_tag: text-generation
11
  ---
12
+
13
+ # Cerebras-GPT 13B
14
+ [TODO: arXiv paper](https://www.cerebras.net), [TODO: Blog Post](https://www.cerebras.net)
15
+
16
+ ## Model Description
17
+
18
+ The Cerebras-GPT family is released to facilitate research into LLM scaling laws using open architectures and data sets and demonstrate the simplicity of and scalability of training LLMs on the Cerebras software and hardware stack. All Cerebras-GPT models are available on Hugging Face.
19
+
20
+ The family includes 111M, 256M, 590M, 1.3B, 2.7B, 6.7B, and 13B models.
21
+
22
+ All models in the Cerebras-GPT family have been trained in accordance with [Chinchilla scaling laws](https://arxiv.org/abs/2203.15556) (20 tokens per model parameter) which is compute-optimal.
23
+
24
+ These models were trained on the [Andromeda](https://www.cerebras.net/andromeda/) AI supercomputer comprised of 16 CS-2 wafer scale systems. Cerebras' [weight streaming technology](https://www.cerebras.net/blog/linear-scaling-made-possible-with-weight-streaming) simplifies the training of LLMs by disaggregating compute from model storage. This allowed for efficient scaling of training across nodes using simple data parallelism.
25
+
26
+ Cerebras systems for pre-training and fine tuning are available in the cloud via the [Cerebras Model Studio](https://www.cerebras.net/product-cloud/). Cerebras CS-2 compatible checkpoints are available in [Cerebras Model Zoo](https://github.com/Cerebras/modelzoo).
27
+
28
+ ## Model Details
29
+ * Developed by: [Cerebras Systems](https://www.cerebras.net/)
30
+ * License: Apache 2.0
31
+ * Model type: Transformer-based Language Model
32
+ * Architecture: GPT-3 style architecture
33
+ * Data set: The Pile
34
+ * Tokenizer: Byte Pair Encoding
35
+ * Vocabulary Size: 50257
36
+ * Sequence Length: 2048
37
+ * Optimizer: AdamW, (β1, β2) = (0.9, 0.95), adam_eps = 1e−8 (1e−9 for larger models)
38
+ * Positional Encoding: Learned
39
+ * Language: English
40
+ * Learn more: Dense Scaling Laws Paper for training procedure, config files, and details on how to use.
41
+
42
+ **Contact**: To ask questions about Cerebras-GPT models, join the Cerebras Discord, and post them in **#scaling-laws-release.**
43
+
44
+ This is the standard parameterization version of Cerebras-GPT with **13B** parameters
45
+
46
+ Related models: [Cerebras-GPT Models](https://huggingface.co/models?sort=downloads&search=cerebras-gpt)
47
+
48
+ <br><br>
49
+
50
+ | Model | Parameters | Layers | d_model | Heads | d_head | d_ffn | LR | BS (seq) | BS (tokens) |
51
+ |---------------|------------|--------|---------|-------|--------|--------|----------|----------|----------------|
52
+ | Cerebras-GPT | 111M | 10 | 768 | 12 | 64 | 3072 | 6.00E-04 | 120 | 246K |
53
+ | Cerebras-GPT | 256M | 14 | 1088 | 17 | 64 | 4352 | 6.00E-04 | 264 | 541K |
54
+ | Cerebras-GPT | 590M | 18 | 1536 | 12 | 128 | 6144 | 2.00E-04 | 264 | 541K |
55
+ | Cerebras-GPT | 1.3B | 24 | 2048 | 16 | 128 | 8192 | 2.00E-04 | 528 | 1.08M |
56
+ | Cerebras-GPT | 2.7B | 32 | 2560 | 20 | 128 | 10240 | 2.00E-04 | 528 | 1.08M |
57
+ | Cerebras-GPT | 6.7B | 32 | 4096 | 32 | 128 | 16384 | 1.20E-04 | 1040 | 2.13M |
58
+ | Cerebras-GPT | 13B | 40 | 5120 | 40 | 128 | 20480 | 1.20E-04 | 720/1080 | 1.47M/2.21M |
59
+
60
+ <br><br>
61
+
62
+ ## Quickstart
63
+
64
+ This model can be easily loaded using the AutoModelForCausalLM functionality:
65
+ ```python
66
+ from transformers import AutoTokenizer, AutoModelForCausalLM
67
+
68
+ tokenizer = AutoTokenizer.from_pretrained("Cerebras/Cerebras-GPT-13B")
69
+ model = AutoModelForCausalLM.from_pretrained("Cerebras/Cerebras-GPT-13B")
70
+
71
+ text = "Generative AI is "
72
+ ```
73
+
74
+ And can be used with Hugging Face Pipelines
75
+
76
+ ```python
77
+ from transformers import pipeline
78
+
79
+ pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
80
+ generated_text = pipe(text, max_length=50, do_sample=False, no_repeat_ngram_size=2)[0]
81
+ print(generated_text['generated_text'])
82
+ ```
83
+
84
+ or with `model.generate()`
85
+
86
+ ```python
87
+ inputs = tokenizer(text, return_tensors="pt")
88
+ outputs = model.generate(**inputs, num_beams=5,
89
+ max_new_tokens=50, early_stopping=True,
90
+ no_repeat_ngram_size=2)
91
+ text_output = tokenizer.batch_decode(outputs, skip_special_tokens=True)
92
+ print(text_output[0])
93
+ ```
94
+ <br><br>
95
+
96
+ ## Training data
97
+
98
+ Cerebras-GPT is trained using [the Pile](https://pile.eleuther.ai) dataset from [EleutherAI](https://www.eleuther.ai). See the [Pile paper](https://arxiv.org/abs/2101.00027) for a more detailed breakdown of data sources and methodology.
99
+
100
+ Recent works find significant duplicate data present in the Pile. Eleuther’s Pythia applies a deduplication process to reduce replicated data, decreasing the total token count by 33%. Our models are trained on the Pile **without deduplication**, which presents an opportunity for further improvement with the deduplicated data set.
101
+
102
+ Our tokenized version of the Pile has 371B tokens. We used byte-pair encoding, a vocabulary size of 50257, and a maximum sequence length of 2048. We include more details about the training dataset preprocessing in Appendix B.1 of [TODO: our paper](https://www.cerebras.net).
103
+
104
+ <br><br>
105
+
106
+ ## Training procedure
107
+
108
+ We use the GPT-3 style model architecture. All of our layers use full attention as opposed to the GPT-3 style sparse banded attention. The model shapes were selected to either follow aspect ratio 80 or are the same shape as GPT-3 models. Learning rate warmed up for 375M tokens (1500 steps for 111M and 256M models) and 10x cosine decayed. No dropout was used and weight decay was set to 0.1.
109
+
110
+ All models were trained to Chinchilla point: 20x more tokens than model parameters. Number of steps changed based on fixed batch size (2048) and sequence length (varied by model). See Training Table, below, for detail.
111
+
112
+ <br>
113
+
114
+ Model Params | Sequence Length | Batch Size | Number of Steps | Tokens | Tokens per Parameter | Flops
115
+ ------------ | -------------- | ---------- | --------------- | ------ | -------------------- | -----
116
+ 111M | 2048 | 120 | 9037 | 2.22E+09 | 20 | 2.5E+18
117
+ 256M | 2048 | 264 | 9468 | 5.12E+09 | 20 | 1.1E+19
118
+ 590M | 2048 | 264 | 21836 | 1.18E+10 | 20 | 5.3E+19
119
+ 1.3B | 2048 | 528 | 24334 | 2.63E+10 | 20 | 2.5E+20
120
+ 2.7B | 2048 | 528 | 49041 | 5.30E+10 | 20 | 9.8E+20
121
+ 6.7B | 2048 | 1040 | 62522 | 1.33E+11 | 20 | 5.9E+21
122
+ 13B | 2048 | 720 | 174335 | 2.57E+11 | 20 | 2.1E+22
123
+
124
+ <br><br>
125
+
126
+ ## Evaluations
127
+
128
+ We evaluate our models on the PILE validation set comprising 380M tokens. We also evaluate the public checkpoints of Pythia Eleuther (2022), OPT Zhang et al. (2022), GPT-NeoX 20B Black et al. (2022), and GPT-J 6B Wang & Komatsuzaki (2021). We trained models from smallest to largest and fit a power law as we went along. The power law was helpful for extrapolating the validation loss of the next largest model we trained and provided confidence about whether the training run was going well.
129
+
130
+ #### 0-shot Evaluation
131
+ | Model | Params | Training FLOPs | PILE test xent | Hella-Swag | PIQA | Wino-Grande | Lambada | ARC-e | ARC-c | OpenBookQA | Downstream Average |
132
+ | ------- | ----- | -------------- | -------------- | ---------- | ----- | ----------- | ------- | ----- | ----- | ---------- | ------------------ |
133
+ | Cerebras-GPT | 111M | 2.5E+18 | 2.566 | 0.268 | 0.594 | 0.488 | 0.194 | 0.380 | 0.166 | 0.118 | 0.315 |
134
+ | Cerebras-GPT | 256M | 1.1E+19 | 2.299 | 0.274 | 0.613 | 0.511 | 0.293 | 0.410 | 0.170 | 0.158 | 0.347 |
135
+ | Cerebras-GPT | 590M | 5.3E+19 | 2.184 | 0.291 | 0.627 | 0.498 | 0.366 | 0.464 | 0.190 | 0.158 | 0.370 |
136
+ | Cerebras-GPT | 1.3B | 2.5E+20 | 1.996 | 0.325 | 0.664 | 0.521 | 0.462 | 0.508 | 0.224 | 0.166 | 0.410 |
137
+ | Cerebras-GPT | 2.7B | 9.8E+20 | 1.834 | 0.386 | 0.701 | 0.559 | 0.567 | 0.571 | 0.246 | 0.206 | 0.462 |
138
+ | Cerebras-GPT | 6.7B | 5.9E+21 | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
139
+ | Cerebras-GPT | 13B | 2.1E+22 | 1.575 | 0.513 | 0.766 | 0.646 | 0.696 | 0.714 | 0.367 | 0.286 | 0.570 |
140
+
141
+ #### 5-shot Evaluation
142
+ | Model | Params | Hella-Swag | PIQA | Wino-Grande | Lambada | ARC-e | ARC-c | OpenBookQA |
143
+ | -------- | ----- | ----------| ----- | ----------- | -------| ----- | ----- | ---------- |
144
+ | Cerebras-GPT | 111M | 0.267 | 0.588 | 0.475 | 0.158 | 0.356 | 0.166 | 0.136 |
145
+ | Cerebras-GPT | 256M | 0.278 | 0.606 | 0.522 | 0.225 | 0.422 | 0.183 | 0.164 |
146
+ | Cerebras-GPT | 590M | 0.291 | 0.634 | 0.479 | 0.281 | 0.475 | 0.206 | 0.152 |
147
+ | Cerebras-GPT | 1.3B | 0.326 | 0.668 | 0.536 | 0.395 | 0.529 | 0.241 | 0.174 |
148
+ | Cerebras-GPT | 2.7B | 0.382 | 0.697 | 0.543 | 0.487 | 0.590 | 0.267 | 0.224 |
149
+ | Cerebras-GPT | 6.7B | TODO | TODO | TODO | TODO | TODO | TODO | TODO |
150
+ | Cerebras-GPT | 13B | 0.514 | 0.768 | 0.674 | 0.655 | 0.743 | 0.398 | 0.318 |
151
+
152
+
153
+ <br><br>
154
+
155
+ ## Uses and Limitations
156
+
157
+ ### Intended Use
158
+ The models we train are being open-sourced to further research into LLM scaling laws, but we release these models with a fully permissive Apache license for the community to use freely.
159
+
160
+ You may fine-tune and adapt Cerebras-GPT models for deployment via either Cerebras [Model Studio](https://www.cerebras.net/product-cloud/) or the Hugging Face Transformers Library. We recommend assessing potential bias and harms prior to deployment of any LLM.
161
+
162
+
163
+ ### Out of Scope Use
164
+ Cerebras-GPT models are trained on the Pile, with English language only, and are not suitable for machine translation tasks.
165
+
166
+ Cerebras-GPT models have not been tuned for human-facing dialog applications like chatbots and will not respond to prompts in a similar way to models that have received instruction tuning or reinforcement learning from human feedback (RLHF) like Flan-T5 or ChatGPT. Cerebras-GPT models can be tuned using those methods.
167
+
168
+ ### Risk and Bias
169
+ Like many large text corpora, the Pile contains offensive text. Cerebras-GPT models trained on this text may create offensive or undesirable text outputs regardless of whether the initial prompt is offensive. Human filtering of responses is recommended.
170
+
171
+ <br><br>
172
+
173
+ ## Citation and Related Information
174
+
175
+ ### BibTeX entry
176
+
177
+ To cite this model:
178
+ ```bibtex
179
+ @misc{Cerebras-GPT,
180
+ author = {Nolan Dey and Gurpreet Gosal and Charles Chen and Hemant Khachane and Ribhu Pathria and William Marshall and Marvin Tom and Joel Hestness},
181
+ title = {GPT-3 Scaling Laws for the PILE Dataset, Trained on the Cerebras Wafer-Scale Engine},
182
+ year = {2023},
183
+ month = {March},
184
+ howpublished = {\url{https://www.cerebras.net/TODO/dense-scaling-laws/TODO}}
185
+ }
186
+ ```
187
+
188
+ ## Acknowledgements
189
+
190
+ We are thankful to all Cerebras engineers, past and present, that made this work possible.