EXEPERTAI LAB
EXEPERT / DIRECTORY
← Blog

The Most Complex Model We Actually Understand: Welch Labs on Grokking, Clocks and a Trig Identity

Welch Labs argues a one-layer transformer that groks modular addition is the most complex model we fully understand. How it memorises, then builds clocks of sines and cosines, adds angles with a trig identity, and why excluded loss explains the sudden jump. Plus Anthropic's curved counting manifold in Claude.

Akmal Alif · 10 October 2026 MYT

On the left, 113 small coloured dots form a clock face with two hands; in the middle, a square of diagonal orange and blue stripes; on the right, one curve shoots up at once while a second stays flat along the floor for a long time, then jumps to the top.

In December 2025 Stephen Welch of Welch Labs published a 35-minute video with a bold claim. A one-layer transformer that "groks" modular addition is, Welch argues, the most complex AI model that anyone fully understands (Welch Labs, 2025). Welch admits the claim is subjective and asks viewers for better candidates. The case the video makes is still one of the clearest explanations of mechanistic interpretability there is.

This post follows the video's argument, with timestamps that jump to each part. It is paraphrased from the video's English auto-generated captions.

The most complex model we actually understand (Welch Labs)The YouTube player loads in privacy-enhanced mode when you press play.Watch on YouTube ↗

The question

Every token a large language model writes comes from billions of learned calculations. We know how each artificial neuron works, but not what the whole network has learned. Welch asks a narrower question: how much complexity do we have to strip away before a model becomes fully understandable (watch from 0:00; 1:02)?

Modular addition, from the model's side

Modular addition is clock arithmetic. With a modulus of 5, 4 + 2 is 6, which wraps around to 1. The model never sees numbers, though. Each number is a token, fed in as a one-hot vector: one input switched on, the rest off. To the network, "1 + 2 =" is a pattern of switches, and the answer is another pattern. Welch points out that a large language model sees "The capital of France is" the same way: as token indices, with "Paris" just the most likely output index (watch from 2:39; 3:54).

An accidental discovery

In 2021 a team at OpenAI was training small models on tables of modular arithmetic. Their models quickly fitted every training example but failed on held-out data: they had memorised. Then, as Welch tells the story, a model left training much longer than planned suddenly generalised, scoring perfectly on the test set too. Welch could not reach the team to confirm this origin story, and credits it to a talk where it was told (watch from 6:52).

The team reproduced the effect across many operations and published it in January 2022 as "grokking", after the Martian word for deep understanding in Robert Heinlein's 1961 novel Stranger in a Strange Land (Power et al., 2022; watch from 7:56). The puzzle was why a model that looks finished for thousands of steps should suddenly learn.

Inside the model: waves, probes and clocks

A year later, a team led by Neel Nanda took a one-layer transformer trained on addition modulo 113 apart, parameter by parameter (Nanda et al., 2023). Welch replicates their setup (watch from 8:49):

  • The model. Inputs are one-hot vectors of length 114: 113 numbers plus the equals sign. An embedding turns each into a 128-number vector, which passes through attention and an MLP with 512 neurons.

  • The training curve. In Welch's run the model memorises the training set after about 140 steps and generalises after about 7,000.

  • The clue. Sweep one input through all 113 values and many MLP neurons trace smooth waves. Plot pairs of neurons against each other and the waves become loops. Go back to the checkpoint that has only memorised, and the waves and loops are gone.

A discrete Fourier transform shows the waves have a few specific frequencies, such as 8π/113 in Welch's run. The same frequency hides in the embedding, spread across several positions. A sparse linear probe, a weighted sum of just eight embedding values, recovers a clean cosine of the input, and a second probe recovers the sine (watch from 13:57; 15:13).

Plot the cosine probe against the sine probe and the inputs fall on a circle. That is the clock: the model has placed each number at an angle, as an analogue clock places hours (watch from 16:59).

The trig identity

A circle for each input is not enough. To add, the model has to add the two angles, and its one-hot inputs give it no direct way to do arithmetic on the numbers themselves (watch from 19:17).

Welch's two-dimensional Fourier analysis of the MLP neurons shows what happens instead:

  1. Some neurons' strongest component is cos(x)·cos(y). Others' is sin(x)·sin(y).

  2. The next layer takes weighted sums. With weights of +1 and −1, those two products combine into cos(x)·cos(y) − sin(x)·sin(y).

  3. That is the sum-of-angles identity: it equals cos(x + y). The result is a wave running diagonally across the input grid.

  4. One neuron Welch shows fires whenever x + y is 65, including pairs such as 112 + 66 that sum to 178, which is 65 modulo 113.

  5. The final unembedding combines many such diagonal waves. The output for "7" peaks for every pair that adds to 7 (watch from 23:19).

Nobody put trigonometry in the training data, which is only one-hot switches. Gradient descent found the identity because it is an efficient way to compute the answer.

Why it groks: excluded loss and clean-up

Knowing the mechanism makes it possible to measure it. Nanda and colleagues proposed excluded loss: remove the model's key frequencies from its output and measure the loss again (Nanda et al., 2023).

During the long plateau, when both training and test accuracy look flat, excluded loss climbs steadily. The model is building its Fourier circuit while the standard curves show nothing. The jump in test accuracy comes just after the circuit forms, in a clean-up phase where the model sheds the memorised examples it relied on early in training (watch from 26:38). The paper calls these "progress measures": metrics that track hidden progress that the usual curves hide.

From a toy to Claude

Full-size models are still far from this level of understanding. Welch ends with the frontier: an Anthropic study of how Claude 3.5 Haiku decides when to break a line of text (Gurnee et al., 2025; watch from 30:02).

  • Counting. The model represents how many characters it has written on the current line as a tightly curved line that lives in a six-dimensional subspace of its activations, found with linear probes much like the ones in the toy model. The video calls it a six-dimensional manifold; the paper describes a one-dimensional curve inside a 6D subspace.

  • Comparing. It represents the line's width limit on a similar curve. In some attention heads, one curve is rotated against the other, so a count of 70 sits next to a width of about 75.

  • Deciding. The rotation makes the match strongest about five characters before the end of the line. Several "boundary heads" specialise in different distances from the edge, which lets the model judge how much room is left. The paper itself compares these features to place cells and boundary cells in the brain.

Line breaking is trivial next to everything Claude does, but finding such a clean geometric mechanism in a production model is new.

Animals, ghosts and aliens

Welch closes with Andrej Karpathy's remark that training language models is less like building animals and more like summoning ghosts (Karpathy, 2025; watch from 32:24). Welch likes "grok" because the word is alien, a reminder not to over-personify models: the human language they speak is a thin layer over very strange internal maths.

What practitioners can take from it

  • Flat curves do not mean a model has stopped learning. In this case, a progress measure built from the mechanism exposed learning that accuracy and loss hid.

  • Representations are often geometric. Circles for modular arithmetic and curved manifolds for counting keep turning up. Linear probes are a cheap first tool to look for them. The geometry is not always the same, though: a later study found small networks solving the same task with a different "pizza" algorithm as well as the clock (Zhong et al., 2023).

  • Understanding does not yet scale. A complete account exists for a one-layer model, and partial accounts for single behaviours in large ones. Our post on Anthropic's circuit, emotion and workspace research follows that frontier.

For the building blocks, see our explainers on attention in five pieces and CNN kernels learning MNIST.

References

Gurnee, W., Ameisen, E., Kauvar, I., Tarng, J., Pearce, A., Olah, C., & Batson, J. (2025, October 21). When models manipulate manifolds: The geometry of a counting task. Transformer Circuits Thread. https://transformer-circuits.pub/2025/linebreaks/index.html

Karpathy, A. (2025, October 1). Animals vs ghosts. https://karpathy.bearblog.dev/animals-vs-ghosts/

Nanda, N., Chan, L., Lieberum, T., Smith, J., & Steinhardt, J. (2023). Progress measures for grokking via mechanistic interpretability (arXiv:2301.05217). arXiv. https://doi.org/10.48550/arXiv.2301.05217

Power, A., Burda, Y., Edwards, H., Babuschkin, I., & Misra, V. (2022). Grokking: Generalization beyond overfitting on small algorithmic datasets (arXiv:2201.02177). arXiv. https://doi.org/10.48550/arXiv.2201.02177

Welch Labs. (2025, December 20). The most complex model we actually understand [Video]. YouTube. https://www.youtube.com/watch?v=D8GOeCFFby4

Zhong, Z., Liu, Z., Tegmark, M., & Andreas, J. (2023). The clock and the pizza: Two stories in mechanistic explanation of neural networks. In Advances in Neural Information Processing Systems 36. https://doi.org/10.48550/arXiv.2306.17844