AI 与机器学习2022nature.com编辑精选
用强化学习发现更快的矩阵乘法算法
Discovering faster matrix multiplication algorithms with reinforcement learning
专业 · 约 90 分钟读完前置知识:矩阵乘法与算法复杂度、强化学习基础、张量分解与张量秩
导读
论文提出 AlphaTensor,用强化学习搜索矩阵乘法算法。它在特定硬件和编译器栈下找到了实践上优于 Strassen-square 的实现(但理论复杂度相同),并支持以张量秩或实际效率等复杂奖励发现定制算子。HN 讨论集中在“首次超越 Strassen”的表述是否夸大,以及硬件基准是否依赖 XLA、缺少绝对性能数据。
HN 关注点:强化学习发现算法的前景,同时质疑论文对“超越 50 年历史的 Strassen 算法”的宣称和硬件基准的可信度。
后来怎么样
展示了用强化学习搜索新算法的可行性,并激发了后续算法发现研究(如 AlphaDev);但其发现的矩阵乘法算法主要针对特定硬件与编译器栈,未成为通用实践标准。
HN 评论精选
这几条评论里:支持 1 质疑 2
质疑所谓“超越 Strassen”只是针对特定硬件/编译器的实践优化,理论复杂度并未改进,宣称被夸大。
大声明其实有点夸大。原文声称 AlphaTensor 首次改进 Strassen 两级算法;但实际说的是:发现的算法优于 Strassen-square,理论复杂度相同,只是在所考虑的硬件上实践更优,因为针对 XLA 编译器栈做了优化。AlphaTensor 找到的算法加法更多(等价于更稠密的分解),但生成的单个操作能被 XLA 的分组过程高效融合,因此更贴合所用编译栈;对更大矩阵尺寸也有收益。图 5c 还显示针对特定硬件优化的算法在其他硬件上表现不佳。所以这算是针对只存在几年的硬件做优化、却降低了人类可读性?论文里有很多很酷的东西,没必要宣称自己做了其实没做到的事。
svnt查看英文原文
The big claim turns out to be a little overstated. The claim: > AlphaTensor’s algorithm improves on Strassen’s two-level algorithm for the first time, to our knowledge, since its discovery 50 years ago. reduces to: > AlphaTensor discovers algorithms that outperform the Strassen-square algorithm, which is a fast algorithm for large square matrices31,32. Although the discovered algorithm has the same theoretical complexity as Strassen-square, it outperforms it in practice, as it is optimized for the considered hardware. Interestingly, AlphaTensor finds algorithms with a larger number of additions compared with Strassen-square (or equivalently, denser decompositions), but the discovered algorithms generate individual operations that can be efficiently fused by the specific XLA33 grouping procedure and thus are more tailored towards the compiler stack we use. The algorithms found by AlphaTensor also provide gains on matrix sizes larger than what they were optimized for. Finally, Fig. 5c shows the importance of tailoring to particular hardware, as algorithms optimized for one hardware do not perform as well on other hardware. So they improved on Strassen’s 50-year-old algorithm by optimizing it for hardware that has only existed for a few years and de-optimizing it for human use? There is so much cool stuff here without claiming to do something you really didn’t.
支持论文的真正价值在于灵活的奖励机制和发现定制算子的能力,而不只是矩阵乘法。
这篇论文很值得读:方法有趣,理论比较有意思,还给出了针对特定硬件(CPU 和 GPU,支持不同指令集)优化算法的基准。而且不止于此,讨论部分说 AlphaTensor 的灵活性可以支持复杂、随机、不可微的奖励(从张量秩到特定硬件上的实际效率),也能在有限域等各种空间中为定制操作寻找算法。作者相信这会推动 AlphaTensor 去设计优化数值稳定性或能耗等他们未考虑指标的算法。
xpe查看英文原文
The paper is a great read -- an interesting approach, fun theoretical comparisons, plus benchmarks for optimized algorithms for specific hardware (CPU and GPU, allowing for differing instruction sets). But it doesn't stop there; from the "Discussion" section: > One important strength of AlphaTensor is its flexibility to support complex stochastic and non-differentiable rewards (from the tensor rank to practical efficiency on specific hardware), in addition to finding algorithms for custom operations in a wide variety of spaces (such as finite fields). We believe this will spur applications of AlphaTensor towards designing algorithms that optimize metrics that we did not consider here, such as numerical stability or energy usage.
质疑硬件基准可疑:依赖 XLA 自动融合且未报告绝对性能,朴素矩阵乘法可能更快。
引用我在 Twitter 上的话:我很怀疑他们的硬件基准。他们没有写自定义 kernel,而是依赖 XLA 这类图编译器自动融合分解后的矩阵乘法(我猜 XLA 在这方面不会很好)。而且据我所知,他们没在任何地方报告绝对性能数字。换句话说,我怀疑朴素的 N^3 矩阵乘法在性能上会彻底碾压他们。
chillee查看英文原文
Quoting myself on twitter: https://twitter.com/cHHillee/status/1577713102434361344 I'm quite suspicious about their hardware benchmarks. They're not writing custom kernels, they're relying on a graph compiler like XLA to automatically fuse their decomposed matmuls (and my guess is that XLA will not be very good at this). Moreover, as far as I can tell, they don't report absolute performance numbers anywhere. In other words, I suspect that a naive N^3 matrix multiplication would absolutely smoke them in performance.
历次讨论
- 2022Hacker News 讨论帖518 分 · 111 评
同领域还值得读
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 分钟编辑精选对抗策略击败超人类围棋 AI
Adversarial policies beat superhuman Go AIs (2023)
论文研究顶级围棋 AI KataGo 的对抗性漏洞:训练一个对抗策略与冻结的 KataGo 对弈,不靠更强棋力,而是诱导 KataGo 在有利于对手时提前结束或认输。
AI 与机器学习2022 · 501 分 · 185 评 · 引用 5进阶 · 约 60 分钟编辑精选