patrickvonplaten
commited on
Commit
•
97c3f46
1
Parent(s):
04e12f0
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language: en
|
3 |
+
tags:
|
4 |
+
- opt
|
5 |
+
|
6 |
+
license: mit
|
7 |
+
---
|
8 |
+
|
9 |
+
|
10 |
+
# OPT : Open Pre-trained Transformer Language Models
|
11 |
+
|
12 |
+
OPT was predominantly pretrained with English text, but a small amount of non-English data is still present within the training corpus via CommonCrawl. The model was pretrained using a causal language modeling (CLM) objective.
|
13 |
+
|
14 |
+
OPT was first introduced in [Open Pre-trained Transformer Language Models](https://arxiv.org/abs/2205.01068) and first released in [metaseq's repository](https://github.com/facebookresearch/metaseq) on May 3rd 2022 by Meta AI.
|
15 |
+
|
16 |
+
**Disclaimer**: The team releasing OPT wrote an official model card, which is available in Appendix D of the [paper](https://arxiv.org/pdf/2205.01068.pdf).
|
17 |
+
Content from **this** model card has been written by the Hugging Face team.
|
18 |
+
|
19 |
+
## Model description
|
20 |
+
|
21 |
+
OPT belongs to the same family of decoder-only models like [GPT-3](https://arxiv.org/abs/2005.14165). As such, it was pretrained using the self-supervised causal language modedling
|
22 |
+
objective.
|
23 |
+
|
24 |
+
For evaluation, OPT follows [GPT-3](https://arxiv.org/abs/2005.14165) by using their prompts and overall experimental setup. For more details, please read
|
25 |
+
the [official paper](https://arxiv.org/abs/2205.01068).
|
26 |
+
|
27 |
+
## Intended uses & limitations
|
28 |
+
|
29 |
+
The pretrained-only model can be used for prompting for evaluation of downstream tasks as well as text generation.
|
30 |
+
In addition, the model can be fine-tuned on a downstream task using the [CLM example](https://github.com/huggingface/transformers/tree/main/examples/pytorch/language-modeling). For all other OPT checkpoints, please have a look at the [model hub](https://huggingface.co/models?filter=opt).
|
31 |
+
|
32 |
+
### How to use
|
33 |
+
|
34 |
+
You can use this model directly with a pipeline for text generation.
|
35 |
+
|
36 |
+
```python
|
37 |
+
>>> from transformers import pipeline
|
38 |
+
|
39 |
+
>>> generator = pipeline('text-generation', model="facebook/opt-125m")
|
40 |
+
>>> generator("Hello, I'm am conscious and")
|
41 |
+
[{'generated_text': "Hello, I'm am conscious and conscious :) :) Anyway��極��極��極��極��極��極��極��極��極"}]
|
42 |
+
```
|
43 |
+
|
44 |
+
By default, generation is deterministic. In order to use the top-k sampling, please set `do_sample` to `True`.
|
45 |
+
|
46 |
+
```python
|
47 |
+
>>> from transformers import pipeline, set_seed
|
48 |
+
|
49 |
+
>>> set_seed(32)
|
50 |
+
>>> generator = pipeline('text-generation', model="facebook/opt-125m", do_sample=True)
|
51 |
+
>>> generator("Hello, I'm am conscious and")
|
52 |
+
[{'generated_text': "Hello, I'm am conscious and active observer!! HmmregorCLASSIFIEDドラゴン覚醒ドラゴンドラゴン覚醒覚醒ドラゴン"}]
|
53 |
+
```
|
54 |
+
|
55 |
+
### Limitations and bias
|
56 |
+
|
57 |
+
As mentioned in Meta AI's model card, given that the training data used for this model contains a lot of
|
58 |
+
unfiltered content from the internet, which is far from neutral the model is strongly biased :
|
59 |
+
|
60 |
+
> Like other large language models for which the diversity (or lack thereof) of training
|
61 |
+
> data induces downstream impact on the quality of our model, OPT-175B has limitations in terms
|
62 |
+
> of bias and safety. OPT-175B can also have quality issues in terms of generation diversity and
|
63 |
+
> hallucination. In general, OPT-175B is not immune from the plethora of issues that plague modern
|
64 |
+
> large language models.
|
65 |
+
|
66 |
+
This bias will also affect all fine-tuned versions of this model.
|
67 |
+
|
68 |
+
## Training data
|
69 |
+
|
70 |
+
The Meta AI team wanted to train this model on a corpus as large as possible. It is composed of the union of the following 5 filtered datasets of textual documents:
|
71 |
+
|
72 |
+
- BookCorpus, which consists of more than 10K unpublished books,
|
73 |
+
- CC-Stories, which contains a subset of CommonCrawl data filtered to match the
|
74 |
+
story-like style of Winograd schemas,
|
75 |
+
- The Pile, from which * Pile-CC, OpenWebText2, USPTO, Project Gutenberg, OpenSubtitles, Wikipedia, DM Mathematics and HackerNews* were included.
|
76 |
+
- Pushshift.io Reddit dataset that was developed in Baumgartner et al. (2020) and processed in
|
77 |
+
Roller et al. (2021)
|
78 |
+
- CCNewsV2 containing an updated version of the English portion of the CommonCrawl News
|
79 |
+
dataset that was used in RoBERTa (Liu et al., 2019b)
|
80 |
+
|
81 |
+
The final training data contains 180B tokens corresponding to 800GB of data. The validation split was made of 200MB of the pretraining data, sampled proportionally
|
82 |
+
to each dataset’s size in the pretraining corpus.
|
83 |
+
|
84 |
+
The dataset might contains offensive content as parts of the dataset are a subset of
|
85 |
+
public Common Crawl data, along with a subset of public Reddit data, which could contain sentences
|
86 |
+
that, if viewed directly, can be insulting, threatening, or might otherwise cause anxiety.
|
87 |
+
|
88 |
+
### Collection process
|
89 |
+
|
90 |
+
The dataset was collected form internet, and went through classic data processing algorithms and
|
91 |
+
re-formatting practices, including removing repetitive/non-informative text like *Chapter One* or
|
92 |
+
*This ebook by Project Gutenberg.*
|
93 |
+
|
94 |
+
## Training procedure
|
95 |
+
|
96 |
+
### Preprocessing
|
97 |
+
|
98 |
+
The texts are tokenized using the **GPT2** byte-level version of Byte Pair Encoding (BPE) (for unicode characters) and a
|
99 |
+
vocabulary size of 50272. The inputs are sequences of 2048 consecutive tokens.
|
100 |
+
|
101 |
+
The 175B model was trained on 992 *80GB A100 GPUs*. The training duration was roughly ~33 days of continuous training.
|
102 |
+
|
103 |
+
### BibTeX entry and citation info
|
104 |
+
|
105 |
+
```bibtex
|
106 |
+
@misc{zhang2022opt,
|
107 |
+
title={OPT: Open Pre-trained Transformer Language Models},
|
108 |
+
author={Susan Zhang and Stephen Roller and Naman Goyal and Mikel Artetxe and Moya Chen and Shuohui Chen and Christopher Dewan and Mona Diab and Xian Li and Xi Victoria Lin and Todor Mihaylov and Myle Ott and Sam Shleifer and Kurt Shuster and Daniel Simig and Punit Singh Koura and Anjali Sridhar and Tianlu Wang and Luke Zettlemoyer},
|
109 |
+
year={2022},
|
110 |
+
eprint={2205.01068},
|
111 |
+
archivePrefix={arXiv},
|
112 |
+
primaryClass={cs.CL}
|
113 |
+
}
|
114 |
+
```
|