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

将语言模型扩展至128K上下文的数据工程

Data Engineering for Scaling Language Models to 128K Context

University of Edinburgh(爱丁堡大学);MIT-IBM Watson AI Lab(MIT-IBM沃森人工智能实验室);University of Melbourne(墨尔本大学);Ohio State University(俄亥俄州立大学);University of Washington(华盛顿大学);MIT(麻省理工学院);UIUC(伊利诺伊大学香槟分校)

Yao Fu, Rameswar Panda, Xinyao Niu, Xiang Yue, Hannaneh Hajishirzi, Yoon Kim, Hao Peng

AI总结:

本文研究将语言模型上下文扩展至128K的数据工程,发现通过平衡领域混合与长度上采样的1B-5B tokens轻量级持续预训练,即可低成本地使模型具备长上下文检索能力,性能逼近GPT-4。

摘要:

我们研究将语言模型上下文长度扩展至128K的持续预训练方案,重点关注数据工程。我们假设长上下文建模,特别是利用任意输入位置信息的能力,是一项已通过大规模预训练基本获得的能力,并且通过对适当数据混合进行轻量级持续预训练,该能力可轻易扩展至比训练中所见长得多的上下文(例如从4K到128K)。我们研究了持续预训练数据的数量和质量:(1)在数量方面,我们展示了5000万到50亿tokens足以使模型在128K上下文内的任何位置检索信息;(2)在质量方面,我们的结果同样强调领域平衡和长度上采样。具体而言,我们发现对书籍等特定领域的数据简单地进行长数据上采样(这是现有工作的常见做法)会导致次优性能,而平衡的领域混合非常重要。我们证明,在此类1B-5B tokens数据上对完整模型进行持续预训练,是将语言模型上下文长度扩展至128K的有效且经济的策略。我们的方案优于强大的开源长上下文模型,并缩小了与GPT-4 128K等前沿模型的差距。

英文摘要:

We study the continual pretraining recipe for scaling language models' context lengths to 128K, with a focus on data engineering. We hypothesize that long context modeling, in particular \textit{the ability to utilize information at arbitrary input locations}, is a capability that is mostly already acquired through large-scale pretraining, and that this capability can be readily extended to contexts substantially longer than seen during training~(e.g., 4K to 128K) through lightweight continual pretraining on appropriate data mixture. We investigate the \textit{quantity} and \textit{quality} of the data for continual pretraining: (1) for quantity, we show that 500 million to 5 billion tokens are enough to enable the model to retrieve information anywhere within the 128K context; (2) for quality, our results equally emphasize \textit{domain balance} and \textit{length upsampling}. Concretely, we find that naively upsampling longer data on certain domains like books, a common practice of existing work, gives suboptimal performance, and that a balanced domain mixture is important. We demonstrate that continual pretraining of the full model on 1B-5B tokens of such data is an effective and affordable strategy for scaling the context length of language models to 128K. Our recipe outperforms strong open-source long-context models and closes the gap to frontier models like GPT-4 128K.

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

↑