arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2407.02819cs.CLcs.LG
收藏

利用紧凑且一致的下一词元分布高效训练语言模型

Efficient Training of Language Models with Compact and Consistent Next Token Distributions

Indian Institute of Technology, Bombay(印度理工学院孟买分校)

Ashutosh Sathe, Sunita Sarawagi

AI总结:

本文提出一种紧凑的下一词元分布近似表示,在期望上等价于完整 n-gram 分布并降低小批次方差,从而在提升模型质量和收敛速度的同时,使收益可扩展到更大模型和数据集。

摘要:

最大化下一词元的似然是预训练语言模型的一种既定且统计上合理的目标。本文表明,通过使用折叠的 n-gram 分布对语料库进行预聚合,可以更快地训练出更好的模型。先前研究曾提出将语料库级 n-gram 统计量用作正则化项;然而,如果以朴素方式构建和查询此类 n-gram,代价会很高并显著拖慢训练速度,从而限制了它们在现代大语言模型预训练中的应用。我们引入了一种替代性的紧凑表示来表示下一词元分布,该表示在期望上与完整的 n-gram 分布一致,同时与标准下一词元损失相比显著降低了跨小批次的方差。实验表明,与现有方法相比,n-gram 正则化模型和我们的近似方法在模型质量和收敛速度上都带来了显著提升。此外,与直接的 n-gram 正则化方法相比,我们的近似方法能够将收益扩展到更大的数据集和模型。

英文摘要:

Maximizing the likelihood of the next token is an established, statistically sound objective for pre-training language models. In this paper we show that we can train better models faster by pre-aggregating the corpus with a collapsed $n$-gram distribution. Previous studies have proposed corpus-level $n$-gram statistics as a regularizer; however, the construction and querying of such $n$-grams, if done naively, prove to be costly and significantly impede training speed, thereby limiting their application in modern large language model pre-training. We introduce an alternative compact representation of the next token distribution that, in expectation, aligns with the complete $n$-gram distribution while markedly reducing variance across mini-batches compared to the standard next-token loss. Empirically, we demonstrate that both the $n$-gram regularized model and our approximation yield substantial improvements in model quality and convergence rate compared to existing methods. Furthermore, our approximation facilitates scalability of gains to larger datasets and models compared to the straightforward $n$-gram regularization method.

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

↑