Text Generation
Transformers
Safetensors
English
olmo
conversational
Inference Endpoints
hamishivi commited on
Commit
9690399
•
1 Parent(s): 96018a6

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +156 -0
README.md ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 1.7 7B Instruct
16
+
17
+ **Requires transformers versions v4.40.0 or newer**
18
+
19
+
20
+ OLMo is a series of **O**pen **L**anguage **Mo**dels designed to enable the science of language models.
21
+ The OLMo base models are trained on the [Dolma](https://huggingface.co/datasets/allenai/dolma) dataset.
22
+ 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).
23
+
24
+ OLMo 1.7 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
+ ## Model Details
28
+
29
+ We release two adapted model versions:
30
+ | Model | Training Method(s) | Datasets | Context Length |
31
+ |------|--------|---------|--|
32
+ | [OLMo 1.7 7B SFT](https://huggingface.co/allenai/OLMo-1.7-7B-SFT-hf) | SFT | [Tulu 2 SFT Mix](https://huggingface.co/datasets/allenai/tulu-v2-sft-mixture) | 2048 |
33
+ | [OLMo 1.7 7B Instruct](https://huggingface.co/allenai/OLMo-1.7-7B-Instruct-hf) | 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 |
34
+
35
+ These models are both trained on top of OLMo 1.7 7b:
36
+ | Size | Training Tokens | Layers | Hidden Size | Attention Heads | Context Length |
37
+ |------|--------|---------|-------------|-----------------|----------------|
38
+ | [OLMo 1.7 7B](https://huggingface.co/allenai/OLMo-1.7-7B-hf) | 2.05 Trillion |32 | 4096 | 32 | 4096 |
39
+
40
+
41
+ ### Model Description
42
+
43
+ <!-- Provide a longer summary of what this model is. -->
44
+
45
+ - **Developed by:** Allen Institute for AI (AI2)
46
+ - **Supported by:** Databricks, Kempner Institute for the Study of Natural and Artificial Intelligence at Harvard University, AMD, CSC (Lumi Supercomputer), UW
47
+ - **Model type:** a Transformer style autoregressive language model.
48
+ - **Language(s) (NLP):** English
49
+ - **License:** The code and model are released under Apache 2.0.
50
+ - **Contact:** Technical inquiries: `olmo at allenai dot org`. Press: `press at allenai dot org`
51
+ - **Date cutoff:** Oct. 2023, with most data from Feb./March 2023 based on Dolma dataset version.
52
+
53
+
54
+ ### Model Sources
55
+
56
+ - **Project Page:** https://allenai.org/olmo
57
+ - **Repositories:**
58
+ - Core repo (training, inference, fine-tuning etc.): https://github.com/allenai/OLMo
59
+ - Evaluation code: https://github.com/allenai/OLMo-Eval
60
+ - Further fine-tuning code: https://github.com/allenai/open-instruct
61
+ - **Paper:** [Link](https://arxiv.org/abs/2402.00838)
62
+ - **Technical blog post:** https://blog.allenai.org/olmo-1-7-7b-a-24-point-improvement-on-mmlu-92b43f7d269d
63
+ - **W&B Logs:** [pretraining](https://wandb.ai/ai2-llm/OLMo-7B/groups/OLMo-1.7-7B), [annealing](https://wandb.ai/ai2-llm/OLMo-7B/groups/OLMo-1.7-7B-anneal)
64
+ <!-- - **Press release:** TODO -->
65
+
66
+ ### Inference
67
+
68
+ You can run these models using recent (>= 4.40) versions of transformers.
69
+
70
+ ```python
71
+ from transformers import AutoModelForCausalLM, AutoTokenizer
72
+ olmo = AutoModelForCausalLM.from_pretrained("allenai/OLMo-1.7-7B-SFT-hf")
73
+ tokenizer = AutoTokenizer.from_pretrained("allenai/OLMo-1.7-7B-SFT-hf")
74
+ chat = [
75
+ { "role": "user", "content": "What is language modeling?" },
76
+ ]
77
+ prompt = tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
78
+ inputs = tokenizer.encode(prompt, add_special_tokens=False, return_tensors="pt")
79
+ # optional verifying cuda
80
+ # inputs = {k: v.to('cuda') for k,v in inputs.items()}
81
+ # olmo = olmo.to('cuda')
82
+ response = olmo.generate(input_ids=inputs.to(olmo.device), max_new_tokens=100, do_sample=True, top_k=50, top_p=0.95)
83
+ print(tokenizer.batch_decode(response, skip_special_tokens=True)[0])
84
+ >> '<|user|>\nWhat is language modeling?\n<|assistant|>\nLanguage modeling is a type of natural language processing (NLP) task or machine learning task that...'
85
+ ```
86
+
87
+ You can make this slightly faster by quantizing the model, e.g. `OLMoForCausalLM.from_pretrained("allenai/OLMo-7B-Instruct", torch_dtype=torch.float16, load_in_8bit=True)` (requires `bitsandbytes`).
88
+ The quantized model is more sensitive to typing / cuda, so it is recommended to pass the inputs as `inputs.input_ids.to('cuda')` to avoid potential issues.
89
+
90
+
91
+ ## Evaluation
92
+
93
+ <!-- This section describes the evaluation protocols and provides the results. -->
94
+
95
+ Core model results for the 7B adapted models are found below.
96
+
97
+ | Model | MMLU 0-shot ↑ | AlpacaEval %win ↑ | ToxiGen % Toxic ↓ | TruthfulQA %Info+True ↑ |
98
+ |-----------------------|---------------|--------------------|--------------------|-------------------------|
99
+ | **OLMo 1.7 base** | 50.8 | - | 81.4 | 31.6 |
100
+ | **[OLMo 1.7 7B SFT](https://huggingface.co/allenai/OLMo-1.7-7B-SFT-hf)** | 54.2 | 70.9 | .1 | 44.4 |
101
+ | **[OLMo 1.7 7B Instruct](https://huggingface.co/allenai/OLMo-1.7-7B-Instruct-hf)** | 52.8 | 83.5 | 1.7 | 70.3 |
102
+
103
+
104
+
105
+ ## Model Details
106
+
107
+ ### Data
108
+ 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.
109
+
110
+ ### Architecture
111
+
112
+
113
+ ### Hyperparameters
114
+
115
+ The hyperparameters for the two phases of training are below:
116
+
117
+ | | Learning Rate | Beta | Epochs | Warmup | Weight Decay | Gradient Clipping | Maximum Sequence Length |
118
+ |-------------------------|---------------|------|--------|------------------------------------------------------------------------|--------------|-------------------|-------------------------|
119
+ | **SFT** | 2 × 10^-6 | N/A | 3 | Linear warmup for the first 3% of total training time, then cooldown to 0 | 0 | 0 | 4096 |
120
+ | **DPO** | 5 × 10^-7 | 0.1 | 3 | Linear warmup for the first 10% of total training time, then cooldown to 0| 0 | 0 | 4096 |
121
+
122
+ 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).
123
+
124
+ ## Bias, Risks, and Limitations
125
+
126
+ This adapted OLMo model is a research artifact.
127
+ It is intended to benefit the research community interested in understanding the safety properties of LLMs and developers building safety tools for LLMs.
128
+ For this reason, the model does not include a specific safety filter or safety training data.
129
+ 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.
130
+ We recommend developers exercise caution and consider the risks of the applications of this technology.
131
+ Furthermore, developers should consider implementing safeguards for biases, privacy, and other potential harms when appropriate.
132
+ 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.
133
+ All users of this model are responsible for how they use the model.
134
+
135
+
136
+ ## Citation
137
+
138
+ **BibTeX:**
139
+
140
+ ```
141
+ @article{Groeneveld2023OLMo,
142
+ title={OLMo: Accelerating the Science of Language Models},
143
+ 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},
144
+ journal={Preprint},
145
+ year={2024}
146
+ }
147
+ ```
148
+
149
+ **APA:**
150
+
151
+ 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.
152
+
153
+ ## Model Card Contact
154
+
155
+
156
+ For errors in this model card, contact Nathan or Jacob, `{nathanl, jacobm} at allenai dot org`.