AI 与机器学习2024arxiv.org
Infini-Gram:将无界 n-gram 语言模型扩展到一万亿 token
Infini-Gram: Scaling unbounded n-gram language models to a trillion tokens
进阶 · 约 45 分钟读完前置知识:n-gram 语言模型、后缀数组/后缀树、神经语言模型基础
导读
这篇论文提出 Infini-Gram:借助后缀数组/后缀树一类的索引结构,在海量语料(规模达万亿 token)上构建上下文长度不受限的 n-gram 语言模型,从而突破了传统 n-gram 受上下文长度和存储限制。它把这种超大 n-gram 模型用作神经语言模型的插值或重打分组件,据 HN 评论所述,困惑度提升幅度可与参数量扩大 10 倍相当。
HN 关注点:焦点在于:一个基于检索的 n-gram 模型竟能带来相当于 10 倍参数量的困惑度收益,这让人怀疑前馈层是否只是训练集的有损索引、大量“预期输出”其实近似存在于训练语料中。
HN 评论精选
这几条评论里:质疑 1 补充 1 亲历 1
补充把 FFN 视为训练集的有损索引,提议用 Infini-Gram 替代前馈层。
我目前对 LLM 的理解是:attention 从输入中提炼信息(比如“red balloon”变成一个表示 red 与 balloon 的向量),而前馈层则像是对训练集建立的有损压缩索引。从这篇论文看,一个更好的 n-gram 索引带来的困惑度提升,相当于把参数量扩大 10 倍。那么是否值得训练一种注意力头更多、并用 infinigram 取代前馈层的新基础模型?
kmeisthax查看英文原文
My current mental model of LLMs is that attention refines information from the input (e.g. "red balloon" becomes some vector that means red + balloon), and that the feed-forward layers are lossy compressed indexes into the training set. From the paper, having a better n-gram index is giving as much perplexity improvement as a 10x increase in parameters. I wonder if it would make sense to train new foundation models with more attention heads and use infinigram in lieu of the feed-forward layer.
质疑模型大量输出可能只是训练语料的近似复现。
在我看来,这说明了模型预期输出中有相当大一部分几乎逐字地存在于训练数据里。
tgv查看英文原文
What this shows, IMO, is that quite a lot of the expected output is almost literally present in the training data.
亲历指出 2015 年用压缩后缀树加 Kneser–Ney 平滑的先行工作,认为结合更大语料可进一步改进。
我们 2015 年的一篇论文(被本文作者引用)使用了更复杂的数据结构(压缩后缀树)和 Kneser–Ney 平滑,实现了同样的“无限”上下文。我想,若采用更好的平滑,并配上作者使用的同等规模语料,应该能在部分结果上超过本文。当年神经语言模型才刚兴起,我们曾短暂尝试用这种无限 n-gram 模型做预训练,但没得到任何结果。[1] https://aclanthology.org/D15-1288.pdf
matt4711查看英文原文
A paper [1] we wrote in 2015 (cited by the authors) uses some more sophisticated data structures (compressed suffix trees) and Kneser–Ney smoothing to get the same "unlimited" context. I imagine with better smoothing and the same larger corpus sizes as the authors use this could improve on some of the results the authors provide. Back then neural LMs were just beginning to emerge and we briefly experimented with using one of these unlimited N-gram models for pre-training but never got any results. [1] https://aclanthology.org/D15-1288.pdf
相关资源
从这篇论文所有 HN 讨论帖的全部评论里整理出来的链接。
历次讨论
- 2024Hacker News 讨论帖142 分 · 58 评
同领域还值得读
DeepSeek-R1:通过强化学习激励 LLM 的推理能力
DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via RL
研究如何用强化学习激励大语言模型的推理能力,提出 DeepSeek-R1,并探讨 RL 训练对模型推理表现的影响。
AI 与机器学习2025 · 1,351 分 · 1,056 评 · 引用 30进阶 · 约 80 分钟编辑精选1-bit LLM 时代:面向低成本计算的三值参数
The Era of 1-bit LLMs: ternary parameters for cost-effective computing
提出用三值参数 {-1, 0, 1} 替代 LLM 中的浮点权重,即所谓“1-bit LLM”。
AI 与机器学习2024 · 1,040 分 · 447 评 · 引用 19进阶 · 约 45 分钟编辑精选DeepSeek-V3.2:推进开放大语言模型的前沿
DeepSeek-v3.2: Pushing the frontier of open large language models
这是 DeepSeek-V3.2 的技术报告,延续了 DeepSeek 开源权重模型的路线,目标是让开放模型继续逼近甚至追平前沿闭源模型。
AI 与机器学习2025 · 982 分 · 465 评进阶 · 约 90 分钟编辑精选通过自我对弈与通用强化学习掌握国际象棋和将棋(AlphaZero)
Mastering Chess and Shogi by Self-Play with General Reinforcement Learning
DeepMind 的 AlphaZero 论文:用通用强化学习算法(自我博弈 + MCTS + 神经网络),从零开始仅数小时训练便在国际象棋和将棋上击败了世界顶级引擎 Stock…
AI 与机器学习2017 · 539 分 · 270 评 · 引用 13进阶 · 约 90 分钟编辑精选用强化学习发现更快的矩阵乘法算法
Discovering faster matrix multiplication algorithms with reinforcement learning
论文提出 AlphaTensor,用强化学习搜索矩阵乘法算法。
AI 与机器学习2022 · 518 分 · 111 评专业 · 约 90 分钟编辑精选