🚀 OLMo 2 1B SFT 2025年4月版
OLMo 2 1B SFT 2025年4月版是基於Transformer架構的語言模型,它在特定數據集上進行了監督微調,在多種任務上表現出色,可用於科研和教育領域。
🚀 快速開始
OLMo 2 1B支持transformers
v4.48及以上版本,你可以使用以下命令進行安裝:
pip install transformers>=4.48
如果你使用的是vLLM,在v0.7.4發佈之前,你需要從主分支進行安裝。
✨ 主要特性
- OLMo是一系列開放語言模型,旨在推動語言模型科學的發展。
- 該模型在Dolma數據集上進行訓練,並且所有代碼、檢查點、日誌和相關訓練細節均已開源。
- OLMo 2 1B SFT是[allenai/OLMo - 2 - 0425 - 1B](https://huggingface.co/allenai/OLMo - 2 - 0425 - 1B)模型的後訓練變體,在特定的[T端lu 3數據集](https://huggingface.co/datasets/allenai/tulu - 3 - sft - olmo - 2 - mixture - 0225)上進行了監督微調。
- T端lu 3數據集旨在使模型在除聊天外的多種任務(如MATH、GSM8K和IFEval)上達到先進性能。
📦 安裝指南
OLMo 2 1B支持transformers
v4.48及以上版本,安裝命令如下:
pip install transformers>=4.48
💻 使用示例
基礎用法
使用HuggingFace加載模型的代碼如下:
from transformers import AutoModelForCausalLM
olmo_model = AutoModelForCausalLM.from_pretrained("allenai/OLMo-2-0425-1B-SFT")
高級用法
聊天模板
注意:由於配置的細微變化,此聊天模板與之前的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-SFT", revision="step_200")
📚 詳細文檔
模型描述
屬性 |
詳情 |
模型類型 |
一個在公開可用、合成和人工創建的數據集混合上訓練的模型。 |
語言(NLP) |
主要為英語 |
許可證 |
Apache 2.0 |
微調基礎模型 |
allenai/OLMo - 2 - 0425 - 1B |
模型來源
- 項目頁面: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/
性能
模型 |
平均分 |
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模型的安全訓練有限,並且不像ChatGPT那樣在循環中自動過濾回覆,因此模型可能會產生有問題的輸出(特別是在被提示這樣做時)。可參考Falcon 180B模型卡片瞭解相關示例。
📄 許可證
OLMo 2採用Apache 2.0許可證,旨在用於科研和教育用途。更多信息請參閱我們的[負責任使用指南](https://allenai.org/responsible - use)。
引用
@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},
}