DeepSeek 发布 DeepSeek-V4-Flash-0731 正式版
deepseek-ai/DeepSeek-V4-Flash-0731
DeepSeek 发布 DeepSeek-V4-Flash-0731 正式版,取代此前的预览版本,智能体能力大幅增强。该模型与 DeepSeek-V4-Flash-DSpark 结构相同,附带投机解码模块,在 Terminal Bench 2.1、NL2Repo、DeepSWE 等基准上超过 DeepSeek-V4-Pro (Preview),激活参数量则小得多。
官方技术报告列出多项基准对比,读者可据此判断小激活参数模型在智能体任务上的位置。
简介
DeepSeek-V4-Flash-0731 是 DeepSeek-V4-Flash 的正式发布版本,取代预览版,其智能体能力得到大幅增强。它与 DeepSeek-V4-Flash-DSpark 具有相同的模型结构,即附带一个投机解码模块。
尽管 DeepSeek-V4-Flash-0731 的激活参数量远小于 DeepSeek-V4-Pro(预览版),但在下列基准测试中其表现优于后者,并且与当前最强的专有模型相比具有广泛竞争力。
| 基准测试 | DeepSeek-V4-Flash-0731 | DeepSeek-V4-Flash(预览版) | DeepSeek-V4-Pro(预览版) | GLM-5.2 | Opus-4.8 |
|---|---|---|---|---|---|
| Terminal Bench 2.1 | 82.7 | 61.8 | 72.1 | 81.0 | 85.0 |
| NL2Repo | 54.2 | 39.4 | 38.5 | 48.9 | 69.7 |
| Cybergym | 76.7 | 38.7 | 52.7 | - | 83.1 |
| DeepSWE | 54.4 | 7.3 | 12.8 | 46.2 | 58.0 |
| Toolathlon-Verified | 70.3 | 49.7 | 55.9 | 59.9 | 76.2 |
| Agents' Last Exam | 25.2 | 15.8 | 16.5 | 23.8 | 25.7 |
| AutomationBench Public | 25.1 | 10.8 | 12.8 | 12.9 | 27.2 |
| DSBench-FullStack † | 68.7 | 37.0 | 41.8 | 61.8 | 71.6 |
| DSBench-Hard † | 59.6 | 25.8 | 31.1 | 54.5 | 71.7 |
备注:
- 对于上述公开基准测试中的 Code Agent 任务,DeepSeek-V4-Flash-0731 使用 DeepSeek Harness(即将发布)的最小模式作为智能体框架进行评估,采用
max推理强度级别并配合temperature = 1.0, top_p = 0.95。 - † DSBench-FullStack 是内部全栈开发测试集;DSBench-Hard 是内部高难度编码智能体问题测试集。
对话模板
本次发布不包含 Jinja 格式的对话模板。取而代之,我们提供了一个专门的 encoding 文件夹,其中包含 Python 脚本和测试用例,演示如何将 OpenAI 兼容格式的消息编码为模型的输入字符串,以及如何解析模型的文本输出。完整文档请参阅 encoding 文件夹。
reasoning_effort 参数现在支持三个级别——low、high 和 max——用于控制模型在回答前投入的思考量。
简要示例:
from encoding_dsv4 import encode_messages, parse_message_from_completion_text
messages = [
{"role": "user", "content": "hello"},
{"role": "assistant", "content": "Hello! I am DeepSeek.", "reasoning_content": "thinking..."},
{"role": "user", "content": "1+1=?"}
]
# messages -> string
prompt = encode_messages(messages, thinking_mode="thinking", reasoning_effort="max")
# string -> tokens
import transformers
tokenizer = transformers.AutoTokenizer.from_pretrained("deepseek-ai/DeepSeek-V4-Flash-0731")
tokens = tokenizer.encode(prompt)
如何使用 vLLM 运行
通过单个标志即可启用 DSpark 投机解码——在 vLLM 启动命令中添加带 method: dspark 的 --speculative-config:
--speculative-config '{"method":"dspark","num_speculative_tokens":7,"draft_sample_method":"greedy"}'
例如,以下命令在单个 4×GB300 节点上使用 vLLM 部署该模型。 详细说明及其他硬件配置请参阅 vLLM recipe。
vllm serve deepseek-ai/DeepSeek-V4-Flash-0731 \
--trust-remote-code --kv-cache-dtype fp8 --block-size 256 \
--data-parallel-size 4 --enable-expert-parallel \
--moe-backend deep_gemm_mega_moe \
--attention-config '{"use_fp4_indexer_cache": true}' \
--speculative-config '{"method":"dspark","num_speculative_tokens":7,"draft_sample_method":"greedy"}'
如何使用 SGLang 运行
使用 --speculative-algorithm DSPARK 启用 DSpark,且不要单独设置 --speculative-draft-model-path,因为目标权重和草稿权重来自同一检查点。
详细说明、基准测试及其他硬件配置请参阅 SGLang cookbook。
sglang serve \
--trust-remote-code \
--model-path deepseek-ai/DeepSeek-V4-Flash-0731 \
--tp 4 \
--moe-runner-backend flashinfer_mxfp4 \
--speculative-algorithm DSPARK \
--mem-fraction-static 0.90 \
--chunked-prefill-size 4096 \
--swa-full-tokens-ratio 0.1 \
如何在本地运行
本地运行 DeepSeek-V4 的详细说明(包括模型权重转换和交互式对话演示)请参阅 inference 文件夹。
对于本地部署,我们建议将采样参数设置为 temperature = 1.0,智能体场景使用 top_p = 0.95,其他情况使用 top_p = 1.0。对于 high 和 max 推理强度级别,我们建议最大输出长度为 384K 个 token。
许可证
本仓库及模型权重依据 MIT 许可证 授权。
引用
@misc{deepseekai2026deepseekv4,
title={DeepSeek-V4: Towards Highly Efficient Million-Token Context Intelligence},
author={DeepSeek-AI},
year={2026},
}
联系方式
如有任何问题,请提交 issue 或通过 [email protected] 联系我们。
来源:DeepSeek 模型发布 · hf-mirror.com