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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Quantization made by Richard Erkhov.
|
2 |
+
|
3 |
+
[Github](https://github.com/RichardErkhov)
|
4 |
+
|
5 |
+
[Discord](https://discord.gg/pvy7H8DZMG)
|
6 |
+
|
7 |
+
[Request more models](https://github.com/RichardErkhov/quant_request)
|
8 |
+
|
9 |
+
|
10 |
+
pythia-410m-deduped - bnb 8bits
|
11 |
+
- Model creator: https://huggingface.co/EleutherAI/
|
12 |
+
- Original model: https://huggingface.co/EleutherAI/pythia-410m-deduped/
|
13 |
+
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
+
Original model description:
|
18 |
+
---
|
19 |
+
language:
|
20 |
+
- en
|
21 |
+
tags:
|
22 |
+
- pytorch
|
23 |
+
- causal-lm
|
24 |
+
- pythia
|
25 |
+
license: apache-2.0
|
26 |
+
datasets:
|
27 |
+
- EleutherAI/the_pile_deduplicated
|
28 |
+
---
|
29 |
+
|
30 |
+
The *Pythia Scaling Suite* is a collection of models developed to facilitate
|
31 |
+
interpretability research [(see paper)](https://arxiv.org/pdf/2304.01373.pdf).
|
32 |
+
It contains two sets of eight models of sizes
|
33 |
+
70M, 160M, 410M, 1B, 1.4B, 2.8B, 6.9B, and 12B. For each size, there are two
|
34 |
+
models: one trained on the Pile, and one trained on the Pile after the dataset
|
35 |
+
has been globally deduplicated. All 8 model sizes are trained on the exact
|
36 |
+
same data, in the exact same order. We also provide 154 intermediate
|
37 |
+
checkpoints per model, hosted on Hugging Face as branches.
|
38 |
+
|
39 |
+
The Pythia model suite was designed to promote scientific
|
40 |
+
research on large language models, especially interpretability research.
|
41 |
+
Despite not centering downstream performance as a design goal, we find the
|
42 |
+
models <a href="#evaluations">match or exceed</a> the performance of
|
43 |
+
similar and same-sized models, such as those in the OPT and GPT-Neo suites.
|
44 |
+
|
45 |
+
<details>
|
46 |
+
<summary style="font-weight:600">Details on previous early release and naming convention.</summary>
|
47 |
+
|
48 |
+
Previously, we released an early version of the Pythia suite to the public.
|
49 |
+
However, we decided to retrain the model suite to address a few hyperparameter
|
50 |
+
discrepancies. This model card <a href="#changelog">lists the changes</a>;
|
51 |
+
see appendix B in the Pythia paper for further discussion. We found no
|
52 |
+
difference in benchmark performance between the two Pythia versions.
|
53 |
+
The old models are
|
54 |
+
[still available](https://huggingface.co/models?other=pythia_v0), but we
|
55 |
+
suggest the retrained suite if you are just starting to use Pythia.<br>
|
56 |
+
**This is the current release.**
|
57 |
+
|
58 |
+
Please note that all models in the *Pythia* suite were renamed in January
|
59 |
+
2023. For clarity, a <a href="#naming-convention-and-parameter-count">table
|
60 |
+
comparing the old and new names</a> is provided in this model card, together
|
61 |
+
with exact parameter counts.
|
62 |
+
</details>
|
63 |
+
<br>
|
64 |
+
|
65 |
+
# Pythia-410M-deduped
|
66 |
+
|
67 |
+
## Model Details
|
68 |
+
|
69 |
+
- Developed by: [EleutherAI](http://eleuther.ai)
|
70 |
+
- Model type: Transformer-based Language Model
|
71 |
+
- Language: English
|
72 |
+
- Learn more: [Pythia's GitHub repository](https://github.com/EleutherAI/pythia)
|
73 |
+
for training procedure, config files, and details on how to use.
|
74 |
+
[See paper](https://arxiv.org/pdf/2304.01373.pdf) for more evals and implementation
|
75 |
+
details.
|
76 |
+
- Library: [GPT-NeoX](https://github.com/EleutherAI/gpt-neox)
|
77 |
+
- License: Apache 2.0
|
78 |
+
- Contact: to ask questions about this model, join the [EleutherAI
|
79 |
+
Discord](https://discord.gg/zBGx3azzUn), and post them in `#release-discussion`.
|
80 |
+
Please read the existing *Pythia* documentation before asking about it in the
|
81 |
+
EleutherAI Discord. For general correspondence: [contact@eleuther.
|
82 |
+
ai](mailto:contact@eleuther.ai).
|
83 |
+
|
84 |
+
<figure>
|
85 |
+
|
86 |
+
| Pythia model | Non-Embedding Params | Layers | Model Dim | Heads | Batch Size | Learning Rate | Equivalent Models |
|
87 |
+
| -----------: | -------------------: | :----: | :-------: | :---: | :--------: | :-------------------: | :--------------------: |
|
88 |
+
| 70M | 18,915,328 | 6 | 512 | 8 | 2M | 1.0 x 10<sup>-3</sup> | — |
|
89 |
+
| 160M | 85,056,000 | 12 | 768 | 12 | 2M | 6.0 x 10<sup>-4</sup> | GPT-Neo 125M, OPT-125M |
|
90 |
+
| 410M | 302,311,424 | 24 | 1024 | 16 | 2M | 3.0 x 10<sup>-4</sup> | OPT-350M |
|
91 |
+
| 1.0B | 805,736,448 | 16 | 2048 | 8 | 2M | 3.0 x 10<sup>-4</sup> | — |
|
92 |
+
| 1.4B | 1,208,602,624 | 24 | 2048 | 16 | 2M | 2.0 x 10<sup>-4</sup> | GPT-Neo 1.3B, OPT-1.3B |
|
93 |
+
| 2.8B | 2,517,652,480 | 32 | 2560 | 32 | 2M | 1.6 x 10<sup>-4</sup> | GPT-Neo 2.7B, OPT-2.7B |
|
94 |
+
| 6.9B | 6,444,163,072 | 32 | 4096 | 32 | 2M | 1.2 x 10<sup>-4</sup> | OPT-6.7B |
|
95 |
+
| 12B | 11,327,027,200 | 36 | 5120 | 40 | 2M | 1.2 x 10<sup>-4</sup> | — |
|
96 |
+
<figcaption>Engineering details for the <i>Pythia Suite</i>. Deduped and
|
97 |
+
non-deduped models of a given size have the same hyperparameters. “Equivalent”
|
98 |
+
models have <b>exactly</b> the same architecture, and the same number of
|
99 |
+
non-embedding parameters.</figcaption>
|
100 |
+
</figure>
|
101 |
+
|
102 |
+
## Uses and Limitations
|
103 |
+
|
104 |
+
### Intended Use
|
105 |
+
|
106 |
+
The primary intended use of Pythia is research on the behavior, functionality,
|
107 |
+
and limitations of large language models. This suite is intended to provide
|
108 |
+
a controlled setting for performing scientific experiments. We also provide
|
109 |
+
154 checkpoints per model: initial `step0`, 10 log-spaced checkpoints
|
110 |
+
`step{1,2,4...512}`, and 143 evenly-spaced checkpoints from `step1000` to
|
111 |
+
`step143000`. These checkpoints are hosted on Hugging Face as branches. Note
|
112 |
+
that branch `143000` corresponds exactly to the model checkpoint on the `main`
|
113 |
+
branch of each model.
|
114 |
+
|
115 |
+
You may also further fine-tune and adapt Pythia-410M-deduped for deployment,
|
116 |
+
as long as your use is in accordance with the Apache 2.0 license. Pythia
|
117 |
+
models work with the Hugging Face [Transformers
|
118 |
+
Library](https://huggingface.co/docs/transformers/index). If you decide to use
|
119 |
+
pre-trained Pythia-410M-deduped as a basis for your fine-tuned model, please
|
120 |
+
conduct your own risk and bias assessment.
|
121 |
+
|
122 |
+
### Out-of-scope use
|
123 |
+
|
124 |
+
The Pythia Suite is **not** intended for deployment. It is not a in itself
|
125 |
+
a product and cannot be used for human-facing interactions. For example,
|
126 |
+
the model may generate harmful or offensive text. Please evaluate the risks
|
127 |
+
associated with your particular use case.
|
128 |
+
|
129 |
+
Pythia models are English-language only, and are not suitable for translation
|
130 |
+
or generating text in other languages.
|
131 |
+
|
132 |
+
Pythia-410M-deduped has not been fine-tuned for downstream contexts in which
|
133 |
+
language models are commonly deployed, such as writing genre prose,
|
134 |
+
or commercial chatbots. This means XNPythia-410M-dedupedAME will **not**
|
135 |
+
respond to a given prompt the way a product like ChatGPT does. This is because,
|
136 |
+
unlike this model, ChatGPT was fine-tuned using methods such as Reinforcement
|
137 |
+
Learning from Human Feedback (RLHF) to better “follow” human instructions.
|
138 |
+
|
139 |
+
### Limitations and biases
|
140 |
+
|
141 |
+
The core functionality of a large language model is to take a string of text
|
142 |
+
and predict the next token. The token used by the model need not produce the
|
143 |
+
most “accurate” text. Never rely on Pythia-410M-deduped to produce factually accurate
|
144 |
+
output.
|
145 |
+
|
146 |
+
This model was trained on [the Pile](https://pile.eleuther.ai/), a dataset
|
147 |
+
known to contain profanity and texts that are lewd or otherwise offensive.
|
148 |
+
See [Section 6 of the Pile paper](https://arxiv.org/abs/2101.00027) for a
|
149 |
+
discussion of documented biases with regards to gender, religion, and race.
|
150 |
+
Pythia-410M-deduped may produce socially unacceptable or undesirable text, *even if*
|
151 |
+
the prompt itself does not include anything explicitly offensive.
|
152 |
+
|
153 |
+
If you plan on using text generated through, for example, the Hosted Inference
|
154 |
+
API, we recommend having a human curate the outputs of this language model
|
155 |
+
before presenting it to other people. Please inform your audience that the
|
156 |
+
text was generated by Pythia-410M-deduped.
|
157 |
+
|
158 |
+
### Quickstart
|
159 |
+
|
160 |
+
Pythia models can be loaded and used via the following code, demonstrated here
|
161 |
+
for the third `pythia-70m-deduped` checkpoint:
|
162 |
+
|
163 |
+
```python
|
164 |
+
from transformers import GPTNeoXForCausalLM, AutoTokenizer
|
165 |
+
|
166 |
+
model = GPTNeoXForCausalLM.from_pretrained(
|
167 |
+
"EleutherAI/pythia-70m-deduped",
|
168 |
+
revision="step3000",
|
169 |
+
cache_dir="./pythia-70m-deduped/step3000",
|
170 |
+
)
|
171 |
+
|
172 |
+
tokenizer = AutoTokenizer.from_pretrained(
|
173 |
+
"EleutherAI/pythia-70m-deduped",
|
174 |
+
revision="step3000",
|
175 |
+
cache_dir="./pythia-70m-deduped/step3000",
|
176 |
+
)
|
177 |
+
|
178 |
+
inputs = tokenizer("Hello, I am", return_tensors="pt")
|
179 |
+
tokens = model.generate(**inputs)
|
180 |
+
tokenizer.decode(tokens[0])
|
181 |
+
```
|
182 |
+
|
183 |
+
Revision/branch `step143000` corresponds exactly to the model checkpoint on
|
184 |
+
the `main` branch of each model.<br>
|
185 |
+
For more information on how to use all Pythia models, see [documentation on
|
186 |
+
GitHub](https://github.com/EleutherAI/pythia).
|
187 |
+
|
188 |
+
## Training
|
189 |
+
|
190 |
+
### Training data
|
191 |
+
|
192 |
+
Pythia-410M-deduped was trained on the Pile **after the dataset has been globally
|
193 |
+
deduplicated**.<br>
|
194 |
+
[The Pile](https://pile.eleuther.ai/) is a 825GiB general-purpose dataset in
|
195 |
+
English. It was created by EleutherAI specifically for training large language
|
196 |
+
models. It contains texts from 22 diverse sources, roughly broken down into
|
197 |
+
five categories: academic writing (e.g. arXiv), internet (e.g. CommonCrawl),
|
198 |
+
prose (e.g. Project Gutenberg), dialogue (e.g. YouTube subtitles), and
|
199 |
+
miscellaneous (e.g. GitHub, Enron Emails). See [the Pile
|
200 |
+
paper](https://arxiv.org/abs/2101.00027) for a breakdown of all data sources,
|
201 |
+
methodology, and a discussion of ethical implications. Consult [the
|
202 |
+
datasheet](https://arxiv.org/abs/2201.07311) for more detailed documentation
|
203 |
+
about the Pile and its component datasets. The Pile can be downloaded from
|
204 |
+
the [official website](https://pile.eleuther.ai/), or from a [community
|
205 |
+
mirror](https://the-eye.eu/public/AI/pile/).
|
206 |
+
|
207 |
+
### Training procedure
|
208 |
+
|
209 |
+
All models were trained on the exact same data, in the exact same order. Each
|
210 |
+
model saw 299,892,736,000 tokens during training, and 143 checkpoints for each
|
211 |
+
model are saved every 2,097,152,000 tokens, spaced evenly throughout training,
|
212 |
+
from `step1000` to `step143000` (which is the same as `main`). In addition, we
|
213 |
+
also provide frequent early checkpoints: `step0` and `step{1,2,4...512}`.
|
214 |
+
This corresponds to training for just under 1 epoch on the Pile for
|
215 |
+
non-deduplicated models, and about 1.5 epochs on the deduplicated Pile.
|
216 |
+
|
217 |
+
All *Pythia* models trained for 143000 steps at a batch size
|
218 |
+
of 2M (2,097,152 tokens).<br>
|
219 |
+
See [GitHub](https://github.com/EleutherAI/pythia) for more details on training
|
220 |
+
procedure, including [how to reproduce
|
221 |
+
it](https://github.com/EleutherAI/pythia/blob/main/README.md#reproducing-training).<br>
|
222 |
+
Pythia uses the same tokenizer as [GPT-NeoX-
|
223 |
+
20B](https://huggingface.co/EleutherAI/gpt-neox-20b).
|
224 |
+
|
225 |
+
## Evaluations
|
226 |
+
|
227 |
+
All 16 *Pythia* models were evaluated using the [LM Evaluation
|
228 |
+
Harness](https://github.com/EleutherAI/lm-evaluation-harness). You can access
|
229 |
+
the results by model and step at `results/json/*` in the [GitHub
|
230 |
+
repository](https://github.com/EleutherAI/pythia/tree/main/results/json/).<br>
|
231 |
+
Expand the sections below to see plots of evaluation results for all
|
232 |
+
Pythia and Pythia-deduped models compared with OPT and BLOOM.
|
233 |
+
|
234 |
+
<details>
|
235 |
+
<summary>LAMBADA – OpenAI</summary>
|
236 |
+
<img src="/EleutherAI/pythia-12b/resolve/main/eval_plots/lambada_openai_v1.png" style="width:auto"/>
|
237 |
+
</details>
|
238 |
+
|
239 |
+
<details>
|
240 |
+
<summary>Physical Interaction: Question Answering (PIQA)</summary>
|
241 |
+
<img src="/EleutherAI/pythia-12b/resolve/main/eval_plots/piqa_v1.png" style="width:auto"/>
|
242 |
+
</details>
|
243 |
+
|
244 |
+
<details>
|
245 |
+
<summary>WinoGrande</summary>
|
246 |
+
<img src="/EleutherAI/pythia-12b/resolve/main/eval_plots/winogrande_v1.png" style="width:auto"/>
|
247 |
+
</details>
|
248 |
+
|
249 |
+
<details>
|
250 |
+
<summary>AI2 Reasoning Challenge—Easy Set</summary>
|
251 |
+
<img src="/EleutherAI/pythia-12b/resolve/main/eval_plots/arc_easy_v1.png" style="width:auto"/>
|
252 |
+
</details>
|
253 |
+
|
254 |
+
<details>
|
255 |
+
<summary>SciQ</summary>
|
256 |
+
<img src="/EleutherAI/pythia-12b/resolve/main/eval_plots/sciq_v1.png" style="width:auto"/>
|
257 |
+
</details>
|
258 |
+
|
259 |
+
## Changelog
|
260 |
+
|
261 |
+
This section compares differences between previously released
|
262 |
+
[Pythia v0](https://huggingface.co/models?other=pythia_v0) and the current
|
263 |
+
models. See Appendix B of the Pythia paper for further discussion of these
|
264 |
+
changes and the motivation behind them. We found that retraining Pythia had no
|
265 |
+
impact on benchmark performance.
|
266 |
+
|
267 |
+
- All model sizes are now trained with uniform batch size of 2M tokens.
|
268 |
+
Previously, the models of size 160M, 410M, and 1.4B parameters were trained
|
269 |
+
with batch sizes of 4M tokens.
|
270 |
+
- We added checkpoints at initialization (step 0) and steps {1,2,4,8,16,32,64,
|
271 |
+
128,256,512} in addition to every 1000 training steps.
|
272 |
+
- Flash Attention was used in the new retrained suite.
|
273 |
+
- We remedied a minor inconsistency that existed in the original suite: all
|
274 |
+
models of size 2.8B parameters or smaller had a learning rate (LR) schedule
|
275 |
+
which decayed to a minimum LR of 10% the starting LR rate, but the 6.9B and
|
276 |
+
12B models all used an LR schedule which decayed to a minimum LR of 0. In
|
277 |
+
the redone training runs, we rectified this inconsistency: all models now were
|
278 |
+
trained with LR decaying to a minimum of 0.1× their maximum LR.
|
279 |
+
|
280 |
+
### Naming convention and parameter count
|
281 |
+
|
282 |
+
*Pythia* models were renamed in January 2023. It is possible that the old
|
283 |
+
naming convention still persists in some documentation by accident. The
|
284 |
+
current naming convention (70M, 160M, etc.) is based on total parameter count.
|
285 |
+
|
286 |
+
<figure style="width:32em">
|
287 |
+
|
288 |
+
| current Pythia suffix | old suffix | total params | non-embedding params |
|
289 |
+
| --------------------: | ---------: | -------------: | -------------------: |
|
290 |
+
| 70M | 19M | 70,426,624 | 18,915,328 |
|
291 |
+
| 160M | 125M | 162,322,944 | 85,056,000 |
|
292 |
+
| 410M | 350M | 405,334,016 | 302,311,424 |
|
293 |
+
| 1B | 800M | 1,011,781,632 | 805,736,448 |
|
294 |
+
| 1.4B | 1.3B | 1,414,647,808 | 1,208,602,624 |
|
295 |
+
| 2.8B | 2.7B | 2,775,208,960 | 2,517,652,480 |
|
296 |
+
| 6.9B | 6.7B | 6,857,302,016 | 6,444,163,072 |
|
297 |
+
| 12B | 13B | 11,846,072,320 | 11,327,027,200 |
|
298 |
+
</figure>
|
299 |
+
|