HACKER PAPER · 2025 · arXiv preprint
Language Models Use Trigonometry to Do Addition
这篇论文在回答什么?
模型写出3+63=66时,内部是否只是认出了答案?这篇论文分析GPT-J、Pythia-6.9B和Llama-3.1-8B的两数加法,把整数表示拟合为含线性分量与多组周期分量的广义螺旋,再通过激活替换、消融及部件分析检验这种表示是否参与计算。它提供了比漂亮投影图更强的机制证据,但还没有定位从两个输入螺旋生成答案螺旋的精确运算。
怎样理解它的贡献
- 01
主任务限制在0至99的两个整数相加,答案能由单个词元表示;因此这不是对任意长度算术或全部数学推理的机制解释。
- 02
作者用线性项及周期为2、5、10、100的正余弦分量拟合数字表示,并用干预而非仅相关图形检查这些分量是否保留加法所需的信息。
- 03
对GPT-J的细化分析区分了传递输入表示、构造答案表示和写出答案的部件;但作者仍把低层三角恒等式实现作为未隔离出来的假说。
回到原文核对
页码按 PDF 文件从第 1 页计算。跳页是否生效取决于原站阅读器;也可以按章节和短引查找。
all patching experiments only use prompts
the model can successfully complete.we do not know the exact mechanism导读依据: arXiv v1 preprint ↗ · unknown
把论文放进一个更大的问题
这些主题把论文与视频中的具体论点放在一起阅读。
Hacker News 评论 4
这里展示已核验、带论文链接的提及,按时间倒序排列,并非某个投稿下的全部评论。推荐、引用与批评分开标注;保留评论原文。
Claims like this needs to be deeply analyized. Models do have some emergent capabilities[1], and I think there's a lot of evidence to show that semantics is actually learned (Word2Vec), and some math seems like it also might be learned (e.g. modular arithmetic). But it's hard to exactly say where there's some internal mechanism generating a true answer and where we're just getting lucky with some distribution so the answer just seems right.
[1] https://arxiv.org/pdf/2502.00873
I think the field deserves more credit than that, there are plenty of interpretability tools like
* natural language autoencoders for explanations of activations: https://transformer-circuits.pub/2026/nla/index.html (demo at https://www.neuronpedia.org/llama3.3-70b-it/nla )
* easier-to-interpret language model families like Backpack models: https://aclanthology.org/2023.acl-long.506/
* attribution graphs to trace internal reasoning steps: https://www.anthropic.com/research/open-source-circuit-traci... (demo at https://www.neuronpedia.org/gemma-2-2b/graph)
* functional analyses which have identified how LLMs do arithmetic - https://arxiv.org/html/2502.00873v1 - and how refusal happens: https://arxiv.org/abs/2406.11717
* data attribution methods linking training data to specific attention heads https://arxiv.org/abs/2601.21996
If we could give a comprehensive and global explanation of an LLM's behavior in a single paragraph, we wouldn't need the model to begin with, but that doesn't mean there's absolutely no understanding of the model internals whatsoever
They use the "Clock" algorithm, the "Pizza" algorithm, a few other ones.
> All networks we study implement the same simple neuron model in their first-layer MLPs: degree-1 sinusoidal fits in layer 1, with deeper layers combining into degree-2 sinusoidal interactions.
https://neurips.cc/virtual/2025/loc/san-diego/133808
https://arxiv.org/abs/2502.00873
When you ask them they don't mention these at all, they give you high-school math:
https://chatgpt.com/share/6a82afdd-872c-83eb-aad7-622d27f2dc...
> did you use the "cos" or "sin" function at all during this addition computation?
> No. There is no need for trigonometric functions like sin or cos. The computation only uses basic arithmetic and place-value reasoning. Of course, if someone were implementing arithmetic in a computer, it is theoretically possible to express addition using extremely complicated formulas involving sin and cos. But in the reasoning I described, no trigonometric functions were involved at all. I simply decomposed the numbers into hundreds and smaller parts and added them.
EDIT: I see now that you were referring to the answers it uses to justify the result, not the underlying computations. Sorry! You can disregard the actual comment. Leaving for completeness.
ORIGINAL COMMENT:
That's not how it works. Addition in LLMs is believed to function through different mechanisms depending on model size and architecture, but the single consistent finding across different models is that they generalize beyond the training data for at least those simple arithmetic operations.
For example: "Language models use trigonometry to do addition" https://arxiv.org/abs/2502.00873
For a different "emergent" algorithm, see Anthropic's observations: https://transformer-circuits.pub/2025/attribution-graphs/met...
直接投稿与讨论(1)
Language Models Use Trigonometry to Do Addition · 1 分 · 2025-02-04 ↗