Olmo 2 0325 32B Instruct GGUF
模型简介
模型特点
模型能力
使用案例
🚀 OLMo-2-0325-32B-Instruct GGUF模型
OLMo-2-0325-32B-Instruct GGUF模型是基于Transformer架构的文本生成模型,它在超低比特量化技术上取得了显著突破,能够在保证一定精度的前提下,大幅降低内存使用,适用于多种硬件环境和应用场景。
🚀 快速开始
OLMo 2将在下一版本的Transformers中得到支持,你需要从主分支进行安装:
pip install --upgrade git+https://github.com/huggingface/transformers.git
✨ 主要特性
超低比特量化技术
我们最新的量化方法为超低比特模型(1 - 2比特)引入了精度自适应量化,并在Llama-3-8B上通过基准测试验证了其有效性。该方法采用特定层策略,在保持极高内存效率的同时保留了模型的准确性。
多格式支持
提供多种模型格式,包括BF16、F16和多种量化格式(Q4_K、Q6_K、Q8等),可根据不同的硬件能力和内存限制进行选择。
中间检查点
为了便于强化学习微调研究,我们发布了模型在RLVR训练期间的中间检查点,模型权重每20个训练步骤保存一次。
📦 安装指南
OLMo 2将在下一版本的Transformers中得到支持,你需要从主分支进行安装:
pip install --upgrade git+https://github.com/huggingface/transformers.git
💻 使用示例
加载模型
from transformers import AutoModelForCausalLM
olmo_model = AutoModelForCausalLM.from_pretrained("allenai/OLMo-2-0325-32B-Instruct")
聊天模板
<|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|>
系统提示
在Ai2演示中,我们默认使用以下系统提示:
You are OLMo 2, a helpful and harmless AI Assistant built by the Allen Institute for AI.
加载中间检查点
olmo_model = AutoModelForCausalLM.from_pretrained("allenai/OLMo-2-0325-32B-Instruct", revision="step_200")
📚 详细文档
量化性能对比(Llama-3-8B)
量化方式 | 标准困惑度 | DynamicGate困惑度 | 困惑度变化 | 标准大小 | DG大小 | 大小变化 | 标准速度 | DG速度 |
---|---|---|---|---|---|---|---|---|
IQ2_XXS | 11.30 | 9.84 | -12.9% | 2.5G | 2.6G | +0.1G | 234s | 246s |
IQ2_XS | 11.72 | 11.63 | -0.8% | 2.7G | 2.8G | +0.1G | 242s | 246s |
IQ2_S | 14.31 | 9.02 | -36.9% | 2.7G | 2.9G | +0.2G | 238s | 244s |
IQ1_M | 27.46 | 15.41 | -43.9% | 2.2G | 2.5G | +0.3G | 206s | 212s |
IQ1_S | 53.07 | 32.00 | -39.7% | 2.1G | 2.4G | +0.3G | 184s | 209s |
模型格式选择
模型格式 | 精度 | 内存使用 | 设备要求 | 最佳用例 |
---|---|---|---|---|
BF16 | 最高 | 高 | 支持BF16的GPU/CPU | 减少内存的高速推理 |
F16 | 高 | 高 | 支持FP16的设备 | BF16不可用时的GPU推理 |
Q4_K | 中低 | 低 | CPU或低显存设备 | 内存受限环境 |
Q6_K | 中 | 中等 | 内存较多的CPU | 量化模型中较好的精度 |
Q8_0 | 高 | 中等 | 有足够显存的CPU或GPU | 量化模型中最佳精度 |
IQ3_XS | 非常低 | 非常低 | 超低内存设备 | 极致内存效率和低精度 |
Q4_0 | 低 | 低 | ARM或低内存设备 | llama.cpp可针对ARM设备优化 |
包含文件及详情
OLMo-2-0325-32B-Instruct-bf16.gguf
:模型权重保存为BF16格式,适用于支持BF16加速的设备,可用于将模型重新量化为其他格式。OLMo-2-0325-32B-Instruct-f16.gguf
:模型权重保存为F16格式,适用于支持FP16的设备,特别是不支持BF16的情况。OLMo-2-0325-32B-Instruct-bf16-q8_0.gguf
:输出和嵌入层保持为BF16格式,其他层量化为Q8_0,适用于支持BF16的设备。OLMo-2-0325-32B-Instruct-f16-q8_0.gguf
:输出和嵌入层保持为F16格式,其他层量化为Q8_0。OLMo-2-0325-32B-Instruct-q4_k.gguf
:输出和嵌入层量化为Q8_0,其他层量化为Q4_K,适用于内存有限的CPU推理。OLMo-2-0325-32B-Instruct-q4_k_s.gguf
:最小的Q4_K变体,以牺牲精度为代价减少内存使用,适用于极低内存设置。OLMo-2-0325-32B-Instruct-q6_k.gguf
:输出和嵌入层量化为Q8_0,其他层量化为Q6_K。OLMo-2-0325-32B-Instruct-q8_0.gguf
:完全Q8量化模型,精度更高,但需要更多内存。OLMo-2-0325-32B-Instruct-iq3_xs.gguf
:IQ3_XS量化,针对极致内存效率进行优化,适用于超低内存设备。OLMo-2-0325-32B-Instruct-iq3_m.gguf
:IQ3_M量化,提供中等块大小以提高精度,适用于低内存设备。OLMo-2-0325-32B-Instruct-q4_0.gguf
:纯Q4_0量化,针对ARM设备进行优化,适用于低内存环境,建议使用IQ4_NL以获得更好的精度。
性能对比
模型 | 平均 | AlpacaEval 2 LC | BBH | DROP | GSM8k | IFEval | MATH | MMLU | 安全性 | PopQA | TruthQA |
---|---|---|---|---|---|---|---|---|---|---|---|
封闭API模型 | |||||||||||
GPT-3.5 Turbo 0125 | 59.6 | 38.7 | 66.6 | 70.2 | 74.3 | 66.9 | 41.2 | 70.2 | 69.1 | 45.0 | 62.9 |
GPT 4o Mini 2024-07-18 | 65.7 | 49.7 | 65.9 | 36.3 | 83.0 | 83.5 | 67.9 | 82.2 | 84.9 | 39.0 | 64.8 |
开放权重模型 | |||||||||||
Mistral-Nemo-Instruct-2407 | 50.9 | 45.8 | 54.6 | 23.6 | 81.4 | 64.5 | 31.9 | 70.0 | 52.7 | 26.9 | 57.7 |
Ministral-8B-Instruct | 52.1 | 31.4 | 56.2 | 56.2 | 80.0 | 56.4 | 40.0 | 68.5 | 56.2 | 20.2 | 55.5 |
Gemma-2-27b-it | 61.3 | 49.0 | 72.7 | 67.5 | 80.7 | 63.2 | 35.1 | 70.7 | 75.9 | 33.9 | 64.6 |
Qwen2.5-32B | 66.5 | 39.1 | 82.3 | 48.3 | 87.5 | 82.4 | 77.9 | 84.7 | 82.4 | 26.1 | 70.6 |
Mistral-Small-24B | 67.6 | 43.2 | 80.1 | 78.5 | 87.2 | 77.3 | 65.9 | 83.7 | 66.5 | 24.4 | 68.1 |
Llama-3.1-70B | 70.0 | 32.9 | 83.0 | 77.0 | 94.5 | 88.0 | 56.2 | 85.2 | 76.4 | 46.5 | 66.8 |
Llama-3.3-70B | 73.0 | 36.5 | 85.8 | 78.0 | 93.6 | 90.8 | 71.8 | 85.9 | 70.4 | 48.2 | 66.1 |
Gemma-3-27b-it | - | 63.4 | 83.7 | 69.2 | 91.1 | - | - | 81.8 | - | 30.9 | - |
完全开放模型 | |||||||||||
OLMo-2-7B-1124-Instruct | 55.7 | 31.0 | 48.5 | 58.9 | 85.2 | 75.6 | 31.3 | 63.9 | 81.2 | 24.6 | 56.3 |
OLMo-2-13B-1124-Instruct | 61.4 | 37.5 | 58.4 | 72.1 | 87.4 | 80.4 | 39.7 | 68.6 | 77.5 | 28.8 | 63.9 |
OLMo-2-32B-0325-SFT | 61.7 | 16.9 | 69.7 | 77.2 | 78.4 | 72.4 | 35.9 | 76.1 | 93.8 | 35.4 | 61.3 |
OLMo-2-32B-0325-DPO | 68.8 | 44.1 | 70.2 | 77.5 | 85.7 | 83.8 | 46.8 | 78.0 | 91.9 | 36.4 | 73.5 |
OLMo-2-32B-0325-Instruct | 68.8 | 42.8 | 70.6 | 78.0 | 87.6 | 85.6 | 49.7 | 77.3 | 85.9 | 37.5 | 73.2 |
学习曲线
复现命令
# clone and check out commit
git clone https://github.com/allenai/open-instruct.git
# this should be the correct commit, the main thing is to have the vllm monkey patch for
# 32b olmo https://github.com/allenai/open-instruct/blob/894ffa236319bc6c26c346240a7e4ee04ba0bd31/open_instruct/vllm_utils2.py#L37-L59
git checkout a51dc98525eec01de6e8a24c071f42dce407d738
uv sync
uv sync --extra compile
# note that you may need 5 8xH100 nodes for the training.
# so please setup ray properly, e.g., https://github.com/allenai/open-instruct/blob/main/docs/tulu3.md#llama-31-tulu-3-70b-reproduction
python open_instruct/grpo_vllm_thread_ray_gtrl.py \
--exp_name 0310_olmo2_32b_grpo_12818 \
--beta 0.01 \
--local_mini_batch_size 32 \
--number_samples_per_prompt 16 \
--output_dir output \
--local_rollout_batch_size 4 \
--kl_estimator kl3 \
--learning_rate 5e-7 \
--dataset_mixer_list allenai/RLVR-GSM-MATH-IF-Mixed-Constraints 1.0 \
--dataset_mixer_list_splits train \
--dataset_mixer_eval_list allenai/RLVR-GSM-MATH-IF-Mixed-Constraints 16 \
--dataset_mixer_eval_list_splits train \
--max_token_length 2048 \
--max_prompt_token_length 2048 \
--response_length 2048 \
--model_name_or_path allenai/OLMo-2-0325-32B-DPO \
--non_stop_penalty \
--stop_token eos \
--temperature 1.0 \
--ground_truths_key ground_truth \
--chat_template_name tulu \
--sft_messages_key messages \
--eval_max_length 4096 \
--total_episodes 10000000 \
--penalty_reward_value 0.0 \
--deepspeed_stage 3 \
--no_gather_whole_model \
--per_device_train_batch_size 2 \
--local_rollout_forward_batch_size 2 \
--actor_num_gpus_per_node 8 8 8 4 \
--num_epochs 1 \
--vllm_tensor_parallel_size 1 \
--vllm_num_engines 12 \
--lr_scheduler_type constant \
--apply_verifiable_reward true \
--seed 1 \
--num_evals 30 \
--save_freq 20 \
--reward_model_multiplier 0.0 \
--no_try_launch_beaker_eval_jobs \
--try_launch_beaker_eval_jobs_on_weka \
--gradient_checkpointing \
--with_tracking
🔧 技术细节
量化方法
- 动态精度分配:前/后25%的层使用IQ4_XS(选定层),中间50%使用IQ2_XXS/IQ3_S(提高效率)。
- 关键组件保护:嵌入层和输出层使用Q5_K,与标准1 - 2比特量化相比,误差传播减少38%。
模型训练
模型使用5个8xH100节点进行训练,训练过程中每20个步骤保存一次中间检查点。
📄 许可证
OLMo 2采用Apache 2.0许可证,旨在用于研究和教育目的。更多信息请参阅我们的负责任使用指南。该模型使用了包含第三方模型生成输出的数据集进行微调,需遵守额外条款:Gemma使用条款。
引用
@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},
}
测试模型
如果您觉得这些模型有用,请点击“点赞”!帮助我测试我的AI网络监控助手,进行量子就绪安全检查: 👉 免费网络监控器
💬 测试方法:
- 点击任何页面右下角的聊天图标。
- 选择一个AI助手类型:
TurboLLM
(GPT-4-mini)FreeLLM
(开源)TestLLM
(仅实验性CPU)
测试内容
我正在探索小型开源模型在AI网络监控中的极限,具体包括:
- 针对实时网络服务的函数调用。
- 模型可以多小,同时仍能处理:
- 自动化Nmap扫描。
- 量子就绪检查。
- Metasploit集成。
🟡 TestLLM – 当前实验模型(llama.cpp在6个CPU线程上):
- ✅ 零配置设置。
- ⏳ 30秒加载时间(推理速度慢,但无API成本)。
- 🔧 寻求帮助! 如果您对边缘设备AI感兴趣,让我们一起合作!
其他助手
🟢 TurboLLM – 使用gpt-4-mini进行:
- 实时网络诊断。
- 自动化渗透测试 (Nmap/Metasploit)。
- 🔑 通过下载我们的免费网络监控代理获得更多令牌。
🔵 HugLLM – 开源模型(约8B参数):
- 比TurboLLM多2倍令牌。
- AI日志分析。
- 🌐 在Hugging Face推理API上运行。
💡 测试示例AI命令:
"Give me info on my websites SSL certificate"
"Check if my server is using quantum safe encyption for communication"
"Run a quick Nmap vulnerability test"
模型信息
属性 | 详情 |
---|---|
模型类型 | 基于公开可用、合成和人工创建的数据集混合训练的模型 |
语言 | 主要为英语 |
许可证 | Apache 2.0 |
微调基础模型 | allenai/OLMo-2-0325-32B-DPO |
项目页面 | 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那样在循环中对响应进行过滤,因此模型可能会产生有问题的输出(特别是在被提示这样做时)。请参考Falcon 180B模型卡片了解相关示例。
💡 使用建议
在选择模型格式时,请根据您的硬件能力和内存限制进行选择。如果您的硬件支持BF16加速,建议使用BF16格式以获得更高的性能和精度;如果不支持BF16,F16格式是一个更广泛支持的选择;如果您的设备内存有限,量化模型(如Q4_K、Q6_K等)可能更适合您。



