Text Generation
Transformers
PyTorch
Safetensors
English
olmo
conversational
Inference Endpoints
hamishivi commited on
Commit
2ea9475
•
1 Parent(s): a93f078

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +165 -0
README.md ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ datasets:
4
+ - allenai/dolma
5
+ - allenai/tulu-v2-sft-mixture
6
+ - allenai/ultrafeedback_binarized_cleaned
7
+ language:
8
+ - en
9
+ ---
10
+
11
+
12
+ <img src="https://allenai.org/olmo/olmo-7b-animation.gif" alt="OLMo Logo" width="800" style="margin-left:'auto' margin-right:'auto' display:'block'"/>
13
+
14
+
15
+ # Model Card for OLMo 7B Instruct
16
+
17
+ <!-- Provide a quick summary of what the model is/does. -->
18
+
19
+ OLMo is a series of **O**pen **L**anguage **Mo**dels designed to enable the science of language models.
20
+ The OLMo base models are trained on the [Dolma](https://huggingface.co/datasets/allenai/dolma) dataset.
21
+ The adapted versions are trained on the [Tulu SFT mixture](https://huggingface.co/datasets/allenai/tulu-v2-sft-mixture) and, for the Instruct version, a [cleaned version of the UltraFeedback dataset](https://huggingface.co/datasets/allenai/ultrafeedback_binarized_cleaned).
22
+ We release all code, checkpoints, logs, and details involved in training these models.
23
+
24
+ OLMo 7B Instruct and OLMo SFT are two adapted versions of these models trained for better question answering.
25
+ They show the performance gain that OLMo base models can achieve with existing fine-tuning techniques.
26
+
27
+ **This version is for direct use with HuggingFace Transformers** from v4.40 on.
28
+
29
+
30
+ ## Model Details
31
+
32
+ We release two adapted model versions:
33
+ The base models related to this adapted model are the following:
34
+ | Model | Training Method(s) | Datasets | Context Length |
35
+ |------|--------|---------|--|
36
+ | [OLMo 7B SFT](https://huggingface.co/allenai/OLMo-7B-SFT) | SFT | [Tulu 2 SFT Mix](https://huggingface.co/datasets/allenai/tulu-v2-sft-mixture) | 2048 |
37
+ | [OLMo 7B Instruct](https://huggingface.co/allenai/OLMo-7B-Instruct) | SFT + DPO | [Tulu 2 SFT Mix](https://huggingface.co/datasets/allenai/tulu-v2-sft-mixture) + [Ultrafeedback Cleaned](https://huggingface.co/datasets/allenai/ultrafeedback_binarized_cleaned) | 2048 |
38
+
39
+
40
+ The base models related to this adapted model are the following:
41
+ | Size | Training Tokens | Layers | Hidden Size | Attention Heads | Context Length |
42
+ |------|--------|---------|-------------|-----------------|----------------|
43
+ | [OLMo 1B](https://huggingface.co/allenai/OLMo-1B) | 3 Trillion |16 | 2048 | 16 | 2048 |
44
+ | [OLMo 7B](https://huggingface.co/allenai/OLMo-7B) | 2.5 Trillion | 32 | 4096 | 32 | 2048 |
45
+ | [OLMo 7B Twin 2T](https://huggingface.co/allenai/OLMo-7B-Twin-2T) | 2 Trillion | 32 | 4096 | 32 | 2048 |
46
+
47
+
48
+ ### Model Description
49
+
50
+ <!-- Provide a longer summary of what this model is. -->
51
+
52
+ - **Developed by:** Allen Institute for AI (AI2)
53
+ - **Supported by:** Databricks, Kempner Institute for the Study of Natural and Artificial Intelligence at Harvard University, AMD, CSC (Lumi Supercomputer), UW
54
+ - **Model type:** a Transformer style autoregressive language model.
55
+ - **Language(s) (NLP):** English
56
+ - **License:** The code and model are released under Apache 2.0.
57
+ - **Contact:** Technical inquiries: `olmo at allenai dot org`. Press: `press at allenai dot org`
58
+ - **Date cutoff:** Feb./March 2023 based on Dolma dataset version.
59
+
60
+
61
+ ### Model Sources
62
+
63
+ <!-- Provide the basic links for the model. -->
64
+
65
+ - **Project Page:** https://allenai.org/olmo
66
+ - **Repositories:**
67
+ - Core repo (training, inference, fine-tuning etc.): https://github.com/allenai/OLMo
68
+ - Evaluation code: https://github.com/allenai/OLMo-Eval
69
+ - Further fine-tuning code: https://github.com/allenai/open-instruct
70
+ - **Paper:** [Link](https://arxiv.org/abs/2402.00838)
71
+ - **Technical blog post:** https://blog.allenai.org/olmo-open-language-model-87ccfc95f580
72
+ - **W&B Logs:** https://wandb.ai/ai2-llm/OLMo-7B/reports/OLMo-7B--Vmlldzo2NzQyMzk5
73
+ <!-- - **Press release:** TODO -->
74
+
75
+ ## Uses
76
+
77
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
78
+
79
+ ### Inference
80
+ You can load and run this model as usual so long as your HuggingFace version is >= 4.40:
81
+ ```python
82
+ from transformers import AutoModelForCausalLM, AutoTokenizer
83
+ olmo = AutoModelForCausalLM.from_pretrained("allenai/OLMo-7B-Instruct-hf")
84
+ tokenizer = AutoTokenizer.from_pretrained("allenai/OLMo-7B-Instruct-hf")
85
+ message = [{"role": "user", "content": "What is 2+2?"}]
86
+ inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt")
87
+ # optional verifying cuda
88
+ # inputs = {k: v.to('cuda') for k,v in inputs.items()}
89
+ # olmo = olmo.to('cuda')
90
+ response = olmo.generate(**inputs, max_new_tokens=100, do_sample=True, top_k=50, top_p=0.95)
91
+ print(tokenizer.batch_decode(response, skip_special_tokens=True)[0])
92
+ >> '2+2=4'
93
+ ```
94
+
95
+ ## Evaluation
96
+
97
+ <!-- This section describes the evaluation protocols and provides the results. -->
98
+
99
+ Core model results for the 7B adapted models are found below.
100
+
101
+ | Model | MMLU 0-shot ↑ | AlpacaEval %win ↑ | ToxiGen % Toxic ↓ | TruthfulQA %Info+True ↑ |
102
+ |-----------------------|---------------|--------------------|--------------------|-------------------------|
103
+ | **OLMo (base)** | 28.3 | - | 81.4 | 31.6 |
104
+ | MPT Chat | 33.8 | 46.8 | 0.1 | 42.7 |
105
+ | Falcon Instruct | 25.2 | 14.0 | 70.7 | 27.2 |
106
+ | RPJ-INCITE Chat | 27.0 | 38.0 | 46.4 | 53.0 |
107
+ | Llama-2-Chat 7B | 46.8 | 87.3 | 0.0 | 26.3 |
108
+ | AI2 Tulu 2 7B | 50.4 | 73.9 | 7.0 | 51.7 |
109
+ | AI2 Tulu 2 7B DPO | 50.7 | 85.1 | 0.5 | - * |
110
+ | **[OLMo 7B SFT](https://huggingface.co/allenai/OLMo-7B-SFT)** | 47.3 | 57.0 | 14.4 | 41.2 |
111
+ | **[OLMo 7B Instruct](https://huggingface.co/allenai/OLMo-7B-Instruct)** | 46.2 | 69.3 | 1.7 | 52.0 |
112
+
113
+ *Following Ivison et al. 2023, we do not report Tulu 2 TruthfulQA scores due to test set contamination.
114
+ ## Model Details
115
+
116
+ ### Data
117
+ For training data details, please see the [Dolma](https://huggingface.co/datasets/allenai/dolma), [Tulu 2](https://huggingface.co/datasets/allenai/tulu-v2-sft-mixture), and [UltraFeedback](https://huggingface.co/datasets/openbmb/UltraFeedback) documentation.
118
+
119
+ ### Architecture
120
+
121
+
122
+ ### Hyperparameters
123
+
124
+ The hyperparameters for the two phases of training are below:
125
+
126
+ | | Learning Rate | Beta | Epochs | Warmup | Weight Decay | Gradient Clipping | Maximum Sequence Length |
127
+ |-------------------------|---------------|------|--------|------------------------------------------------------------------------|--------------|-------------------|-------------------------|
128
+ | **SFT** | 2 × 10^-6 | N/A | 3 | Linear warmup for the first 3% of total training time, then cooldown to 0 | 0 | 0 | 2048 |
129
+ | **DPO** | 5 × 10^-7 | 0.1 | 3 | Linear warmup for the first 10% of total training time, then cooldown to 0| 0 | 0 | 2048 |
130
+
131
+ Compared to Tulu 2, DPO hyperparameters are the same. SFT is lower LR and 3 epochs instead of 2 (and 2k length instead of 8k).
132
+
133
+ ## Bias, Risks, and Limitations
134
+
135
+ This adapted OLMo model is a research artifact.
136
+ It is intended to benefit the research community interested in understanding the safety properties of LLMs and developers building safety tools for LLMs.
137
+ For this reason, the model does not include a specific safety filter or safety training data.
138
+ While our model scores well relative to its peers on ToxiGen, it is possible for the model to generate harmful and sensitive content from some user prompts.
139
+ We recommend developers exercise caution and consider the risks of the applications of this technology.
140
+ Furthermore, developers should consider implementing safeguards for biases, privacy, and other potential harms when appropriate.
141
+ Finally, as with every LLM, OLMo may produce factual-sounding outputs that may not be true, so developers and users are encouraged to confirm such outputs before relying on them.
142
+ All users of this model are responsible for how they use the model.
143
+
144
+
145
+ ## Citation
146
+
147
+ **BibTeX:**
148
+
149
+ ```
150
+ @article{Groeneveld2023OLMo,
151
+ title={OLMo: Accelerating the Science of Language Models},
152
+ author={Groeneveld, Dirk and Beltagy, Iz and Walsh, Pete and Bhagia, Akshita and Kinney, Rodney and Tafjord, Oyvind and Jha, Ananya Harsh and Ivison, Hamish and Magnusson, Ian and Wang, Yizhong and Arora, Shane and Atkinson, David and Authur, Russell and Chandu, Khyathi and Cohan, Arman and Dumas, Jennifer and Elazar, Yanai and Gu, Yuling and Hessel, Jack and Khot, Tushar and Merrill, William and Morrison, Jacob and Muennighoff, Niklas and Naik, Aakanksha and Nam, Crystal and Peters, Matthew E. and Pyatkin, Valentina and Ravichander, Abhilasha and Schwenk, Dustin and Shah, Saurabh and Smith, Will and Subramani, Nishant and Wortsman, Mitchell and Dasigi, Pradeep and Lambert, Nathan and Richardson, Kyle and Dodge, Jesse and Lo, Kyle and Soldaini, Luca and Smith, Noah A. and Hajishirzi, Hannaneh},
153
+ journal={Preprint},
154
+ year={2024}
155
+ }
156
+ ```
157
+
158
+ **APA:**
159
+
160
+ Groeneveld, D., Beltagy, I., Walsh, P., Bhagia, A., Kinney, R., Tafjord, O., Jha, A., Ivison, H., Magnusson, I., Wang, Y., Arora, S., Atkinson, D., Authur, R., Chandu, K., Cohan, A., Dumas, J., Elazar, Y., Gu, Y., Hessel, J., Khot, T., Merrill, W., Morrison, J., Muennighoff, N., Naik, A., Nam, C., Peters, M., Pyatkin, V., Ravichander, A., Schwenk, D., Shah, S., Smith, W., Subramani, N., Wortsman, M., Dasigi, P., Lambert, N., Richardson, K., Dodge, J., Lo, K., Soldaini, L., Smith, N., & Hajishirzi, H. (2024). OLMo: Accelerating the Science of Language Models. Preprint.
161
+
162
+ ## Model Card Contact
163
+
164
+
165
+ For errors in this model card, contact Nathan or Jacob, `{nathanl, jacobm} at allenai dot org`.