@GoodfireAI: Neural networks do math by rotating shapes. We found a shape-rotating calculator hidden inside an LLM – and it’s used f…
Summary
GoodfireAI found that neural networks perform math by rotating shapes, uncovering a shape-rotating calculator inside an LLM that is used for more than just math.
View Cached Full Text
Cached at: 05/15/26, 03:06 PM
Neural networks do math by rotating shapes.
We found a shape-rotating calculator hidden inside an LLM – and it’s used for more than just math! (1/6)
How does Llama encode numbers? Not on a number line or in binary, but as positions on several circles in parallel.
This might sound odd, but it’s just a Fourier decomposition (a common mathematical technique). Prior work shows this is true across LLMs! (2/6)
These circles form the inputs and outputs of the model’s geometric “calculator”.
To add two numbers, the calculator solves smaller problems in parallel, one for each circle.
Each circle gets its own little addition problem. (3/6)
The same calculator handles a wide range of tasks, including:
- arithmetic (“7+9”)
- weekdays (“nine days after Friday”)
- months (“six months after August”)
Llama built this mechanism from scratch in training, and uses it with striking elegance and flexibility. (4/6)
How do we know Llama is really using this geometric calculator?
We can steer it, manipulating the circles inside the network and watching the answer change.
The proof is in the steering. (5/6)
This is a glimpse of how neural geometry can lead us to discover mechanisms we’d otherwise miss - in this case, neural computation.
Understanding this machinery paves the way for better debugging, control, and design of AI.
Read the full post: https://goodfire.ai/research/a-geometric-calculator… (6/6)
getting one of those for the office rn
they definitely rotate shapes
we’re big fans of causal evidence :)
thanks for reading. more to come soon!
it’s circles all the way down
we think so!
interesting hypothesis! the role of layernorm is definitely underappreciated
Fourier would have too
it turns out that the addition module always uses base-10, even for months/hours/weekdays
Yes! full paper here
Similar Articles
@GoodfireAI: Neural networks might speak English, but they think in shapes. Understanding their rich *neural geometry* is key to und…
Goodfire AI announces a new research agenda focused on neural geometry to improve the understanding, debugging, and control of neural networks.
I built a open source neural network shape validator [P]
An open source tool for validating the shapes of neural networks has been built and shared by the author.
@DanKornas: Neural nets are easier to understand when you can see the math cell by cell. ai-by-hand-excel is a collection of Excel …
ai-by-hand-excel is an open-source collection of Excel workbooks that teach AI concepts like neural networks, backpropagation, and transformers by letting users inspect the math cell by cell, making model internals more intuitive.
@TensorTonic: 7 math ideas every ML engineer uses daily and almost nobody has actually derived: 1. Why gradient descent moves in the …
This tweet lists 7 fundamental math ideas used daily by ML engineers, with brief explanations emphasizing the underlying derivations, such as why gradient descent moves in the steepest direction and why softmax plus cross-entropy yields a clean gradient.
@AnimaAnandkumar: Neural operators – Convert popular neural networks into neural operators for scientific modeling Extending neural netwo…
This paper presents principled approaches for converting popular neural network architectures (CNNs, GNNs, transformers) into neural operators that learn mappings between infinite-dimensional function spaces, enabling consistent predictions across different discretizations for scientific modeling. Published in Nature Machine Intelligence.