🚀 OLMo 2 1B Instruct April 2025
OLMo 2 1B Instruct April 2025是基於Transformer架構的語言模型,在多種自然語言處理任務中表現出色。它通過在特定數據集上的微調,能更好地理解和生成自然語言文本,適用於科研和教育領域。
🚀 快速開始
OLMo 2 1B Instruct April 2025是allenai/OLMo-2-0425-1B-RLVR1模型的後訓練變體。該模型在特定數據集上進行了監督微調、DPO訓練和最終的RLVR訓練。T端lu 3數據集旨在使模型在多種任務(如MATH、GSM8K和IFEval)中達到最先進的性能。
更多詳細信息,請查看OLMo 2論文或T端lu 3論文!
OLMo是一系列旨在推動語言模型科學發展的開放語言模型。這些模型在Dolma數據集上進行訓練,我們將發佈所有代碼、檢查點、日誌和相關訓練細節。
✨ 主要特性
- 多階段訓練:經過監督微調、DPO訓練和RLVR訓練,提升模型性能。
- 廣泛任務適用性:在多種自然語言處理任務中表現出色,如數學問題解決、問答等。
- 開放資源:發佈所有代碼、檢查點和訓練細節,便於科研和教育使用。
📦 安裝指南
OLMo 2 1B支持transformers v4.48或更高版本:
pip install transformers>=4.48
如果使用vLLM,在v0.7.4發佈之前,需要從主分支進行安裝。
💻 使用示例
基礎用法
使用HuggingFace加載模型:
from transformers import AutoModelForCausalLM
olmo_model = AutoModelForCausalLM.from_pretrained("allenai/OLMo-2-0425-1B-Instruct")
高級用法
聊天模板
注意:由於配置的細微變化,此聊天模板與之前的OLMo 2和T端lu 3模型不同。在其餘內容之前沒有bos標記。我們的其他模型在聊天模板開頭有<|endoftext|>。
我們模型的聊天模板格式如下:
<|user|>
How are you doing?
<|assistant|>
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|>
或者展開換行符:
<|user|>
How are you doing?
<|assistant|>
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|>
它也嵌入在分詞器中,用於tokenizer.apply_chat_template
。
中間檢查點
為了便於強化學習微調的研究,我們發佈了模型在RLVR訓練期間的中間檢查點。模型權重每20個訓練步驟保存一次,可以在HuggingFace倉庫的修訂版本中訪問。
例如,你可以這樣加載:
olmo_model = AutoModelForCausalLM.from_pretrained("allenai/OLMo-2-0425-1B-Instruct", revision="step_200")
📚 詳細文檔
模型描述
屬性 |
詳情 |
模型類型 |
一個在公開可用、合成和人工創建的數據集混合上訓練的模型。 |
語言 (NLP) |
主要為英語 |
許可證 |
Apache 2.0 |
微調基礎模型 |
allenai/OLMo-2-0425-1B-RLVR1 |
模型來源
- 項目頁面:https://allenai.org/olmo
- 倉庫:
- 核心倉庫(訓練、推理、微調等):https://github.com/allenai/OLMo-core
- 評估代碼:https://github.com/allenai/olmes
- 進一步微調代碼:https://github.com/allenai/open-instruct
- 論文:https://arxiv.org/abs/2501.00656
- 演示:https://playground.allenai.org/
偏差、風險和侷限性
OLMo-2模型的安全訓練有限,並且不像ChatGPT那樣在循環中自動過濾響應,因此模型可能會產生有問題的輸出(特別是在被要求這樣做時)。
性能
模型 |
平均 |
AlpacaEval 2 LC |
BBH |
DROP |
GSM8K |
IFEval |
MATH |
MMLU |
安全性 |
PopQA |
TruthQA |
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 |
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 |
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 |
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 |
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 |
--- |
|
|
|
|
|
|
|
|
|
|
|
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 |
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 |
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 |
📄 許可證
OLMo 2採用Apache 2.0許可證。該模型僅供科研和教育使用。更多信息,請參閱我們的負責任使用指南。
引用
@article{olmo20242olmo2furious,
title={2 OLMo 2 Furious},
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},
year={2024},
eprint={2501.00656},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2501.00656},
}