amanrangapur commited on
Commit
fc924f1
·
verified ·
1 Parent(s): fc6f527

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +161 -0
README.md ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ library_name: transformers
6
+ ---
7
+
8
+ ## Model Details
9
+
10
+ <img alt="OLMo Logo" src="https://huggingface.co/datasets/allenai/blog-images/resolve/main/olmo2/olmo.png" width="242px" style="margin-left:'auto' margin-right:'auto' display:'block'">
11
+
12
+
13
+ # Model Card for OLMo 2 1B
14
+
15
+ We introduce OLMo 2 1B, the smallest model in the OLMo 2 family.
16
+ OLMo 2 was pre-trained on [OLMo-mix-1124](https://huggingface.co/datasets/allenai/olmo-mix-1124)
17
+ and uses [Dolmino-mix-1124](https://huggingface.co/datasets/allenai/dolmino-mix-1124) for mid-training.
18
+
19
+ OLMo 2 is the latest in a series of **O**pen **L**anguage **Mo**dels designed to enable the science of language models.
20
+ We have released all code, checkpoints, logs, and associated training details on [GitHub](https://github.com/allenai/OLMo).
21
+
22
+ | Size | Training Tokens | Layers | Hidden Size | Attention Heads | Context Length |
23
+ |------|--------|---------|-------------|-----------------|----------------|
24
+ | [OLMo 2-1B](https://huggingface.co/allenai/OLMo-2-0425-1B) | 4 Trillion | X | X | X | X |
25
+ | [OLMo 2-7B](https://huggingface.co/allenai/OLMo-2-1124-7B) | 4 Trillion | 32 | 4096 | 32 | 4096 |
26
+ | [OLMo 2-13B](https://huggingface.co/allenai/OLMo-2-1124-13B) | 5 Trillion | 40 | 5120 | 40 | 4096 |
27
+ | [OLMo 2-32B](https://huggingface.co/allenai/OLMo-2-0325-32B) | 6 Trillion | 64 | 5120 | 40 | 4096 |
28
+
29
+ The core models released in this batch include the following:
30
+
31
+ | **Stage** | **OLMo 2 1B** | **OLMo 2 7B** | **OLMo 2 13B** | **OLMo 2 32B** |
32
+ |------------------------|--------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|
33
+ | **Base Model** | [allenai/OLMo-2-0425-1B](https://huggingface.co/allenai/OLMo-2-0425-1B) | [allenai/OLMo-2-1124-7B](https://huggingface.co/allenai/OLMo-2-1124-7B) | [allenai/OLMo-2-1124-13B](https://huggingface.co/allenai/OLMo-2-1124-13B) | [allenai/OLMo-2-0325-32B](https://huggingface.co/allenai/OLMo-2-0325-32B) |
34
+ | **SFT** | [allenai/OLMo-2-0425-1B-SFT](https://huggingface.co/allenai/OLMo-2-0425-1B-SFT) | [allenai/OLMo-2-1124-7B-SFT](https://huggingface.co/allenai/OLMo-2-1124-7B-SFT) | [allenai/OLMo-2-1124-13B-SFT](https://huggingface.co/allenai/OLMo-2-1124-13B-SFT) | [allenai/OLMo-2-0325-32B-SFT](https://huggingface.co/allenai/OLMo-2-0325-32B-SFT) |
35
+ | **DPO** | [allenai/OLMo-2-0425-1B-DPO](https://huggingface.co/allenai/OLMo-2-0425-1B-DPO) | [allenai/OLMo-2-1124-7B-DPO](https://huggingface.co/allenai/OLMo-2-1124-7B-DPO) | [allenai/OLMo-2-1124-13B-DPO](https://huggingface.co/allenai/OLMo-2-1124-13B-DPO) | [allenai/OLMo-2-0325-32B-DPO](https://huggingface.co/allenai/OLMo-2-0325-32B-DPO) |
36
+ | **Final Models (RLVR)**| [allenai/OLMo-2-0425-1B-Instruct](https://huggingface.co/allenai/OLMo-2-0425-1B-Instruct) | [allenai/OLMo-2-1124-7B-Instruct](https://huggingface.co/allenai/OLMo-2-1124-7B-Instruct) | [allenai/OLMo-2-1124-13B-Instruct](https://huggingface.co/allenai/OLMo-2-1124-13B-Instruct) | [allenai/OLMo-2-0325-32B-Instruct](https://huggingface.co/allenai/OLMo-2-0325-32B-Instruct) |
37
+ | **Reward Model (RM)** | | [allenai/OLMo-2-1124-7B-RM](https://huggingface.co/allenai/OLMo-2-1124-7B-RM) |(Same as 7B) | |
38
+
39
+ ## Installation
40
+
41
+ OLMo 2 1B is supported in transformers v4.48 or higher:
42
+ ```bash
43
+ pip install transformers>=4.48
44
+ ```
45
+
46
+ If using vLLM, you will need to install from the main branch until v0.7.4 is released. Please
47
+
48
+ ## Inference
49
+
50
+ You can use OLMo with the standard HuggingFace transformers library:
51
+ ```python
52
+ from transformers import AutoModelForCausalLM, AutoTokenizer
53
+ olmo = AutoModelForCausalLM.from_pretrained("allenai/OLMo-2-0425-1B")
54
+ tokenizer = AutoTokenizer.from_pretrained("allenai/OLMo-2-0425-1B")
55
+ message = ["Language modeling is "]
56
+ inputs = tokenizer(message, return_tensors='pt', return_token_type_ids=False)
57
+ # optional verifying cuda
58
+ # inputs = {k: v.to('cuda') for k,v in inputs.items()}
59
+ # olmo = olmo.to('cuda')
60
+ response = olmo.generate(**inputs, max_new_tokens=100, do_sample=True, top_k=50, top_p=0.95)
61
+ print(tokenizer.batch_decode(response, skip_special_tokens=True)[0])
62
+ >> 'Language modeling is a key component of any text-based application, but its effectiveness...'
63
+ ```
64
+
65
+ For faster performance, you can quantize the model using the following method:
66
+ ```python
67
+ AutoModelForCausalLM.from_pretrained("allenai/OLMo-2-0425-1B",
68
+ torch_dtype=torch.float16,
69
+ load_in_8bit=True) # Requires bitsandbytes
70
+ ```
71
+ The quantized model is more sensitive to data types and CUDA operations. To avoid potential issues, it's recommended to pass the inputs directly to CUDA using:
72
+ ```python
73
+ inputs.input_ids.to('cuda')
74
+ ```
75
+
76
+ We have released checkpoints for these models. For pretraining, the naming convention is `stage1-stepXXX-tokensYYYB`. For checkpoints with ingredients of the soup, the naming convention is `stage2-ingredientN-stepXXX-tokensYYYB`
77
+
78
+
79
+ To load a specific model revision with HuggingFace, simply add the argument `revision`:
80
+ ```bash
81
+ olmo = AutoModelForCausalLM.from_pretrained("allenai/OLMo-2-0425-1B", revision="step250000-tokens2098B")
82
+ ```
83
+
84
+ Or, you can access all the revisions for the models via the following code snippet:
85
+ ```python
86
+ from huggingface_hub import list_repo_refs
87
+ out = list_repo_refs("allenai/OLMo-2-0425-1B")
88
+ branches = [b.name for b in out.branches]
89
+ ```
90
+
91
+ ### Fine-tuning
92
+ TODO
93
+
94
+
95
+ ### Model Description
96
+
97
+ - **Developed by:** Allen Institute for AI (Ai2)
98
+ - **Model type:** a Transformer style autoregressive language model.
99
+ - **Language(s) (NLP):** English
100
+ - **License:** The code and model are released under Apache 2.0.
101
+ - **Contact:** Technical inquiries: `[email protected]`. Press: `[email protected]`
102
+ - **Date cutoff:** Dec. 2023.
103
+
104
+
105
+ ### Model Sources
106
+
107
+ - **Project Page:** https://allenai.org/olmo
108
+ - **Repositories:**
109
+ - Core repo (training, inference, fine-tuning etc.): https://github.com/allenai/OLMo
110
+ - Evaluation code: https://github.com/allenai/OLMo-Eval
111
+ - Further fine-tuning code: https://github.com/allenai/open-instruct
112
+ - **Paper:** https://arxiv.org/abs/2501.00656
113
+
114
+ ## Evaluation
115
+ Core model results for OLMo 2 1B are found below.
116
+
117
+ TODO
118
+
119
+ ## Model Details
120
+
121
+ ### Training
122
+ | | **OLMo 2 1B** | **OLMo 2 7B** | **OLMo 2 13B** | **OLMo 2 32B** |
123
+ |-------------------|------------|------------|------------|------------|
124
+ | Pretraining Stage 1 | 4 trillion tokens<br>(1 epoch) | 4 trillion tokens<br>(1 epoch) | 5 trillion tokens<br>(1.2 epochs) | 6 trillion tokens<br>(1.5 epochs) |
125
+ | Pretraining Stage 2 | 50B tokens (3 runs)<br>*merged* | 50B tokens (3 runs)<br>*merged* | 100B tokens (3 runs)<br>300B tokens (1 run)<br>*merged* | 100B tokens (3 runs)<br>300B tokens (1 run)<br>*merged* |
126
+ | Post-training | SFT + DPO + PPO<br>([preference mix](#)) | SFT + DPO + PPO<br>([preference mix](https://huggingface.co/datasets/allenai/olmo-2-1124-7b-preference-mix)) | SFT + DPO + PPO<br>([preference mix](https://huggingface.co/datasets/allenai/olmo-2-1124-13b-preference-mix)) | SFT + DPO + PPO<br>([preference mix](https://huggingface.co/datasets/allenai/olmo-2-32b-pref-mix-v1)) |
127
+
128
+ #### Stage 1: Initial Pretraining
129
+ - Dataset: [OLMo-mix-1124](https://huggingface.co/datasets/allenai/olmo-mix-1124) (3.9T tokens)
130
+ - Coverage: 95%+ of total pretraining budget
131
+ - 1B Model: ~1 epoch
132
+
133
+ #### Stage 2: Mid-training
134
+ - Dataset: Dolmino-Mix-1124
135
+ - Three training mixes:
136
+ - 50B tokens
137
+ - Mix composition: 50% high-quality web data + academic/Q&A/instruction/math content
138
+
139
+ #### Model Merging
140
+ - 32B Model: 3 versions on 100B mix + 1 version on 300B mix, merged for final checkpoint
141
+
142
+
143
+ ## Bias, Risks, and Limitations
144
+ Like any base or fine-tuned language model, AI can be prompted by users to generate harmful and sensitive content. Such content may also be produced unintentionally, especially in cases involving bias, so we recommend that users consider the risks when applying this technology. Additionally, many statements from OLMo or any LLM are often inaccurate, so facts should be verified.
145
+
146
+
147
+ ## Citation
148
+ ```
149
+ @misc{olmo20242olmo2furious,
150
+ title={{2 OLMo 2 Furious}},
151
+ author={Team OLMo and Pete Walsh and Luca Soldaini and Dirk Groeneveld and Kyle Lo and Shane Arora and Akshita Bhagia and Yuling Gu and Shengyi Huang and Matt Jordan and Nathan Lambert and Dustin Schwenk and Oyvind Tafjord and Taira Anderson and David Atkinson and Faeze Brahman and Christopher Clark and Pradeep Dasigi and Nouha Dziri and Michal Guerquin and Hamish Ivison and Pang Wei Koh and Jiacheng Liu and Saumya Malik and William Merrill and Lester James V. Miranda and Jacob Morrison and Tyler Murray and Crystal Nam and Valentina Pyatkin and Aman Rangapur and Michael Schmitz and Sam Skjonsberg and David Wadden and Christopher Wilhelm and Michael Wilson and Luke Zettlemoyer and Ali Farhadi and Noah A. Smith and Hannaneh Hajishirzi},
152
+ year={2024},
153
+ eprint={2501.00656},
154
+ archivePrefix={arXiv},
155
+ primaryClass={cs.CL},
156
+ url={https://arxiv.org/abs/2501.00656},
157
+ }
158
+ ```
159
+
160
+ ## Model Card Contact
161
+ For errors in this model card, contact `[email protected]`.