arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2404.19737cs.CL
收藏

通过多 token 预测实现更好且更快的大语言模型

Better & Faster Large Language Models via Multi-token Prediction

FAIR at Meta(Meta FAIR研究院);CERMICS Ecole des Ponts ParisTech(巴黎路桥学校CERMICS);LISN Université Paris-Saclay(巴黎萨克雷大学LISN)

Fabian Gloeckle, Badr Youbi Idrissi, Baptiste Rozière, David Lopez-Paz, Gabriel Synnaeve

AI总结:

本文提出多 token 预测训练方法,通过在共享主干上增加多个输出头同时预测未来多个 token,在保持训练开销不变的情况下提升样本效率、代码生成表现和推理速度。

摘要:

GPT 和 Llama 等大语言模型通常使用下一 token 预测损失进行训练。本文提出,训练语言模型一次性预测多个未来 token 能够带来更高的样本效率。具体而言,在训练语料中的每个位置,我们让模型在共享主干网络之上使用 n 个独立的输出头来预测接下来的 n 个 token。将多 token 预测视为辅助训练任务后,我们在代码和自然语言模型上均观察到下游能力的提升,且训练时间没有额外开销。该方法对更大规模的模型愈发有效,并且在多轮训练时仍保持优势。提升在代码生成等生成式基准上尤为显著,我们的模型持续以数个百分点的优势超越强基线。我们的 13B 参数模型在 HumanEval 上比同类下一 token 模型多解决 12% 的问题,在 MBPP 上多解决 17% 的问题。在小规模算法任务上的实验表明,多 token 预测有利于归纳头的形成和算法推理能力的发展。作为额外优势,使用 4-token 预测训练的模型在推理时速度最高可提升 3 倍,即使在大批量规模下也是如此。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑