Language Models Use Trigonometry to Do Addition
Subhash Kantamneni, Max Tegmark
MIT 2025
"We first discover that numbers are represented in these LLMs as a generalized helix, which is strongly causally implicated for the tasks of addition and subtraction, and is also causally relevant for integer division, multiplication, and modular arithmetic. We
then propose that LLMs compute addition by manipulating this generalized helix using the “Clock” algorithm: to solve a + b, the helices for a and b are manipulated to produce the a + b answer helix which is then read out to model logits. "
Imagine teaching a computer to do math, not by giving it step-by-step rules like a calculator, but by letting it figure things out on its own. Scientists have been trying to understand how large language models (LLMs)—the AI behind tools like ChatGPT—actually "think" when solving even basic math problems. In this study, researchers uncovered something fascinating: LLMs seem to use trigonometry to perform addition.
Instead of treating numbers as simple values, these AI models represent them as points on a twisted spiral—like a helix. When the model needs to add two numbers, it doesn’t just line them up and sum them. Instead, it rotates and shifts these spiral representations using what the researchers call the "Clock" algorithm. Essentially, the AI aligns the spirals for two numbers in a way that lands it on the correct result.