AI 与机器学习2025arxiv.org
多 Token 注意力
Multi-Token Attention
进阶 · 约 60 分钟读完前置知识:Transformer 注意力机制、长上下文建模
导读
这篇论文提出 Multi-Token Attention(MTA),改进 Transformer 的注意力机制:不再只依赖单个 query-key 向量的点积相似度,而是让相邻多个 token 的信息共同参与匹配,从而提升模型定位和利用长上下文中关键信息的能力。作者称该方法在长上下文任务上带来性能提升。
HN 关注点:是因为它修改了注意力机制的核心计算方式,讨论焦点集中在其实际收益(是否在同等算力下更优)和工程可行性(与 Flash Attention 等优化库不兼容、计算和显存开销)。
HN 评论精选
这几条评论里:质疑 3 补充 1
质疑质疑局部窗口化与注意力解决长距离依赖的初衷相悖
为什么期望“相邻”token 能增加相似度里的信息?这在单个词内部或许成立,但注意力机制的全部意义就在于解决长距离依赖。重新引入局部窗口在我看来像是倒退。
cgearhart查看英文原文
Why is there an expectation that “nearby” tokens are relevant to increase the information in the similarities? That seems like it would hold true within individual words, but the whole point of attention was to solve long range dependencies. Reintroducing local windows seems like a step backwards to me.
质疑担忧计算/显存开销进一步加剧二次方瓶颈
所以我们是把一个已经随上下文长度二次方增长的东西再乘性放大?内存带宽利用率本来就已经是个瓶颈了。
bob1029查看英文原文
So, we're proposing a multiplicative increase of something that already scales quadratically with the context size? I think we've already got a bit of a bottleneck in terms of memory bandwidth utilization.
质疑质疑收益是否只是靠更多算力换来的
当然,在不同地方投入更多算力可以换来更好的模型性能。但在同等 FLOPs(isoflop)的基准下它是否提升了性能?
bigdict查看英文原文
Sure, you can get better model performance by throwing more compute at the problem in different places. Does is it improve perf on an isoflop basis?
补充指出工程落地难题:与 Flash Attention 不兼容,FlexAttention 尚不成熟
这是 Meta 对 Transformer 架构的又一潜在改进(同一批作者还有另一篇 https://arxiv.org/abs/2405.18719),但有个初看不明显的大问题:不做大量工程工作就没法实际使用。它改动了注意力内部机制,因此与 Flash Attention(或任何优化注意力库)不兼容,而没有 Flash Attention 你不会想训练任何超出玩具规模的模型,性能损失太大。PyTorch 的 FlexAttention 或许能让它变得可行,但目前 bug 太多。
kouteiheika查看英文原文
This is another potential improvement to the transformer architecture from Facebook (the other one that comes to mind is this one from same authors: https://arxiv.org/abs/2405.18719), but note that it comes with a major problem that might not be obvious at first glance: it's just not usable in practice without a ton of work. It modifies the innards of the attention mechanism, so it is incompatible with Flash Attention (or any other optimized attention library), and you do not want to train anything beyond toy models without Flash Attention (the performance hit is just way too big). There's pytorch's FlexAttention which could maybe make this practical, but currently it's just way too buggy.
相关资源
从这篇论文所有 HN 讨论帖的全部评论里整理出来的链接。
历次讨论
- 2025Hacker News 讨论帖152 分 · 44 评
同领域还值得读
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 分钟编辑精选