[论文解读] Better & Faster Large Language Models via Multi-token Prediction
该论文训练语言模型以同时预测多个未来标记,从而提升样本效率并通过自我推断解码实现更快的推理,在代码任务上取得显著提升,且在参数达到13B时具有扩展性收益。
Large language models such as GPT and Llama are trained with a next-token prediction loss. In this work, we suggest that training language models to predict multiple future tokens at once results in higher sample efficiency. More specifically, at each position in the training corpus, we ask the model to predict the following n tokens using n independent output heads, operating on top of a shared model trunk. Considering multi-token prediction as an auxiliary training task, we measure improved downstream capabilities with no overhead in training time for both code and natural language models. The method is increasingly useful for larger model sizes, and keeps its appeal when training for multiple epochs. Gains are especially pronounced on generative benchmarks like coding, where our models consistently outperform strong baselines by several percentage points. Our 13B parameter models solves 12 % more problems on HumanEval and 17 % more on MBPP than comparable next-token models. Experiments on small algorithmic tasks demonstrate that multi-token prediction is favorable for the development of induction heads and algorithmic reasoning capabilities. As an additional benefit, models trained with 4-token prediction are up to 3 times faster at inference, even with large batch sizes.
研究动机与目标
- 将多标记预测作为比单次预测更高样本效率的LLM训练目标的动机。
- 提出一种内存高效的多标记预测架构,具有共享干线和多个头。
- 展示使用多标记预测在模型规模扩大时的扩展收益和更快的推理,尤其是在代码任务中。
- 表明多标记预测在微调后对自然语言生成和下游任务的性能保持或提升。
提出的方法
- 引入一个多标记预测目标,在每个位置使用n个独立头在共享干线上预测n个未来标记。
- 推导一个可行的交叉熵损失L_n,它在共享表示和每头预测上分解。
- 描述一种内存高效的前向/反向传播方案,将峰值内存从O(nV+d)降低到O(V+d)。
- 使用自我推断解码以通过额外的头来加速推理,而无需额外的草案模型。
- 在不同模型规模(高达13B参数)和数据规模下,对代码与自然语言基准进行评估,包括字节级标记化。

实验结果
研究问题
- RQ1在训练时预测多个未来标记是否相对于标准的下一个标记预测能改善下游性能?
- RQ2多标记预测如何随模型规模和训练数据扩展在代码与自然语言任务中表现?
- RQ3多标记训练是否能通过推测解码实现更快的推理而不增加额外的计算成本?
- RQ4不同预测窗口大小(n)对不同任务和数据情景的性能有何影响?
主要发现
- 多标记预测具有更高的样本效率,13B参数模型在HumanEval上比单次标记基线多解决约12%的题目,在MBPP上多出约17%。
- 4标记预测的训练能带来显著提升,并通过自我推断解码实现最高可达3x的推理加速,尤其在代码基准上。
- 收益随模型规模增加而扩展,并在多轮训练下持续存在,在代码任务和字节级建模方面尤其显著。
- 在标准NLP基准上,2标记预测通常与单次标记基线相当,而4标记预测在某些语言任务上可能降低性能,表明效果取决于任务与数据。
- 在CodeContests上微调预训练的多标记模型能提高通过率(pass@k),在4标记预训练基础上再进行单次标记微调有时成为整体最强方案。

阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。