🚀 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},
}