AI Does Multiplication Underneath. So Why Did Older Models Break at School Maths?
From the publisher’s feed, collected in the ZeroLabs newsroom.
Image generated by ChatgptLike anyone who got pulled into the AI wave, I went through the whole thing. The amazement phase, the over reliance phase, the okay this thing just hallucinated phase.., and then the slow ohh okay I think I am starting to get what this actually is phase.Ikr… everyone is talking about MCP, agents, multi agent workflows, RAG pipelines, and whatever dropped on HuggingFace this morning. And I will get there. But today I just want to sit with a small problem that nobody really talks about anymore because it feels too old to bring it up. A schoolboy problem. The kind where your maths teacher would give you that look.Somewhere in the middle of all that AI chaos, I came across the 9.9 versus 9.11 meme.Someone asked a model which number is bigger, and it confidently picked 9.11 because 11 is bigger than 9. Bro. This is not a version number. This is not some edge case in floating point arithmetic. This is the decimal system. The one we all learned before we learned anything else.To be fair, most good models get this right today. I knew this one is old. But that is kind of the point, the mistake itself was never what was interesting. What was interesting was the pattern underneath it.The model does not look confused when it is wrong. It does not slow down, add a disclaimer, or pause like someone who just remembered the exam has negative marking. It gives the answer with the full energy of a person who has already submitted the paper, walked out of the hall, and is thinking about lunch. Then you correct it. It apologises beautifully. Very polite, very composed, basically a customer support email. And then sometimes, with slightly different numbers, same mistake from a different angle.That is what stayed with me. This is the same model that can explain transformers, summarise long documents, write decent code, and give surprisingly calm life advice at 1AM when your own brain has completely checked out. How does something that capable not know which decimal is larger? And more than that, why does it not know that it does not know?Ain’t AI Literally Full of Multiplication?Here is where it gets properly strange. These models are not outside maths. They are built on mathematics.Your sentence gets chopped into tokens. Tokens become numbers. Those numbers become vectors. And those vectors move through layer after layer where they get multiplied with other numbers again and again. Somewhere behind the clean chat window, the GPU is doing arithmetic vibing while we casually type. So naturally, you would expect multiplication to be the one thing these models never mess up. If the whole machine runs on multiplication, asking it to multiply two numbers should be like asking a fish to swim.But this is where the confusion starts. There are two very different things hiding under the word multiplication.Inside the model, multiplication is not being used like school arithmetic. It is not trying to calculate 47 times 38. It is being used to move information around. A token enters as a vector, and after multiplication with learned weights, it becomes a slightly different vector. Then that vector moves to the next layer, gets transformed again, and slowly the model builds a richer understanding of the sentence.Think of it like this. When you type a sentence, the model does not understand each word alone. It has to understand each word in relation to the other words.Take this sentenceThe cat sat on the mat because it was tiredThe word it is a tiny word but it creates a real problem. What does it refer to? Cat or mat? As humans, we know it probably refers to the cat. The mat is not tired. Unless it is Monday morning, maybe. But the model does not know that through common sense the way we do. It has to calculate relationships between tokens. This is where attention comes in.Attention is basically the model asking, which other words should this word care about right now? For the word it, the model should care more about cat than mat. For the word tired, it should also care more about cat. For the word sat, maybe both cat and mat matter but in different ways.Now the question is, how does the model calculate this caring :)?It turns every token into three different versions of itself. One version asks a question. One version acts like a label. One version carries useful content. These are called Query, Key, and Value. The names sound like an ancient temple puzzle but the idea is not that scary.The Query is like the token asking: what am I looking for?The Key is like the token saying, this is what I contain.The Value is the actual information the token can pass forward if another token decides it is useful.So for every token, the model creates these three versions using multiplicationQ = X · W_Q ← token becomes a questionK = X · W_K ← token becomes a labelV = X · W_V ← token becomes contentHere X is the token vector. The W_Q, W_K, and W_V are learned weight matrices.Learned just means the model adjusted these numbers during training until they became useful.The model is not manually writing rules like “it refers to cat.” It is multiplying vectors by learned matrices so that useful relationships become easier to detect.Once every token has a Query and a Key, the model compares them. A Query from one token is matched against the Keys of all other tokens. If the match is strong, that token gets more attention. If the match is weak, it gets less. That matching is done usingQ · K^T / √d_kQ times K transposed scores every token’s question against every other token’s label. The √d_k is just a stabilizer, without it, one score can dominate too aggressively and attention becomes messy.Then softmax converts those raw scores into weights that add up to 1,Softmax takes a list of raw scores and turns them into probabilities that always add up to 1. It does this by exponentiating each score, raising e to the power of that number, then dividing each result by the sum of all the exponentiated values. The highest score gets the highest probability, and the gaps between scores determine how confident the result lookcat: 12.4 → cat: 0.82mat: 3.1 → mat: 0.10sat: 1.8 → sat: 0.08Not exactly these numbers, but this kind of idea. Now the model knows how much each token matters. Finally it uses those weights to collect information from the Value vectors:Attention(Q, K, V) = softmax( Q · K^T / √d_k ) · VA tiny toy version of just the Q and K part looks like this:import torchtorch.manual_seed(7)X = torch.randn(4, 8) # 4 tokens, each represented by 8 features/dimensionsW_q = torch.randn(8, 8)W_k = torch.randn(8, 8)Q = X @ W_qK = X @ W_kscores = Q @ K.T # every token asks about every other tokenprint(scores.shape) # 4×4 - four tokens compared with four tokensprint(scores.round(decimals=2))This is obviously not a language model. No tokenizer, no billions of parameters, no dramatic launch video. But the shape of the idea is there. Four tokens go in. Each becomes a question and a label. Every question gets scored against every label. That 4×4 grid is the raw material of attention. But notice what this multiplication is doing. It is not remembering a carry. It is not following long multiplication. It is moving meaning around. The model is a machine that survives on multiplication. And yet, ask it to multiply 3847 by 2916 and it can quietly fall apart.The Fix Was Not a Bigger Model. It Was Rough Work.At this point I stopped thinking of this as~ AI failed at multiplication ~That is funny for five seconds. The more interesting question was, what would it actually look like if a model learned multiplication properly? Not memorised answers. Not something that looks mathematically flavoured. Actually learned the procedure. Because multiplication is not just a final answer. It is a small journey. You hold one partial product, carry something, add it to a running sum, move one digit left, repeat. The stuff your class 4 maths teacher made you write out in your notebook before you could even think about the answer. Yea..it is boringg, but that boring stuff is the algorithm. And the paper I found built exactly the experiment to test whether a model had it or not.Two Models. One Difference That Shouldn’t Matter But Completely Does.The researchers trained two small transformer models on four-digit multiplication.A transformer, before you picture something complicated, is just the architecture underneath every modern AI, the same thing inside ChatGPT, Claude, Gemini. At its core it’s a system that processes sequences of tokens and learns which tokens should ~pay attention~ to which other tokens. The details matter less here than this: it’s the standard setup.These weren’t exotic models. They were small, normal transformers trained on a specific task. Same architecture. Different training method. Then they cracked them open to see what was different inside.Model 1 : : Standard Fine Tuning (SFT).Fine tuning just means taking a model ( neural network ) and training it further on a specific task, in this case, multiplication. The setup is exactly what it sounds like, problem goes in, answer comes out, training tells the model right or wrong.3847 × 2916 = ? → model guesses → loss goes up or down → repeat.Simple. No rough work shown. Only the final answer checked.Result: under 1% accuracy on four-digit multiplication.Before the obvious thought, ~okay just make it bigger!! ~, they tried that. More layers, more attention heads, more capacity. Same plateau. Because the problem wasn’t that the model was too small. It was that it had never been forced to build the right internal habit. A bigger confused student is still confused. Just with better handwriting.Model 2 : :Implicit Chain of Thought (ICoT).The name sounds academic, but the idea is almost embarrassingly close to how we all learned maths in school.At the start of training, the model is shown the rough work. Not just12 × 34 = 408But the actual notebook working:12 × 4 = 4812 × 30 = 36048 + 360 = 408Partial products. Running sums. The carry information. Everything your maths teacher insisted you write before she’d even look at your answer.Then comes the clever part. As training continues, those intermediate steps are slowly stripped away. Epoch by epoch,Epoch : each full pass through the training datathe rough work disappears. The model sees less working. Then even less. By the final epoch, it only sees the same thing as SFT: problem and final answer, nothing in between.But now the model has a history. Earlier in training, it needed those intermediate steps to get the answer right. When the scaffolding disappeared, the model couldn’t just forget how to do the problem, the accuracy would collapse. So it did the only thing it could, it moved those steps inside itself. Into its own hidden states. The rough work vanished from the training data, but not from the model. SFT is asked to jump from question to answer. ICoT is taught the path first, then slowly asked to walk it without the map.Result: 100% accuracy. While SFT stays below 1%.Same task. Same size model. Same parameter count. Completely different internal organisation. The successful model didn’t just learn the answer, it learned what to remember on the way to the answer. ICoT proves the principle. But the practical question remains, do you always need this whole curriculum, the epoch-by-epoch removal, the careful scaffolding?I’ll take you there… First, let’s see what’s actually different inside.But Did It Actually Learn the Procedure? Or Just Get Lucky?100% accuracy sounds great. But accuracy alone can lie.Think about it, I mean if you showed a student every possible four-digit multiplication problem during school and they just memorised all the answers, they would score 100% too. That’s not learning multiplication. That’s a very impressive act of memory. So before celebrating the ICoT result, the harder question has to be asked: did the model actually learn the procedure, or did it find some clever shortcut that happens to work on this dataset? The only way to know is to go inside!!The first thing worth checking is almost insultingly basic:~ Does the model’s answer actually depend on its input? ~That sounds obvious. Of course the answer should depend on the input that’s the whole point. But here’s the thing, a model producing plausible-looking outputs doesn’t have to be deeply connected to its inputs. It might have learned that four-digit multiplication answers tend to look like this and be pattern-matching from there. Like a student who’s seen enough maths papers to know that answers usually have 7–8 digits and don’t start with zero, without actually being able to multiply.The tool for this is called logit attribution.Before the model commits to an output digit, it produces raw confidence scores for every possible digit, how hard it’s leaning toward 0, toward 1, toward 2, and so on. These raw scores are called logits, the model’s internal voting slate before the final decision gets made. Attribution then asks, if I change one input digit, which output logits move? And do they move in the right direction, the direction that actual multiplication would predict?For example, when multiplying 3847 × 2916, the digits get labelled right to left. So a0 is 7, a1 is 4, a2 is 8, a3 is 3. Same for the second number, b0 is 6, b1 is 1, b2 is 9, b3 is 2. This labelling matters because multiplication is right-to-left, and each output digit depends on specific input digit combinations, not all of them equally. Change a2, and only the output digits that mathematically involve a2 should shift. Everything else should stay put.The SFT model barely flinched. Swap an input digit, and the output logits stayed almost identical. The answer wasn’t being derived from the input, it was being produced. Something answer-shaped. Plausible-looking. Not obviously wrong, just not actually calculating. Same parameter count as the ICoT model. Just a completely different — and hollow — internal organisation. The ICoT model reacted exactly right. Change a2, and the output positions that mathematically depend on a2 shifted accordingly. The dependency was real.Okayy… So the ICoT model’s outputs genuinely track its inputs. That rules out pure pattern-matching. But it still doesn’t tell us how the model is computing the answer internally. Maybe the right outputs are shifting for the right inputs, but is the model actually maintaining the intermediate state that multiplication requires? This is the deeper question. And it is the one that actually separates model that learned to multiply from model that learned to output multiplication-shaped answers.Think about what you actually do when you multiply on paper. You’re not just looking at the original numbers and magically emitting the final answer. You maintain a running state partial products accumulated so far, carry values, a current sum that you update at each step. That running state is the rough work. It is what your class 4 teacher was forcing you to write down. If the ICoT model genuinely learned multiplication, that running state should exist somewhere inside it. Not on paper, but encoded in the model’s internal computations. ( is it running a buffer inside ?? :) )At each step of its computation, the transformer produces a hidden state, a large vector of numbers representing everything the model “knows” at that moment. Think of it as the model’s internal notepad, invisible from the outside, but carrying the model’s working memory. And here’s the key insight, you can check what’s written on that notepad.This is what a linear probe does. It is the weakest possible reader, essentially just a straight-line fit, that you attach to the hidden state and ask one question: can I find the running sum in here?Probing classifiers are a set of techniques used to analyze the internal representations learned by machine learning models. The classifiers aim to understand how a model processes and encodes different aspects of input data, such as syntax, semantics, and other linguistic features. By probing a pre-trained model’s internal representations, researchers and data scientists can gain insights into the model’s understanding of language and its ability to capture various linguistic properties.The probe cannot solve the problem. It cannot inject new knowledge. It’s too simple for any of that. All it does is check whether a specific piece of information is already sitting in the hidden state, clearly enough to be read out. The logic is almost too clean, if something this dumb can extract the value, the hidden state must be carrying it clearly. You don’t need a metal detector to find a hammer lying on the floor.Before the numbers, the running sum during four-digit multiplication ranges from 0 to roughly 81, which is the maximum partial product you get from any single pair of digits. That range matters for reading what comes next.In the SFT model: mean absolute error of 74 to 113. On a scale of 0 to 81, an error of 74 means the probe is essentially guessing at random. There’s no signal. The notepad is blank, the running sum simply isn’t in there.In the ICoT model: errors between 0.56 and 2.00. The value is sitting right there in the hidden state, clean enough that the dumbest possible tool can read it out. At every step, the model knows exactly where it is in the computation.The SFT model produces correct-looking outputs without knowing where it is. The ICoT model carries the full computation internally, the rough work just moved from the training data into the model’s hidden states. That’s not a small difference. That’s the difference between a student who writes down the right answer and a student who actually did the maths.The Model Started Leaving Sticky Notes for ItselfSo the ICoT model has the right information inside it. The next question is how it’s organised? and this is where it gets genuinely surprising.A transformer doesn’t process everything in one place. It has multiple layers, and within each layer, multiple attention heads.Each attention head is a small independent relationship-checker that can learn to look for different patterns. One head might learn to track grammar. Another handles positions. Another links related concepts. They all run in parallel, and their outputs get combined.I think of them as a team, each one asked to look at the same data but trained to notice different things. The transformer doesn’t assign jobs manually. It just creates the structure, and the heads figure out their specialisations through training.In the ICoT model, some heads had quietly divided the multiplication work between themselves. Nobody wrote this into the training code.Layer 1 heads: cache. Certain first-layer heads specialised around specific digit pairs. One gravitates toward a1 and b0. Another toward a0 and b1. By attending to these pairs, each head writes the pairwise product into the hidden state at that token position, using earlier positions in the sequence as a scratchpad. The model is leaving sticky notes for itself, partial product for this pair lives here. Come back when predicting output digit c2.Layer 2 heads: retrieve. When the model needs to produce a particular output digit, second-layer heads look back at exactly the positions where the relevant products were stored, pull them out, and combine them.Cache in layer 1. Retrieve in layer 2. A clean two-step. Same parameter count as SFT. Different internal organisation, this time, a useful one that emerged purely because the training pressure demanded it.That’s the algorithm. But the algorithm needs a space to run in. And the space the model built is not what anyone expected.Then the Geometry Got WeirdUntil here, the story is already interesting. Model learns rough work internally, stores partial products, retrieves them. Nice. But then the geometry arrives and makes everything feel slightly illegal.Each digit in the model has a vector representationvector representation → a point somewhere in a high-dimensional learned space. Hundreds of dimensions.The model doesn’t think of 7 as the number seven. It thinks of it as a location in this space, with a specific address made up of hundreds of coordinates. The finding was that the model isn’t treating digit-pair multiplication like a lookup table. It’s using geometry.When an attention head needs the partial product for digit pair a₁ and b₂, what it’s actually doing is adding their vector representations together. The embedding of a₁ plus the embedding of b₂ lands at a specific point in the learned space and that point encodes exactly the relationship needed for that pair.Scale this to all ten digits. Every digit lives at a point. Take every possible pair and add their positions. That gives you 100 combined points, one for every digit pair from 0–9 × 0–9. And this has a name, the Minkowski sum.Formally: A + B = {a + b | a ∈ A, b ∈ B}Putting in plain english, take every point in set A, add it to every point in set B, collect all the results. For digit embeddings, that is all 100 pairwise combinations. Those 100 points encode exactly what is needed to compute all pairwise partial products. The model didn’t memorise a multiplication table. It learned a shape where vector addition does the work of multiplication. The geometry is the arithmetic. So as the story continues, we have our next question, what shape?A Pentagonal Prism. Inside a Neural Network.When the researchers compressed the ICoT model’s digit representations down to three dimensions using PCA, Principle Component Analysis, a technique that takes data living in hundreds of dimensions, finds the directions where the data varies the most, and projects everything onto those, the ten digits arranged themselves into a pentagonal prism.Two pentagons, stacked parallel to each other, all ten digits sitting at the vertices like someone placed them there by hand.The SFT model under the same visualisation is just noise. Random scatter. No structure. So why a pentagonal prism and not some random polygonal structure?Base-10 arithmetic has cyclic structure buried in it. Digits wrap around after 10. Even and odd numbers alternate strictly. Numbers that differ by 5 , like 0 and 5, or 3 and 8, have a special paired relationship in base-10. Carries propagate in repeating patterns. Multiplication tables aren’t random, they have rhythm!!Cyclic, repeating structure has a natural mathematical language, Fourier representations. Same idea behind audio processing and signal analysis , any repeating pattern can be decomposed into combinations of waves at different frequencies. Fourier representations naturally arrange cyclic data on circles, because a circle is the geometric shape of a repeating pattern. For ten digits with even/odd structure, you get two circles, even digits rotating at one frequency, odd digits at another. Each circle holds five points: one pentagon carries 0, 2, 4, 6, 8 and the other carries 1, 3, 5, 7, 9. Stack those two pentagons in three dimensions and you get a pentagonal prism. Not a hexagonal prism (that would be base-12). Not a triangular prism. Pentagonal, exactly, because base-10 splits into two groups of five.So the pentagonal prism isn’t mysterious once you see it this way. The model discovered, purely through training pressure, that organising digit embeddings in a Fourier basis is the most efficient way to encode how digits actually behave in arithmetic. The shape is the model’s solution to the problem of representing cyclic arithmetic. Even digits land on one pentagon, odd on the other. Digits that differ by 5 sit at mirrored positions because in base-10 they’re arithmetically paired.The geometry isn’t decorative. It’s functional. When an attention head computes a partial product, it’s adding positions in this Fourier space, the Minkowski sum lands exactly where the product relationship should be. The shape of the space is doing part of the computation. The SFT model’s space never organised this way because the training signal never asked it to track intermediate computation. No pressure, no structure. Same parameter count. Completely different internal geometry.ICoT Proves the Principle. And this is my practical version.At this point, the natural question, do you actually need the full ICoT training process? The epoch-by-epoch curriculum, the gradual removal of intermediate steps, that’s a real engineering overhead. Can you get the same internal structure more directly?Yes. And this is arguably the more important result.Add an auxiliary loss, a small extra training signal on top of the normal objective. The normal training loss for a language model is simple, predict the right next token, get penalised when wrong. The auxiliary loss adds one extra pressure,At each output step, you should know the running sum.A lightweight regression head is attached to the second-layer attention output during training. It is trained to predict the intermediate running value at each step. The regression head is only used during training. At test time, it’s thrown away entirely, the model never has to produce the running sum out loud, just maintain it internally. It’s like training wheels that build the balance, then come off before the actual ride.L = L_language + λ · L_auxiliaryThat’s the entire change. One extra term.Result: 99% accuracy. Same 2-layer model. No curriculum. No visible intermediate steps at test time. And when you look inside, the same caching and retrieval structure had emerged, from a completely different training path, because the task required it and the signal pointed in the right direction.This matters more than it might seem. ICoT showed that the right internal organisation exists and can be learned. The auxiliary loss shows you don’t need a clever curriculum to get there, you just need a training signal that tells the model what it should be tracking internally. The principle transfers. Point the pressure in the right direction, and the structure builds itself.The Real LessonThe architecture was fine. The capacity was not the bottleneck. What was missing was the right training pressure, something that told the model which internal habit this specific task required. That is a different kind of problem than scale. Scale you can throw compute at. This requires understanding what structure a task actually needs inside the model, and finding a training signal that builds it.This matters outside of multiplication too. For real world work, the missing habit might be tracking constraints across a long conversation, remembering what the user actually wanted three messages ago, checking retrieved evidence before speaking confidently, or knowing when not to answer. These are not scale problems. They are structure problems. And we are still mostly figuring them out one paper at a time.It is worth noting, maths has become the standard way to expose this gap precisely because it is the one domain where you cannot fake it. You can measure everything else loosely. You can say a summary was “mostly right” or a poem was “pretty good.” But 67,443,612 is either right or it is not. That is why every frontier model launch, without exception, includes a maths benchmark in the evaluation table. Go check any of them, GPT, Claude, Gemini, Llama. Maths is always there. And the reason the benchmarks keep getting harder, GSM8K, then MATH, then AIME, is that models keep finding ways to score high without developing the actual reasoning. Change the surface details of a problem and performance drops. Add one irrelevant sentence to the question and some models lose up to 65% accuracy. The benchmark is not the reasoning. It is just the closest approximation we have found so far. Multiplication strips all of that away. There are 81 million possible four digit by four digit combinations. You cannot memorise your way through it. Either the procedure is there or it is not.The smartest thing I have ever talked to can still mess up multiplication. It runs matrix multiplication at every layer, builds attention graphs to understand language, organises digit embeddings into Fourier geometry, and still fails to follow the procedure a class four student learns in a notebook. That is not a contradiction once you separate the two meanings. One is the engine. The other is the driving test. Passing one does not mean passing the other.And yes, go try the 9.9 versus 9.11 question today. Most good and latest models will get it right. These surface failures are being fixed. That progress is real.But the deeper question remains. Can the model hold intermediate state across a long sequential computation? Can it know what it needs to remember and actually remember it? Can it tell you when it is on shaky ground versus when it is certain? Those are still being worked out.What I find interesting about this whole multiplication story is not the failure. It is what the failure reveals. A model that builds a pentagonal prism inside its hidden states to represent digit geometry, invents a dependency graph to cache partial products, and still apologises politely after getting a decimal wrong and that ladies and gentlemen is not a dumb system!!It is a strange kind of intelligence still figuring out its own shape. And honestly, so are we.The most human thing about all of it is that the model does not know it forgot. And the most human thing about us is that we find that funny, and then we go build the fix anyway.References and Further ReadingWhy Can’t Transformers Learn Multiplication? Reverse-Engineering Reveals Long-Range Dependency PitfallsWhy Can’t Powerful LLMs Learn Multiplication?Language Models Perform Reasoning via Chain of ThoughtAI models stumble on basic multiplication without special training methodsAI Does Multiplication Underneath. So Why Did Older Models Break at School Maths? was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.