AI 与机器学习2025arxiv.org
预训练大语言模型使用傅里叶特征进行加法
Pre-Trained Large Language Models Use Fourier Features for Addition (2024)
进阶 · 约 60 分钟读完前置知识:Transformer 基础、可解释性研究基础、傅里叶分析基础
导读
论文研究预训练大语言模型如何完成加法:通过分析模型内部表示,发现模型会利用傅里叶特征处理数字,并可能将数值分解为幅度判断与模运算(如奇偶)等成分。作者以 GPT-2-XL 等模型为对象观察到这种结构,说明加法能力与训练数据中数字表示的结构有关。
HN 关注点:为什么 LLM 会自发学出傅里叶特征这种反直觉的数学结构,以及这究竟算不算真正学会加法、模型选择是否过时。
HN 评论精选
这几条评论里:支持 1 质疑 1 补充 1
补充质疑模型选择过时,并解释当时可用的 1.5B 模型有限。
奇怪的是他们选了 GPT-2-XL,这模型太老了。我猜他们想要一个小模型(1.5B),而且这项研究很久前就开始了。今天 1.5B 模型有不少更强选择(Qwen2-1.5B、DeepSeek-R1-Distill-Qwen-1.5B、TinySwallow 1.5B、Stella 1.5B、Qwen2.5-Math-1.5B 等),但它们都源自 Qwen 系列,而研究开始时还没有这些模型。
wongarsu查看英文原文
Curious that they chose to use GPT-2-XL, given the age of that model. I guess they wanted a small model (1.5B) and started work on this quite a while ago. Today there is a decent selection of much more capable 1.5B models (Quen2-1.5B, DeepSeek-R1-Distill-Qwen-1.5B, TinySwallow 1.5B, Stella 1.5B, Qwen2.5-Math-1.5B, etc). But they are all derived from the Qwen series of models, which wasn't available when they started this research.
质疑认为这仍是统计拟合而非真正算术,模型结构反映训练数据。
这似乎在意料之中?如果你把统计模型在 token 层面的“加法”上调到很高准确率,模型最终结构必然对应训练数据中的某种结构。对于像“123”这样的 token(内部表示为整数 7633),傅里叶特征说得通,因为它需要“包含”文本数字的信息才能做数学。值得注意的是,这仍在某种程度上是统计行为,而非真正学会加法,因为即使微调后的模型也达不到 100% 准确率。
lsy查看英文原文
Something like this seems expected, right? If you tune a statistical model to very high accuracy in "addition" over tokens, then the resulting structure of the model must correspond to some structure in the training data. And fourier would make sense for some token like "123" which internally is represented as the integer 7633, but needs to "contain" information about the text digits for math to work. Notably, this still ends up being in some way a statistical endeavor rather than truly learning addition, as even the fine-tuned model doesn't reach 100% accuracy.
支持惊讶于幅度与模运算特征的分工是 LLM 学数学的稳定结果。
这挺有意思!根据摘要,训练足够久的模型会把一些特征层用于数值大小判断,另一些用于模运算判断(比如奇偶)。对我来说很意外,这是 LLM 遇到数学时一个稳定的结果,绝不是我这个“肉身大脑”觉得最简单的做法。
vessenes查看英文原文
This is .. pretty interesting! According to the abstract, models trained long enough use some feature layers for magnitude assessment, and others for modular assessment, (e.g. even / odd). It's surprising to me that this is a stable outcome for trained LLMs when they encounter math. Definitely not what seems simplest to my meatspace brain.
相关资源
从这篇论文所有 HN 讨论帖的全部评论里整理出来的链接。
历次讨论
- 2025Hacker News 讨论帖149 分 · 40 评
同领域还值得读
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 分钟编辑精选