Open Interpretability Models Contributors Research Posts About

Language Models Use Trigonometry to Do Addition

Source

Citation. Subhash Kantamneni and Max Tegmark, of the Massachusetts Institute of Technology. "Language Models Use Trigonometry to Do Addition". arXiv:2502.00873, version 1 of 2 February 2025, the only version. Preprint, no venue given. The source is in an ICML style, but no acceptance is stated. The text gives no code or data link. Funding: the Rothberg Family Fund for Cognitive Science, and IAIFI through NSF grant PHY-2019786. The text gives no disclosure of tool use. The experiments used nnsight on one RTX A6000.

Mismatch. Section 5.1 calls the results "compelling evidence that all three models use the Clock algorithm." Sections 5.5 and Appendix D say that the evidence for Llama3.1-8B is weaker, and that it may use other algorithms. The abstract calls the helix "causally relevant" for division and multiplication, but Table 1 has the helix below PCA for both.

Status. Planned. #5220 names it as background for phase 5(b), a compiled addition module, which must read and write the model's own number encoding. The fix campaign is the maintainer's, so this page reports evidence and records questions only.

Read. On 2026-11-20 a web-fetch subagent read the abstract page and the HTML of version 1 for this page's author, a model (Claude Opus 5.5). It read the source's own text in full, in three fetches: Sections 1 to 6, the references and Appendices A to G. We didn't see any figure as an image. Many results appear only in figures, so this page gives them only where the text has a number.

Summary

Claim. Three language models represent a number as a generalised helix: a linear term plus circles with periods 2, 5, 10 and 100. To add, GPT-J moves the helices of a and b to the last token. It combines them into the helix of a+b, and reads the answer from it. The authors call this the "Clock" algorithm.

Method.

Findings, as the source reports them.

Setting Result
Patching a+b on the a token, max over layers (Table 1) full layer 8.34, helix 7.21, circle 6.83, PCA 6.13, polynomial 3.09
Other tasks, helix against PCA (Table 1) below PCA for a//5 (4.55 against 5.24) and a×1.5 (5.16 against 6.65)
Heads, GPT-J (Section 5.2) 20 heads give 83.9% of the effect of all 448. 11 move a and b, mostly in layers 9–14
MLPs, GPT-J (Section 5.3) 11 MLPs, from layers 14–27, give 95% of the effect of all 28
Neurons kept, GPT-J (Section 5) about 1% (4,587), with the rest mean-ablated, keep 80% accuracy
Neurons replaced by their fits (Figure 9 text) recover "roughly 75%" of the real neurons' performance
Direct effect (Appendix D.2) about 700 neurons give 80% of the direct effect of the 4,587
GPT-J's errors (Appendix F) wrong on 19.5%. Of numeric errors, 45.7% are off by −10 and 27.9% by +10

Where the claims go beyond the evidence

The authors state limits themselves. Gemma-2 splits numbers into digits, so it needs another method. Other model sizes may learn other algorithms. And they studied only single-token numbers.

Use in this repo