Tiny transformer trained on mod-113 addition groks into using trig angle-addition on a circle

tetsuoai · x · 2026-09-26

The author trained a tiny transformer to add numbers mod 113, saving embeddings every 20 steps to watch the Grokking transition unfold.

Once the model grokked, the embeddings showed it had organized the numbers onto circles and was performing modular addition via the trigonometric angle-addition formula — a striking visualization of how neural networks spontaneously discover mathematical algorithms during the shift from memorization to generalization.

Original post →

More from Research

Research channel →