职贝云数AI新零售门户

标题: DeepSeek-V3.1开源发布 [打印本页]

作者: IMeYQk    时间: 2025-8-22 20:45
标题: DeepSeek-V3.1开源发布
DeepSeek-V3.1 是一个支持思索形式和非思索形式的混合模型。与之前的版本相比,这次晋级在多个方面带来了改进:

DeepSeek-V3.1 是在 DeepSeek-V3.1-Base 的基础上停止后训练得到的,后者经过两阶段长上下文扩展方法基于原始 V3 基础检查点构建,遵照了原始 DeepSeek-V3 报告中概述的方法。我们经过搜集额外的长文档并大幅扩展两个训练阶段来扩展了我们的数据集。32K 扩展阶段已添加了 10 倍至 630B tokens,而 128K 扩展阶段则添加了 3.3 倍至 209B tokens。此外,DeepSeek-V3.1 运用 UE8M0 FP8 格式的数据停止训练,以确保与微缩放数据格式兼容。
模型下载

模型总参数数激活参数数上下文长度下载
DeepSeek-V3.1-Base671B37B128KHuggingFace | ModelScope
DeepSeek-V3.1671B37B128KHuggingFace | ModelScope
聊天模板


我们的聊天模板概况见 tokenizer_config.json 和 assets/chat_template.jinja。这里是一个简要描画。
非思索形式

第一回合


前缀: <|begin▁of▁sentence|>{系统提示}<|User|>{查询}<|Assistant|> </think>

给定此前缀,DeepSeek V3.1 在非思索形式下生成对查询的呼应。与 DeepSeek V3 不同,它引入了一个额外的标记 </think>。
多回合


上下文: <|begin▁of▁sentence|>{系统提示}<|User|>{查询}<|Assistant|> </think>{呼应}<|end▁of▁sentence|>...<|User|>{查询}<|Assistant|> </think>{呼应}<|end▁of▁sentence|>

前缀: <|User|>{查询}<|Assistant|> </think>

经过将上下文和前缀衔接起来,我们获得了正确的查询提示。
思索形式

第一回合


前缀: <|begin▁of▁sentence|>{系统提示}<|User|>{查询}<|Assistant|><think>

思索形式的前缀相似于 DeepSeek-R1。
多回合


上下文: <|begin▁of▁sentence|>{系统提示}<|User|>{查询}<|Assistant|> </think>{呼应}<|end▁of▁sentence|>...<|User|>{查询}<|Assistant|> </think>{呼应}<|end▁of▁sentence|>

前缀: <|User|>{查询}<|Assistant|><think>

多回合模板与非思索形式下的多回合聊天模板相反。这意味着最后一轮中的思索标记将被删除,但在每轮上下文中都保留 </think>。
工具调用


工具调用支持在非思索形式下运用。格式为:

<|begin▁of▁sentence|>{系统提示}\n\n{工具描画}<|User|>{查询}<|Assistant|> </think> 其中工具描画是
## Tools
You have access to the following tools:

### {tool_name1}
Description: {description}

Parameters: {json.dumps(parameters)}

IMPORTANT: ALWAYS adhere to this exact format for tool use:
<|tool▁calls▁begin|><|tool▁call▁begin|>tool_call_name<|tool▁sep|>tool_call_arguments<|tool▁call▁end|>{additional_tool_calls}<|tool▁calls▁end|>

Where:
- `tool_call_name` must be an exact match to one of the available tools
- `tool_call_arguments` must be valid JSON that strictly follows the tool's Parameters Schema
- For multiple tool calls, chain them directly without separators or spaces
代码代理


我们支持多种代码代理框架。请参考上述工具调用格式来创建您本人的代码代理。一个示例见 assets/code_agent_trajectory.html。
搜索代理


我们为在思索形式下搜索工具调用设计了特定的格式,以支持搜索代理。

对于需求访问外部或最新信息的复杂成绩,DeepSeek-V3.1 可以经过多轮工具调用过程应用用户提供的搜索工具。

请参阅 assets/search_tool_trajectory.html 和 assets/search_python_tool_trajectory.html 了解详细的模板。
评价

类别基准(目的)DeepSeek V3.1-非思索DeepSeek V3 0324DeepSeek V3.1-思索DeepSeek R1 0528
通用





MMLU-Redux (EM)91.890.593.793.4

MMLU-Pro (EM)83.781.284.885.0

GPQA-Diamond (Pass@1)74.968.480.181.0

人类最后的考试 (Pass@1)--15.917.7
搜索代理





BrowseComp--30.08.9

BrowseComp_zh--49.235.7

人类最后的考试 (Python + 搜索)--29.824.8

SimpleQA--93.492.3
代码





LiveCodeBench (2408-2505) (Pass@1)56.443.074.873.3

Codeforces-Div1 (评分)--20911930

Aider-Polyglot (准确率)68.455.176.371.6
代码代理





SWE 验证 (代理形式)66.045.4-44.6

SWE-bench 多言语 (代理形式)54.529.3-30.5

Terminal-bench (Terminus 1 框架)31.313.3-5.7
数学





AIME 2024 (Pass@1)66.359.493.191.4

AIME 2025 (Pass@1)49.851.388.487.5

HMMT 2025 (Pass@1)33.529.284.279.4

注释:
运用示例


import transformers

tokenizer = transformers.AutoTokenizer.from_pretrained("deepseek-ai/DeepSeek-V3.1")

messages = [
    {"role": "system", "content": "You are a helpful assistant"},
    {"role": "user", "content": "Who are you?"},
    {"role": "assistant", "content": "<think>Hmm</think>I am DeepSeek"},
    {"role": "user", "content": "1+1=?"}
]

tokenizer.apply_chat_template(messages, tokenize=False, thinking=True, add_generation_prompt=True)
# '<|begin▁of▁sentence|>You are a helpful assistant<|User|>Who are you?<|Assistant|></think>I am DeepSeek<|end▁of▁sentence|><|User|>1+1=?<|Assistant|><think>'

tokenizer.apply_chat_template(messages, tokenize=False, thinking=False, add_generation_prompt=True)
# '<|begin▁of▁sentence|>You are a helpful assistant<|User|>Who are you?<|Assistant|></think>I am DeepSeek<|end▁of▁sentence|><|User|>1+1=?<|Assistant|></think>'




欢迎光临 职贝云数AI新零售门户 (https://www.taojin168.com/cloud/) Powered by Discuz! X3.5