AI 与机器学习2024arxiv.org
逐点思考:Transformer 语言模型中的隐式计算
Let's Think Dot by Dot: Hidden Computation in Transformer Language Models
专业 · 约 90 分钟读完前置知识:计算复杂度理论、Transformer 架构、Chain-of-Thought 概念
导读
论文研究 Transformer 语言模型能否利用无意义的 filler token(如点号)进行“隐藏计算”,以及这种额外 token 是否像 chain-of-thought 一样提升推理表现。作者从理论上分析 Transformer 的表达能力限制(如 TC^0),并说明 filler token 只在某些可并行分解的任务上可能有帮助,并非普遍有效;这也引出对 CoT 可解释性和后门风险的讨论。
HN 关注点:无意义 token 也能带来隐藏计算这一反直觉结果,以及它对 Transformer 表达力上限、CoT 忠实度和后门风险的启示。
HN 评论精选
这几条评论里:质疑 1 补充 3
质疑惊讶于仅增加前向计算、没有有意义状态传递也能产生效果。
这个结果让我惊讶,因为在我看来,该方法只是多做了几次前向传播,并没有在每次传播之间编码或传递有意义的状态。
diziet查看英文原文
This is a surprising result to me, given that (in my mind) the method simply does a few more forward passes, without encoding or transferring meaningful state between each pass.
补充从理论角度解读:filler token 只在可并行分解的演示中有用,揭示 Transformer 表达力限制与后门风险。
这篇论文在我看来是在讨论 Transformer 的根本局限和后门风险。论文先回顾了一个涵盖性理论模型,证明 Transformer 只能表达 TC^0 内的计算(大致上是由相对浅层电路可解的可并行问题集合上界)。还引用了另一篇论文:相对于输入规模,多项式数量的中间 scratchpad 解码步骤能让 Transformer 识别多项式时间可解问题类,线性步骤对应上下文相关语言。本文接着问 filler tokens 是否有帮助;答案是否定的,除了他们构造出的一个很巧妙的例外:那些演示可以被分解为可并行求解的问题。这既指出了实际限制(下一 token 预测的表达力不足以覆盖整个 TC^0),也指出了一个理论能力。论文说:综合来看,当前 LLM 不太可能从 filler tokens 中受益,但这并非当前架构的原则性限制。如果我没理解错,这意味着要让模型学会用 filler 从 CoT 数据中受益,演示必须被组织成可并行计算,而不是更自然的顺序式、随实例自适应的过程。
Vetch查看英文原文
This paper reads to me as being about fundamental limitations of Transformers and backdoor risk. The paper starts off by reviewing work which uses an encompassing theoretical model of transformers to prove they're limited to only expressing computations in TC^0 (roughly, upperbounded by set of parallelizable problems that can be solved by relatively shallow circuits). There's also a reference to a paper which finds that (wrt input problem size), a polynomial number of intermediate scratchpad decoding steps allow transformers to recognize the class of polynomial-time solvable problems, linear steps is context-sensitive languages. This paper now ask about filler tokens, do they help? The answer is negative except for a very clever exception they work out: problems with demonstrations that can be decomposed to be solvable in parallel. This identifies a practical limitation (transformer next token prediction is not expressive enough to capture all of TC^0) at the same as it identifies a theoretical capability. From the paper: > Taken together these findings suggest that although current LLMs are unlikely to benefit from filler tokens, this is not an in-principle limitation of current architectures. If I've understood, this means for learning to use fillers to benefit from CoT data, demonstrations must be structured such that they can be computed in parallel and not as a more natural sequential, instance-adaptive process. > in order to use filler tokens on natural language data, LLMs would need to discover parallelizable algorithmic solutions given access only to CoT demonstrations lacking parallel structure. By training on instance-adaptive chains of thought, we can study whether models can learn to use filler tokens having seen only more naturalistic chain-of-thought data >... > We find that models trained on instance-adaptive CoT data fail to use filler tokens. On filler token sequences, the resulting models remain at, or below, no-intermediate-token, baseline performance, Figure 6. This indicates that there is no transfer from serial, instance-adaptive demonstrations to filler tokens for the 3SUM problem. It also appears that the parallelizable problem must have a certain amount of structural complexity before a gap appears versus no filler modes (unless using an impractical amount of filler tokens): > we expect integer addition tasks will not offer suitably rich structures for taking advantage of filler tokens when using large models—natural-language tasks may offer alternatives Empirically, other papers have shown that LLM performance on complex tasks deteriorates significantly with input length and distractor text. Anyone who has naively attempted to combine RAG with large contexts might also have first hand experience with this. The reason I consider this to be primarily a backdoor risk is that the kind of data and learning required seems highly unlikely to occur naturally but someone could create documents to introduce triggerable obfuscated computations. While not an issue today, future LLM training might need to filter for data with meaningful parts separated by meaningless patterns of repeated characters. This paper follows a recent trend of marketing excellent theoretical work as LLMs being capable of secretly plotting behind your back, when the realistic implication is backdoor risk. An article currently on the first page is relevant: https://www.strangeloopcanon.com/p/what-can-llms-never-do
补充猜测 filler token 让模型避开 CoT 噪声、更纯粹地采样高概率答案。
我感觉这之所以有效是因为:1. 输入被处理,答案逐 token 生成。2. 模型可以根据概率输出答案或 filler token;低概率答案会被更高概率的 filler token 取代(我没有比“....”更好的 token 可用来回答)。3. 到某个点,与先前学到的东西形成对齐,触发更高概率输出更好的 token。这个直觉来自我注意到模型会根据信息在上下文中的位置不同而给出不同回答;不过我说不准不同 embedding 方法如何,因为那肯定会改变我的上述想法。如果改用 chain-of-thought prompting,后续生成的 token 可能会干扰输出概率。因此我进一步想,filler tokens 让模型更纯粹地浮现训练中学到的最佳答案,而不引入更多噪声。或者我们可以用多次重采样找最高输出。这些 LLM 实际上就是伪装的搜索引擎。
razodactyl查看英文原文
I get the feeling this works due to the following: 1. An input is processed with answer generated token-by-token. 2. The model can output based on probability the answer or a filler token. Low probability answers are ignored in favour of higher probability filler tokens (I don't have a better token to answer with than .....) 3. At a certain point, an alignment is made with what was learnt previously triggering a higher probability of outputting a better token. This intuition being that I've noticed models respond differently based on where in context information appears: Can't speak for different embedding methods however as I'm sure this changes my thoughts on above. If instead chain of thought prompting is used, the tokens further generated may interfere with the output probability. So further to this, I'm thinking filler tokens allow for a purer ability for a model to surface the best answer it has been trained on without introducing more noise. Or we can use methods that resample multiple times to find the highest outputs. These LLMs are practically search engines in disguise.
补充提供第一作者的推文串讲解作为补充资料。
我在这里找到了第一作者对这篇论文的一个不错的线程式讲解:https://twitter.com/jacob_pfau/status/1783951795238441449
rgbrgb查看英文原文
i found a nice thread-level walkthrough of this paper by the first coauthor here: https://twitter.com/jacob_pfau/status/1783951795238441449
历次讨论
- 2024Hacker News 讨论帖159 分 · 32 评
同领域还值得读
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 分钟编辑精选