Text Generation
Transformers
Safetensors
English
olmo2
unsloth
conversational
danielhanchen commited on
Commit
614e280
·
verified ·
1 Parent(s): 1dcc523

Add files using upload-large-folder tool

Browse files
README.md ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - unsloth
4
+ license: apache-2.0
5
+ language:
6
+ - en
7
+ datasets:
8
+ - allenai/RLVR-MATH
9
+ base_model:
10
+ - allenai/OLMo-2-0425-1B-Instruct
11
+ pipeline_tag: text-generation
12
+ library_name: transformers
13
+ ---
14
+
15
+ <img alt="OLMo Logo" src="https://huggingface.co/datasets/allenai/blog-images/resolve/main/olmo2/olmo.png" width="242px">
16
+
17
+ OLMo 2 1B Instruct April 2025 is post-trained variant of the [allenai/OLMo-2-0425-1B-RLVR1](https://huggingface.co/allenai/OLMo-2-0425-1B-RLVR1) model, which has undergone supervised finetuning on an OLMo-specific variant of the [Tülu 3 dataset](https://huggingface.co/datasets/allenai/tulu-3-sft-olmo-2-mixture-0225), further DPO training on [this dataset](https://huggingface.co/datasets/allenai/olmo-2-0425-1b-preference-mix), and final RLVR training on [this dataset](https://huggingface.co/datasets/allenai/RLVR-MATH).
18
+ Tülu 3 is designed for state-of-the-art performance on a diversity of tasks in addition to chat, such as MATH, GSM8K, and IFEval.
19
+ Check out the [OLMo 2 paper](https://arxiv.org/abs/2501.00656) or [Tülu 3 paper](https://arxiv.org/abs/2411.15124) for more details!
20
+
21
+ OLMo is a series of **O**pen **L**anguage **Mo**dels designed to enable the science of language models.
22
+ These models are trained on the Dolma dataset. We are releasing all code, checkpoints, logs, and associated training details.
23
+
24
+
25
+ ## Model description
26
+
27
+ - **Model type:** A model trained on a mix of publicly available, synthetic and human-created datasets.
28
+ - **Language(s) (NLP):** Primarily English
29
+ - **License:** Apache 2.0
30
+ - **Finetuned from model:** allenai/OLMo-2-0425-1B-RLVR1
31
+
32
+ ### Model Sources
33
+
34
+ - **Project Page:** https://allenai.org/olmo
35
+ - **Repositories:**
36
+ - Core repo (training, inference, fine-tuning etc.): https://github.com/allenai/OLMo-core
37
+ - Evaluation code: https://github.com/allenai/olmes
38
+ - Further fine-tuning code: https://github.com/allenai/open-instruct
39
+ - **Paper:** https://arxiv.org/abs/2501.00656
40
+ - **Demo:** https://playground.allenai.org/
41
+
42
+ ## Installation
43
+
44
+ OLMo 2 1B is supported in transformers v4.48 or higher:
45
+ ```bash
46
+ pip install transformers>=4.48
47
+ ```
48
+
49
+ If using vLLM, you will need to install from the main branch until v0.7.4 is released. Please
50
+
51
+ ## Using the model
52
+
53
+ ### Loading with HuggingFace
54
+
55
+ To load the model with HuggingFace, use the following snippet:
56
+ ```
57
+ from transformers import AutoModelForCausalLM
58
+
59
+ olmo_model = AutoModelForCausalLM.from_pretrained("allenai/OLMo-2-0425-1B-Instruct")
60
+ ```
61
+
62
+ ### Chat template
63
+
64
+ *NOTE: This is different than previous OLMo 2 and Tülu 3 models due to a minor change in configuration. It does NOT have the bos token before the rest. Our other models have <|endoftext|> at the beginning of the chat template.*
65
+
66
+ The chat template for our models is formatted as:
67
+ ```
68
+ <|user|>
69
+ How are you doing?
70
+ <|assistant|>
71
+ I'm just a computer program, so I don't have feelings, but I'm functioning as expected. How can I assist you today?<|endoftext|>
72
+ ```
73
+ Or with new lines expanded:
74
+ ```
75
+ <|user|>
76
+ How are you doing?
77
+ <|assistant|>
78
+ I'm just a computer program, so I don't have feelings, but I'm functioning as expected. How can I assist you today?<|endoftext|>
79
+ ```
80
+ It is embedded within the tokenizer as well, for `tokenizer.apply_chat_template`.
81
+
82
+ ### Intermediate Checkpoints
83
+
84
+ To facilitate research on RL finetuning, we have released our intermediate checkpoints during the model's RLVR training.
85
+ The model weights are saved every 20 training steps, and can be accessible in the revisions of the HuggingFace repository.
86
+ For example, you can load with:
87
+ ```
88
+ olmo_model = AutoModelForCausalLM.from_pretrained("allenai/OLMo-2-0425-1B-Instruct", revision="step_200")
89
+ ```
90
+
91
+ ### Bias, Risks, and Limitations
92
+
93
+ The OLMo-2 models have limited safety training, but are not deployed automatically with in-the-loop filtering of responses like ChatGPT, so the model can produce problematic outputs (especially when prompted to do so).
94
+
95
+
96
+ ## Performance
97
+
98
+ | Model | Average | AlpacaEval 2 LC | BBH | DROP | GSM8K | IFEval | MATH | MMLU | Safety | PopQA | TruthQA |
99
+ |-------|---------|-----------------|-----|------|-------|--------|------|------|--------|-------|---------|
100
+ | **OLMo 1B 0724** | 24.4 | 2.4 | 29.9 | 27.9 | 10.8 | 25.3 | 2.2 | 36.6 | 52.0 | 12.1 | 44.3 |
101
+ | **SmolLM2 1.7B** | 34.2 | 5.8 | 39.8 | 30.9 | 45.3 | 51.6 | 20.3 | 34.3 | 52.4 | 16.4 | 45.3 |
102
+ | **Gemma 3 1B** | 38.3 | 20.4 | 39.4 | 25.1 | 35.0 | 60.6 | 40.3 | 38.9 | 70.2 | 9.6 | 43.8 |
103
+ | **Llama 3.1 1B** | 39.3 | 10.1 | 40.2 | 32.2 | 45.4 | 54.0 | 21.6 | 46.7 | 87.2 | 13.8 | 41.5 |
104
+ | **Qwen 2.5 1.5B** | 41.7 | 7.4 | 45.8 | 13.4 | 66.2 | 44.2 | 40.6 | 59.7 | 77.6 | 15.5 | 46.5 |
105
+ | **---** | | | | | | | | | | | |
106
+ | **OLMo 2 1B SFT** | 36.9 | 2.4 | 32.8 | 33.8 | 52.1 | 50.5 | 13.2 | 36.4 | 93.2 | 12.7 | 42.1 |
107
+ | **OLMo 2 1B DPO** | 40.6 | 9.5 | 33.0 | 34.5 | 59.0 | 67.1 | 14.1 | 39.9 | 89.9 | 12.3 | 46.4 |
108
+ | **OLMo 2 1B** | 42.7 | 9.1 | 35.0 | 34.6 | 68.3 | 70.1 | 20.7 | 40.0 | 87.6 | 12.9 | 48.7 |
109
+
110
+
111
+
112
+ ## License and use
113
+
114
+ OLMo 2 is licensed under the Apache 2.0 license.
115
+ OLMo 2 is intended for research and educational use.
116
+ For more information, please see our [Responsible Use Guidelines](https://allenai.org/responsible-use).
117
+
118
+ ## Citation
119
+
120
+ ```bibtex
121
+ @article{olmo20242olmo2furious,
122
+ title={2 OLMo 2 Furious},
123
+ 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},
124
+ year={2024},
125
+ eprint={2501.00656},
126
+ archivePrefix={arXiv},
127
+ primaryClass={cs.CL},
128
+ url={https://arxiv.org/abs/2501.00656},
129
+ }
130
+ ```
chat_template.jinja ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {{ bos_token }}{% for message in messages %}{% if message['role'] == 'system' %}{{ '<|system|>
2
+ ' + message['content'] + '
3
+ ' }}{% elif message['role'] == 'user' %}{{ '<|user|>
4
+ ' + message['content'] + '
5
+ ' }}{% elif message['role'] == 'assistant' %}{% if not loop.last %}{{ '<|assistant|>
6
+ ' + message['content'] + eos_token + '
7
+ ' }}{% else %}{{ '<|assistant|>
8
+ ' + message['content'] + eos_token }}{% endif %}{% endif %}{% if loop.last and add_generation_prompt %}{{ '<|assistant|>
9
+ ' }}{% endif %}{% endfor %}
config.json ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Olmo2ForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 100257,
8
+ "eos_token_id": 100257,
9
+ "hidden_act": "silu",
10
+ "hidden_size": 2048,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 8192,
13
+ "max_position_embeddings": 4096,
14
+ "model_type": "olmo2",
15
+ "num_attention_heads": 16,
16
+ "num_hidden_layers": 16,
17
+ "num_key_value_heads": 16,
18
+ "pad_token_id": 100277,
19
+ "rms_norm_eps": 1e-06,
20
+ "rope_scaling": null,
21
+ "rope_theta": 500000,
22
+ "tie_word_embeddings": false,
23
+ "torch_dtype": "bfloat16",
24
+ "transformers_version": "4.52.0.dev0",
25
+ "unsloth_fixed": true,
26
+ "use_cache": false,
27
+ "vocab_size": 100352
28
+ }
generation_config.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 100257,
4
+ "eos_token_id": 100257,
5
+ "max_length": 4096,
6
+ "pad_token_id": 100277,
7
+ "transformers_version": "4.52.0.dev0"
8
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:36d044c73655bb904f822915e6294ba3dae8e6e1af5e703e9d452f2d6a3a294f
3
+ size 2969854224
special_tokens_map.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<|endoftext|>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "<|endoftext|>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "<|pad|>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "unk_token": "�"
24
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "added_tokens_decoder": {
4
+ "5809": {
5
+ "content": "\u00ef\u00bf\u00bd",
6
+ "lstrip": false,
7
+ "normalized": false,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ },
12
+ "100256": {
13
+ "content": "<|extra_id_0|>",
14
+ "lstrip": false,
15
+ "normalized": false,
16
+ "rstrip": false,
17
+ "single_word": false,
18
+ "special": false
19
+ },
20
+ "100257": {
21
+ "content": "<|endoftext|>",
22
+ "lstrip": false,
23
+ "normalized": false,
24
+ "rstrip": false,
25
+ "single_word": false,
26
+ "special": true
27
+ },
28
+ "100258": {
29
+ "content": "<|fim_prefix|>",
30
+ "lstrip": false,
31
+ "normalized": false,
32
+ "rstrip": false,
33
+ "single_word": false,
34
+ "special": true
35
+ },
36
+ "100259": {
37
+ "content": "<|fim_middle|>",
38
+ "lstrip": false,
39
+ "normalized": false,
40
+ "rstrip": false,
41
+ "single_word": false,
42
+ "special": true
43
+ },
44
+ "100260": {
45
+ "content": "<|fim_suffix|>",
46
+ "lstrip": false,
47
+ "normalized": false,
48
+ "rstrip": false,
49
+ "single_word": false,
50
+ "special": true
51
+ },
52
+ "100261": {
53
+ "content": "|||PHONE_NUMBER|||",
54
+ "lstrip": false,
55
+ "normalized": false,
56
+ "rstrip": false,
57
+ "single_word": false,
58
+ "special": false
59
+ },
60
+ "100262": {
61
+ "content": "|||EMAIL_ADDRESS|||",
62
+ "lstrip": false,
63
+ "normalized": false,
64
+ "rstrip": false,
65
+ "single_word": false,
66
+ "special": false
67
+ },
68
+ "100263": {
69
+ "content": "|||IP_ADDRESS|||",
70
+ "lstrip": false,
71
+ "normalized": false,
72
+ "rstrip": false,
73
+ "single_word": false,
74
+ "special": false
75
+ },
76
+ "100264": {
77
+ "content": "<|im_start|>",
78
+ "lstrip": false,
79
+ "normalized": false,
80
+ "rstrip": false,
81
+ "single_word": false,
82
+ "special": true
83
+ },
84
+ "100265": {
85
+ "content": "<|im_end|>",
86
+ "lstrip": false,
87
+ "normalized": false,
88
+ "rstrip": false,
89
+ "single_word": false,
90
+ "special": true
91
+ },
92
+ "100266": {
93
+ "content": "<|extra_id_1|>",
94
+ "lstrip": false,
95
+ "normalized": false,
96
+ "rstrip": false,
97
+ "single_word": false,
98
+ "special": false
99
+ },
100
+ "100267": {
101
+ "content": "<|extra_id_2|>",
102
+ "lstrip": false,
103
+ "normalized": false,
104
+ "rstrip": false,
105
+ "single_word": false,
106
+ "special": false
107
+ },
108
+ "100268": {
109
+ "content": "<|extra_id_3|>",
110
+ "lstrip": false,
111
+ "normalized": false,
112
+ "rstrip": false,
113
+ "single_word": false,
114
+ "special": false
115
+ },
116
+ "100269": {
117
+ "content": "<|extra_id_4|>",
118
+ "lstrip": false,
119
+ "normalized": false,
120
+ "rstrip": false,
121
+ "single_word": false,
122
+ "special": false
123
+ },
124
+ "100270": {
125
+ "content": "<|extra_id_5|>",
126
+ "lstrip": false,
127
+ "normalized": false,
128
+ "rstrip": false,
129
+ "single_word": false,
130
+ "special": false
131
+ },
132
+ "100271": {
133
+ "content": "<|extra_id_6|>",
134
+ "lstrip": false,
135
+ "normalized": false,
136
+ "rstrip": false,
137
+ "single_word": false,
138
+ "special": false
139
+ },
140
+ "100272": {
141
+ "content": "<|extra_id_7|>",
142
+ "lstrip": false,
143
+ "normalized": false,
144
+ "rstrip": false,
145
+ "single_word": false,
146
+ "special": false
147
+ },
148
+ "100273": {
149
+ "content": "<|extra_id_8|>",
150
+ "lstrip": false,
151
+ "normalized": false,
152
+ "rstrip": false,
153
+ "single_word": false,
154
+ "special": false
155
+ },
156
+ "100274": {
157
+ "content": "<|extra_id_9|>",
158
+ "lstrip": false,
159
+ "normalized": false,
160
+ "rstrip": false,
161
+ "single_word": false,
162
+ "special": false
163
+ },
164
+ "100275": {
165
+ "content": "<|extra_id_10|>",
166
+ "lstrip": false,
167
+ "normalized": false,
168
+ "rstrip": false,
169
+ "single_word": false,
170
+ "special": false
171
+ },
172
+ "100276": {
173
+ "content": "<|endofprompt|>",
174
+ "lstrip": false,
175
+ "normalized": false,
176
+ "rstrip": false,
177
+ "single_word": false,
178
+ "special": true
179
+ },
180
+ "100277": {
181
+ "content": "<|pad|>",
182
+ "lstrip": false,
183
+ "normalized": false,
184
+ "rstrip": false,
185
+ "single_word": false,
186
+ "special": true
187
+ }
188
+ },
189
+ "bos_token": "<|endoftext|>",
190
+ "clean_up_tokenization_spaces": false,
191
+ "eos_token": "<|endoftext|>",
192
+ "extra_special_tokens": {},
193
+ "model_max_length": 4096,
194
+ "pad_token": "<|pad|>",
195
+ "padding_side": "left",
196
+ "tokenizer_class": "GPT2Tokenizer",
197
+ "unk_token": "\u00ef\u00bf\u00bd",
198
+ "chat_template": "{{ bos_token }}{% for message in messages %}{% if message['role'] == 'system' %}{{ '<|system|>\n' + message['content'] + '\n' }}{% elif message['role'] == 'user' %}{{ '<|user|>\n' + message['content'] + '\n' }}{% elif message['role'] == 'assistant' %}{% if not loop.last %}{{ '<|assistant|>\n' + message['content'] + eos_token + '\n' }}{% else %}{{ '<|assistant|>\n' + message['content'] + eos_token }}{% endif %}{% endif %}{% if loop.last and add_generation_prompt %}{{ '<|assistant|>\n' }}{% endif %}{% endfor %}"
199
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff