arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2401.17377cs.CLcs.AIcs.IR
收藏

Infini-gram:将无界 n-gram 语言模型扩展到万亿级 Token

Infini-gram: Scaling Unbounded n-gram Language Models to a Trillion Tokens

University of Washington(华盛顿大学);Allen Institute for Artificial Intelligence(艾伦人工智能研究所)

Jiacheng Liu, Sewon Min, Luke Zettlemoyer, Yejin Choi, Hannaneh Hajishirzi

AI总结:

本文提出 ∞-gram 框架和 infini-gram 引擎,将 n-gram 语言模型扩展到 5 万亿 Token 并支持任意 n,证明其能辅助神经 LLM 降低困惑度并揭示其预训练缺陷。

摘要:

在神经大语言模型(LLMs)时代,n-gram 语言模型是否仍然具有价值?我们的回答是肯定的,并展示了它们在文本分析和改进神经 LLMs 两方面的价值。为此,我们从两个方面对 n-gram 语言模型进行了现代化改造。首先,我们在与神经 LLMs 相同的数据规模上训练它们——5 万亿个 Token。这是有史以来构建的最大规模的 n-gram 语言模型。其次,现有的 n-gram 语言模型使用较小的 n,这限制了它们的性能;我们则通过引入一种新的带有 backoff 的 ∞-gram 语言模型,允许 n 任意大。我们没有预先计算 n-gram 计数表(这将非常昂贵),而是开发了一个名为 infini-gram 的引擎——由后缀数组驱动——能够以毫秒级延迟计算 ∞-gram(以及任意 n 的 n-gram)概率。∞-gram 框架和 infini-gram 引擎使我们能够对人类书写和机器生成的文本进行许多新颖而有趣的分析:我们发现 ∞-gram 语言模型在下一 Token 预测方面具有相当高的准确率(47%),并且可以补充神经 LLMs 以大幅降低其困惑度。在分析机器生成的文本时,我们还观察到机器与 ∞-gram 一致程度在后缀长度方面存在不规则性,这表明神经 LLM 预训练和 Transformer 的位置嵌入存在缺陷。

英文摘要:

Are $n$-gram language models still relevant in this era of neural large language models (LLMs)? Our answer is yes, and we showcase their values in both text analysis and improving neural LLMs. This was done by modernizing $n$-gram LMs in two aspects. First, we train them at the same data scale as neural LLMs -- 5 trillion tokens. This is the largest $n$-gram LM ever built. Second, existing $n$-gram LMs use small $n$ which hinders their performance; we instead allow $n$ to be arbitrarily large, by introducing a new $\infty$-gram LM with backoff. Instead of pre-computing $n$-gram count tables (which would be very expensive), we develop an engine named infini-gram -- powered by suffix arrays -- that can compute $\infty$-gram (as well as $n$-gram with arbitrary $n$) probabilities with millisecond-level latency. The $\infty$-gram framework and infini-gram engine enable us to conduct many novel and interesting analyses of human-written and machine-generated text: we find that the $\infty$-gram LM has fairly high accuracy for next-token prediction (47%), and can complement neural LLMs to greatly reduce their perplexity. When analyzing machine-generated text, we also observe irregularities in the machine--$\infty$-gram agreement level with respect to the suffix length, which indicates deficiencies in neural LLM pretraining and the positional embeddings of Transformers.

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

↑