JetBrains发布Mellum2.1 MTP权重,推理提速1.4-1.8倍
JetBrains/Mellum2.1-12B-A2.5B-Thinking-MTP · Hugging Face
本地部署大模型的同学注意,JetBrains开源了Mellum2.1的MTP投机解码权重,实测推理提速近一倍且无需改动输出逻辑,直接下载safetensors即可接入主流推理框架。
Mellum2.1 Thinking with the MTP head
Multi-token prediction head
多令牌预测头(Multi-token prediction head)
The multi-token prediction (MTP) head is one extra transformer block, trained together with the model, that predicts the token after the one just sampled. Inference engines use it as a speculative draft: the model verifies every drafted token, so the output is unchanged while decoding runs 1.4–1.8x faster, with about 90% of the drafted tokens accepted. The head lives in model-mtp.safetensors under the mtp. prefix, announced by num_nextn_predict_layers: 1 in config.json; everything else is identical to Mellum2.1 Thinking.
多令牌预测(MTP)头是一个额外的 Transformer 模块,与模型一起训练,用于预测刚刚采样的令牌之后的下一个令牌。推理引擎将其用作推测性草稿:模型会验证每一个草稿令牌,因此输出保持不变,而解码速度提升 1.4–1.8 倍,约 90% 的草稿令牌被接受。该头位于 model-mtp.safetensors 文件中 mtp. 前缀下,在 config.json 中通过 num_nextn_predict_layers: 1 声明;其余部分与 Mellum2.1 Thinking 完全相同。
- vLLM 0.33 or newer: --speculative-config '{"method": "mtp", "num_speculative_tokens": 1}', as in the serving commands above.
- transformers 5.20 or newer: pass use_mtp=True to generate.
- llama.cpp: use the GGUF repository with --spec-type draft-mtp --spec-draft-n-max 1.
- vLLM 0.33 或更高版本:--speculative-config '{"method": "mtp", "num_speculative_tokens": 1}',如上服务命令所示。
- transformers 5.20 或更高版本:向 generate 传递 use_mtp=True。
- llama.cpp:使用 GGUF 仓库并添加 --spec-type draft-mtp --spec-draft-n-max 1。
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力