论文精选

Soft-MTP:一行代码改进多 Token 预测训练

Multi-Token Prediction Done Right

精选理由

一篇关于 MTP 训练细节的论文:作者发现梯度里的噪声项,改成只传 KL 自蒸馏信号,一行代码就能让各规模模型更准、解码更快,代码已开源。

论文指出现有 Multi-Token Prediction(MTP)训练中存在一个缺陷:MTP 交叉熵梯度里混杂着一个低信噪比的残差项,会干扰 next-token 学习,且规模越大问题越明显。作者提出 KL 梯度恢复技巧,用 straight-through 梯度路由从现有交叉熵计算中精确恢复 KL 自蒸馏信号,无需词表级 logit 矩阵,兼容标准融合交叉熵内核。由此得到的 Soft-MTP 是一行代码的改动,支持 DeepSeek 和 Meta 两种 MTP 风格,不增加参数、无可测开销。从 167M 到 1.2B 参数的实验中,Soft-MTP 在各规模都降低了 NTP 困惑度、加速投机解码并提高 zero-shot 准确率,689M 起降低 MTP 困惑度,1.2B 微调后数学和代码推理更强。代码开源于 GitHub。

原文 · arXiv: DeepSeek

Multi-Token Prediction Done Right

Multi-Token Prediction (MTP) is now a common ingredient in language-model pre-training, as it improves downstream performance and enables faster inference through speculative decoding. We identify a flaw in standard MTP training, in which a residual component of the MTP gradient interferes with both next-token and multi-token learning, increasingly so with scale. Specifically, the MTP cross-entropy gradient can be decomposed exactly into a KL self-distillation term that pulls each MTP head toward the model's own next-token prediction (NTP) distribution and improves speculative decoding, and a residual that has a low signal-to-noise ratio and buries the useful KL signal. We introduce the KL gradient-recovery trick: when two distributions share a linear output head, the gradient of their KL divergence can be recovered exactly by combining their cross-entropy gradients through straight-through gradient routing. Unlike minimizing the KL directly, this trick requires no vocabulary-sized logit matrices and is compatible with standard fused cross-entropy kernels. This enables Soft Multi-Token Prediction (Soft-MTP), a one-line code change to MTP that removes the noisy residual and backpropagates only the KL self-distillation signal by reusing the existing NTP and MTP cross-entropy computations. Soft-MTP supports both DeepSeek- and Meta-style MTP, adds no parameters, and incurs no measurable overhead. From 167M to 1.2B parameters, Soft-MTP improves over standard MTP with lower NTP perplexity, faster speculative decoding and higher zero-shot accuracy at every scale, lower MTP perplexity from 689M onward, and stronger math and code reasoning after fine-tuning at 1.2B. Soft-MTP also matches, if not exceeds, direct KL divergence minimization on most metrics. Soft-MTP is, in effect, a free lunch for MTP optimization. Our code can be found at https://github.com/JaydenTeoh/Soft-MTP.