AI 与机器学习2021arxiv.org编辑精选
像 Transformer 一样思考
Thinking Like Transformers
进阶 · 约 90 分钟读完前置知识:Transformer 注意力机制、函数式编程基础
导读
这篇论文提出 RASP——一种面向 Transformer 的编程语言,用选择-聚合等高阶操作来描述注意力机制能完成的计算,帮助人们像写程序一样理解和推理 Transformer 的表达能力。它把 Transformer 的内部计算抽象成可组合的程序原语,便于可视化和实验。
HN 关注点:是因为提供了一种直观理解 Transformer 计算模型的方式,讨论焦点在于这种编程模型是否具有实际意义——模型未必会从数据中学到这些程序。
HN 评论精选
这几条评论里:质疑 2 补充 1 亲历 1
质疑质疑实用性:网络未必能从数据中学到这些程序,RNN 的前车之鉴
这很有意思,不过简单的全连接或卷积网络其实也能编码计算机程序。事实上,RNN 当初的期望就是学会程序,但由于神经网络训练的种种怪异之处,实践中从未达到令人满意的程度。所以为 Transformer 找到一个编程模型未必像表面那样实用,因为无法保证它们会从数据中学到这些程序。
0-_-0查看英文原文
This is nice, however simple fully connected or convolutional networks can encode computer programs too. In fact, the hope for RNNs was that they will learn computer programs, but due to the weirdness of neural network training that never happened in practice to a satisfying degree. So finding a programming model for Transformers is not necessarily as practical as it first seems, since there's no guarantee that they will learn these programs from data.
亲历亲历推荐:RASP 让 Transformer 变得可把玩,且容易移植到 Python
我很喜欢这篇论文。以前读 ML 论文时总觉得难以把 Transformer 可视化,有了它就可以直接上手把玩。这些不过是简单的高阶函数,任何语言都能实现,所以移植到 Python、在 Jupyter notebook 里玩一下非常容易。
xiphias2查看英文原文
I love this paper, I always had an issue of visualizing transformers from reading ML papers, with this I can just play with it. These are simple higher-order functions that can be implemented in any language though, so porting to Python and playing with it in a Jupyter notebook is trivial.
质疑质疑适用场景:深度网络本用于逻辑未知的任务,RASP 难以覆盖
(没读完全文,只看了摘要、语言定义和部分实验)不确定这在 Transformer 的大背景下有多大用处。Transformer(以及深度网络)通常用于解决问题的逻辑基本未知的场景。比如:你怎么写一个 RASP 程序来识别文档中的人名?论文里确实有一些 Transformer 能完成的简单 RASP 例子(如符号推理),但这些通常是模型为原任务训练后顺带获得的能力,而不是任务本身。
xmaayy查看英文原文
(DID NOT READ THE ENTIRE PAPER, only the abstract, the definition of the language and some of the experiments) Note sure how useful this is in the larger context of transformers. Transformers (and deep networks in general) are often used when the logic to be used in solving a problem is largely unknown. Example -- How do you write a RASP program that identifies names in a document? They do have some simple RASP examples in the paper of things that a transformer model can accomplish (Symbolic Reasoning in Transformers) but, again, this is usually something that the model can do as a result of the task it was originally trained for, not a task in and of itself.
补充提醒读者放下预期,把链接当作学习新知识的机会
说点元层面的:这个链接对 HN 的价值在于激发好奇心。我起初以为这是研究某种像电影里变形金刚那样的计算模型(扫描物体并重构/变形),很快发现是另一回事,但依然有趣、值得深入了解。所以别因为内容与预期不符就失望,换个心态去对待陌生的信息。
neogodless查看英文原文
To go a bit meta, I think this link contributes to Hacker News because it sparks curiosity. While I was among those wondering if this would look into some kind of computational model that did what Transformers do (at least in the modern movies), scan an object in order to reconstruct it / reconfigure itself into that object, I quickly realized this is about something else. But it is something interesting and worth learning more about[0]. So just get over your prime instinct to be disappointed that the subject doesn't match your expectations, and change your attitude towards information shared that feels alien. [0] https://en.wikipedia.org/wiki/Transformer_(machine_learning_model)
相关资源
从这篇论文所有 HN 讨论帖的全部评论里整理出来的链接。
历次讨论
- 2021Hacker News 讨论帖161 分 · 42 评
同领域还值得读
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 分钟编辑精选