Infini-gram: Scaling Unbounded n-gram Language Models to a Trillion Tokens
2024/01/30 by Jiacheng Liu, Liu, Jiacheng, Sewon Min +7 · 10 voices · 40 citations
Computer Science · #Natural Language Processing Techniques #Topic Modeling
paper · pdf · doi:10.48550/arxiv.2401.17377
Abstract
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 ∞-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 ∞-gram (as well as n-gram with arbitrary n) probabilities with millisecond-level latency. The ∞-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 ∞-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--∞-gram agreement level with respect to the suffix length, which indicates deficiencies in neural LLM pretraining and the positional embeddings of Transformers.
Cited by
Discussions
- Infini-Gram: Scaling unbounded n-gram language models to a trillion tokens [hn, 142 points, 58 comments]
- random post o-the-day infinigram what if we made a language model that was just a very large trie? like, we just counted all the letter sequences and what comes after them. that's infinigram. written [bsky, 57 points, 3 comments]
- We got really big Markov chains too dw arxiv.org/abs/2401.17377 [bsky, 9 points, 1 comments]
- Infini-gram: Scaling Unbounded n-gram Language Models to a Trillion Tokens [bsky, 7 points, 0 comments]
- Infini-gram: Scaling Unbounded n-gram Language Models to a Trillion Tokens [lobsters, 5 points, 4 comments]
- Not to my knowledge, but this paper is related: arxiv.org/abs/2401.17377 The dark downside of SOTA chasing is that there is no room to try ideas that don't immediately deliver comparable performance [bsky, 2 points, 1 comments]
- Counterpoint - perhaps there is still much to be done [bsky, 1 points, 0 comments]
- If you have a model that can give you the count of any arbitrary length ngram in a dataset, what's the right search pattern to find the maximum suffix of an input that exists? I got nerd sniped into t [bsky, 1 points, 1 comments]
- Thinking way too much about making chains right now... Re-reading arxiv.org/abs/2401.17377 [bsky, 1 points, 0 comments]
- Infini-Gram: Scaling unbounded n-gram language models to a trillion tokens (arxiv.org) Main Link | Discussion [bsky, 0 points, 0 comments]
Related