AI 与机器学习2025arxiv.org
FFT 反击:自注意力的一种高效替代方案
The FFT Strikes Back: An Efficient Alternative to Self-Attention
进阶 · 约 60 分钟读完前置知识:Transformer 自注意力机制、傅里叶变换与卷积定理、计算复杂度分析基础
导读
这篇论文提出用快速傅里叶变换(FFT)替代 Transformer 中的自注意力机制,以更高效地实现序列建模。其思路基于卷积定理:把时域中昂贵的卷积运算转换到频域变成简单的乘法,从而降低计算复杂度。
HN 关注点:自注意力是 Transformer 的核心瓶颈,任何能大幅降低其计算成本的替代方案都直接关系到 LLM 的训练与推理效率,因此 HN 读者关注其有效性及与已有工作的关系。
HN 评论精选
这几条评论里:质疑 2 补充 2
质疑指出这是 Google FNet 已探索过的旧思路,且硬件上 FFT 未必更快
Google 在 2022 年就提出过类似想法(FNet: Mixing Tokens with Fourier Transforms)。后来他们发现,在大多数场景下 TPU 的矩阵乘法速度其实比 FFT 更快。
yagizdegirmenci查看英文原文
Google introduced this idea in 2022 with "FNet: Mixing Tokens with Fourier Transforms" [0]. Later they found out that, performance of their TPU(s) for matrix multiplication was faster than FFT in the most scenarios. [0]: https://arxiv.org/abs/2105.03824
补充解释论文核心原理:用卷积定理把卷积变成频域乘法
本质上利用了卷积定理:直接空间中昂贵的卷积在倒数空间(频域)中变成简单乘法,反之亦然。凡是对数据做卷积运算的地方,都可以变换到共轭域把它变成乘法。换句话说,在最适合你数据的域中工作。
xeonmc查看英文原文
Basically leverages convolution theorem[0]: expensive convolutions in direct space becomes simple multiplications in reciprocal space, and vice versa. Whereever you have a convolution operation on your data, transform them to the conjugate domain to turn it into multiplication. In other words, work in the domain that is natural to your data. [0] https://en.wikipedia.org/wiki/Convolution_theorem
质疑质疑注意力的必要性:小数据集上全连接层效果反而更好
我不理解为什么需要注意力机制——全连接层同样能'关注'所有输入。在很小的数据集(0-500 个 token)上,我发现注意力让训练更慢、效果更差。我猜它的优势要在大数据集上才显现。当然我只是做个人项目的 AI 新手,不算权威。
antoineMoPa查看英文原文
What I don't get about attention is why it would be necessary when a fully connected layer can also "attend" to all of the input. With very small datasets (think 0 - 500 tokens), I found that attention makes training longer and results worse. I guess the benefits show up with much larger datasets. Note that I'm an AI noob just doing some personal AI projects, so I'm not exactly a reference.
补充请求通俗解释:FFT 方法如何等价于注意力并编码位置信息
我承认那些数学完全超出我的理解范围。能否有人用通俗的语言解释:这为什么等价于注意力机制?它说的频率是什么?它如何编码 token 之间的位置关系?
pointlessone查看英文原文
OK, I admit that the math flies way over my head and I barely understand the text around the math. Can someone please explain (in basic English) how this is equivalent to attention mechanism? What friquencies does it talk about? How does it encode positional relations between tokens?
相关资源
从这篇论文所有 HN 讨论帖的全部评论里整理出来的链接。
历次讨论
- 2025Hacker News 讨论帖456 分 · 168 评
同领域还值得读
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 分钟编辑精选