DeepSeek · HF

DeepSeek-V4-Flash-0731

DeepSeek-V4-Flash-0731

二〇二六年八月二十六日 · 英文原文

DeepSeek-AI 发布 DeepSeek-V4-Flash-0731,为 DeepSeek-V4-Flash 官方版本,取代预览版,agent 能力增强,结构与 DeepSeek-V4-Flash-DSpark 相同,附带投机解码模块。其激活参数远小于 V4-Pro(预览版),但在 Terminal Bench 2.1(82.7)、NL2Repo(54.2)、Cybergym(76.7)、DeepSWE(54.4)等 benchmark 上表现更优,与 GLM-5.2、Opus-4.8 等最强闭源模型基本持平。模型支持 `reasoning_effort` 三档(low、high、max),可通过 vLLM 启用 DSpark 投机解码,基于 MIT License 发布。

DeepSeek-V4-Flash-0731

简介

DeepSeek-V4-Flash-0731DeepSeek-V4-Flash 的官方发布版本,取代了预览版,agent 能力大幅增强。它与 DeepSeek-V4-Flash-DSpark 具有相同的模型结构,即附带一个投机解码(speculative decoding)模块。

尽管 DeepSeek-V4-Flash-0731 的激活参数数量远小于 DeepSeek-V4-Pro(预览版),但在下述 benchmark 上表现更优,并与目前最强的闭源模型基本持平。

Benchmark 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

说明:

  1. 在上述公开 benchmark 的 Code Agent 任务中,DeepSeek-V4-Flash-0731 使用 DeepSeek Harness(即将发布)的最小模式作为 agent 框架进行评估,采用 max 推理努力级别,temperature = 1.0, top_p = 0.95
  2. † DSBench-FullStack 是内部全栈开发测试集;DSBench-Hard 是内部困难编码 agent 问题测试集。

Chat 模板

本次发布不包含 Jinja 格式的 chat 模板。我们提供了一个专门的 encoding 文件夹,内含 Python 脚本和测试用例,演示如何将 OpenAI 兼容格式的消息编码为模型的输入字符串,以及如何解析模型的文本输出。完整文档请参阅 encoding 文件夹。

reasoning_effort 参数现在支持三个级别——lowhighmax——用于控制模型在回答前的思考投入程度。

简要示例:

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 投机解码只需一个 flag 即可启用——在 vLLM 启动命令中添加 --speculative-config,方法设为 dspark

--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"}'

本地运行

关于在本地运行 DeepSeek-V4 的详细说明,包括模型权重转换和交互式聊天演示,请参阅 inference 文件夹。

对于本地部署,我们建议将采样参数设置为 temperature = 1.0,agent 场景下 top_p = 0.95,其他场景下 top_p = 1.0。对于 highmax 推理努力级别,我们建议最大输出长度为 384K tokens。

许可证

本仓库和模型权重基于 MIT License 许可。

引用

@misc{deepseekai2026deepseekv4,
      title={DeepSeek-V4: Towards Highly Efficient Million-Token Context Intelligence},
      author={DeepSeek-AI},
      year={2026},
}

联系方式

如有任何问题,请提交 issue 或发送邮件至 service@deepseek.com。

译自 DeepSeek · HF · 录于 二〇二六年八月二十六日