Seed-OSS-36B-Instruct

简介

Seed-OSS 是由字节跳动种子团队开发的一系列开源大型语言模型,旨在提供强大的长上下文、推理、代理和通用功能,以及对开发者友好的多功能特性。尽管只使用了12T个令牌进行训练,Seed-OSS在多个流行的开源基准测试中表现出色。

我们在Apache-2.0许可下将这一系列模型发布给开源社区。

NOTE

Seed-OSS 主要针对国际化(i18n)用例进行了优化。

关键特性

  • 灵活控制思考预算:允许用户根据需要灵活调整推理长度。这种动态控制推理长度的能力在实际应用场景中提高了推理效率。
  • 增强的推理能力:特别针对推理任务进行了优化,同时保持了平衡且出色的通用能力。
  • 代理智能:在工具使用和问题解决等代理任务中表现卓越。
  • 研究友好:考虑到预训练中包含合成指令数据可能会影响后训练研究,我们发布了带有和不带指令数据的预训练模型,为研究界提供了更多样化的选择。
  • 原生长上下文:使用长达512K的长上下文进行训练。

模型概述

Seed-OSS 采用了流行的因果语言模型架构,结合了RoPE、GQA注意力机制、RMSNorm 和 SwiGLU激活函数。

Seed-OSS-36B
参数36B
注意力机制GQA
激活函数SwiGLU
层数64
QKV头数80 / 8 / 8
头大小128
隐藏层大小5120
词汇量155K
上下文长度512K
RoPE 基频1e7

评估结果

Seed-OSS-36B-Base

将合成指令数据纳入预训练可以提高大多数基准测试的性能。我们采用添加了合成指令数据的版本(即 w/ syn.)作为 Seed-OSS-36B-Base。我们也发布了未使用此类数据训练的 Seed-OSS-36B-Base-woSyn(即 w/o syn.),为社区提供一个不受合成指令数据影响的高性能基础模型。

BenchmarkSeed1.6-BaseQwen3-30B-A3B-Base-2507*Qwen2.5-32B-Base*Seed-OSS-36B-Base
(w/ syn.)
Seed-OSS-36B-Base-woSyn
(w/o syn.)
Knowledge
MMLU-Pro7059.858.5 (55.1)65.160.4
MMLU88.882.784 (83.3)84.984.8
TriviaQA9176.27682.181.9
GPQA-D43.43729.331.735.2
SimpleQA17.17.26.15.87.4
Reasoning
BBH92.181.479.1 (84.5)87.787.2
AGIEval-en7866.465.670.770.1
Math
GSM8K93.18787.5 (92.9)90.890.3
MATH72.961.163.5 (57.7)81.761.3
Coding
MBPP83.678.877.8 (84.5)80.674.6
HumanEval7870.747.6 (58.5)76.875.6

– Bold denotes open-source SOTA.
– “*” indicates that the results in this column are presented in the format of “reproduced_results (reported_results_if_any)”.

Seed-OSS-36B-Instruct

BenchmarkSeed1.6-Thinking-0715OAI-OSS-20B*Qwen3-30B-A3B-Thinking-2507*Qwen3-32B*Gemma3-27BSeed-OSS-36B-Instruct
Knowledge
MMLU-Pro86.676.281.9 (80.9)81.867.582.7
MMLU90.681.7 (85.3)86.986.276.987.4
GPQA-D80.772.2 (71.5)71.4 (73.4)66.7 (68.4)42.471.4
SuperGPQA63.450.157.3 (56.8)49.355.7
SimpleQA23.76.723.68.6109.7
Math
AIME2490.392.7 (92.1)87.782.7 (81.4)91.7
AIME258690.3 (91.7)81.3 (85)73.3 (72.9)84.7
BeyondAIME6069562965
Reasoning
ArcAGI V250.341.737.814.440.6
KORBench74.872.370.265.470.6
Coding
LiveCodeBench v6
(02/2025-05/2025)
66.863.860.3 (66)53.467.4
HLE13.912.7 (10.9)8.76.910.1
Instruction Following
IFEval86.392.888 (88.9)88.4 (85)90.485.8
Agent
TAU1-Retail63(54.8)58.7 (67.8)40.970.4
TAU1-Airline49(38)47 (48)3846
SWE-Bench Verified
(OpenHands)
41.8(60.7)3123.456
SWE-Bench Verified
(AgentLess 4*10)
48.433.539.747
Multi-SWE-Bench17.79.57.717
Multilingualism
MMMLU84.377.4 (75.7)7979 (80.6)78.4
Long Context
RULER
(128K)
94.578.794.577.594.6
Safety
AIR-Bench75.6

– Bold denotes open-source SOTA. Underlined indicates the second place in the open-source model.
– “*” indicates that the results in this column are presented in the format of “reproduced_results (reported_results_if_any)”. Some results have been omitted due to the failure of the evaluation run.
– The results of Gemma3-27B are sourced directly from its technical report.
– Generation configs for Seed-OSS-36B-Instruct: temperature=1.1, top_p=0.95. Specifically, for Taubench, temperature=1, top_p=0.7.

NOTE

我们建议使用 temperature=1.1 和 top_p=0.95 进行采样。

思考预算

用户可以灵活指定模型的思考预算。下图显示了随着思考预算变化,不同任务的表现曲线。对于较简单的任务(例如 IFEval),模型的思维链(CoT)较短,随着思考预算的增加,得分会有所波动。对于更复杂的任务(例如 AIME 和 LiveCodeBench),模型的 CoT 较长,随着思考预算的增加,得分会有所提高。

thinking_budget

这是一个将思考预算设置为 512 的例子:在推理过程中,模型会定期触发自我反思,以估计已消耗和剩余的预算,并在预算耗尽或推理结束时给出最终响应。

<seed:think>
Got it, let's try to solve this problem step by step. The problem says ... ...
<seed:cot_budget_reflect>I have used 129 tokens, and there are 383 tokens remaining for use.</seed:cot_budget_reflect>
Using the power rule, ... ...
<seed:cot_budget_reflect>I have used 258 tokens, and there are 254 tokens remaining for use.</seed:cot_budget_reflect>
Alternatively, remember that ... ...
<seed:cot_budget_reflect>I have used 393 tokens, and there are 119 tokens remaining for use.</seed:cot_budget_reflect>
Because if ... ...
<seed:cot_budget_reflect>I have exhausted my token budget, and now I will start answering the question.</seed:cot_budget_reflect>
</seed:think>
To solve the problem, we start by using the properties of logarithms to simplify the given equations: (full answer omitted).

如果不设置思考预算(默认模式),Seed-OSS 将以无限长度进行思考。如果指定了思考预算,建议优先选择 512 的整数倍值(例如 512、1K、2K、4K、8K 或 16K),因为模型在这些区间上进行了大量训练。当思考预算为 0 时,模型会被指示输出直接响应,我们建议将任何低于 512 的预算设置为此值。

快速开始

pip3 install -r requirements.txt
pip install git+ssh://git@github.com/Fazziekey/transformers.git@seed-oss
from modelscope import AutoModelForCausalLM, AutoTokenizer
import os
import re

model_name_or_path = "ByteDance-Seed/Seed-OSS-36B-Instruct"

tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)
model = AutoModelForCausalLM.from_pretrained(model_name_or_path, device_map="auto")  # You may want to use bfloat16 and/or move to GPU here
messages = [
    {"role": "user", "content": "How to make pasta?"},
]
tokenized_chat = tokenizer.apply_chat_template(
  messages, 
  tokenize=True, 
  add_generation_prompt=True, 
  return_tensors="pt", 
  thinking_budget=512 # control the thinking budget
)

outputs = model.generate(tokenized_chat.to(model.device), max_new_tokens=2048)

output_text = tokenizer.decode(outputs[0])

推理

下载模型

将 Seed-OSS 检查点下载到 ./Seed-OSS-36B-Instruct

Transformers

generate.py 脚本提供了一个简单的模型推理接口,具有可配置的选项。

基本用法

cd inference
python3 generate.py --model_path /path/to/model

关键参数

参数描述
--model_path预训练模型目录的路径(必需)
--prompts输入提示(默认:示例烹饪/代码问题)
--max_new_tokens生成的最大令牌数(默认:4096)
--attn_implementation注意力机制:flash_attention_2(默认)或 eager
--load_in_4bit/8bit启用4位/8位量化(减少内存使用)
--thinking_budget思考预算(以令牌为单位,默认:-1 表示无限制预算)

量化示例

# 8-bit quantization
python3 generate.py --model_path /path/to/model --load_in_8bit True

# 4-bit quantization
python3 generate.py --model_path /path/to/model --load_in_4bit True

自定义提示

python3 generate.py --model_path /path/to/model --prompts "['What is machine learning?', 'Explain quantum computing']"

vLLM

使用 vllm >= 0.10.0 或更高版本进行推理。

  • 首先安装支持 Seed-OSS 的 vLLM 版本:
VLLM_USE_PRECOMPILED=1 VLLM_TEST_USE_PRECOMPILED_NIGHTLY_WHEEL=1 pip install git+ssh://git@github.com/FoolPlayer/vllm.git@seed-oss
  • 启动 vLLM API 服务器:
python3 -m vllm.entrypoints.openai.api_server \
    --host localhost \
    --port 4321 \
    --enable-auto-tool-choice \
    --tool-call-parser seed_oss \
    --trust-remote-code \
    --model ./Seed-OSS-36B-Instruct \
    --chat-template ./Seed-OSS-36B-Instruct/chat_template.jinja \
    --tensor-parallel-size 8 \
    --dtype bfloat16 \
    --served-model-name seed_oss
  • 使用 OpenAI 客户端测试:

聊天

python3 inference/vllm_chat.py

工具调用

python3 inference/vllm_tool_call.py

模型卡片

参见 MODEL_CARD

许可证

此项目根据 Apache-2.0 许可。有关详细信息,请参阅 LICENSE 文件。

引用

@misc{seed2025seed-oss,
  author={ByteDance Seed Team},
  title={Seed-OSS Open-Source Models},
  year={2025},
  howpublished={\url{https://github.com/ByteDance-Seed/seed-oss}}
}

关于 字节跳动 Seed 团队

字节跳动 Seed 团队成立于 2023 年,致力于打造业界最先进的 AI 基础模型。该团队立志成为世界级的研究团队,并对科学和社会的发展做出重大贡献。

原创文章,转载请注明: 转载自诺德美地科技

本文链接地址: Seed-OSS-36B-Instruct

发表评论