# Why AI Struggles With Basic Math: Tokens, Not Stupidity

AI's math failures come from tokenized numbers and a prediction objective meeting a task that demands exact procedure.

> Why does AI struggle with basic math?

## Short answer

AI struggles with basic math because it does not store numbers as quantities and does not run a carry algorithm; it predicts likely next tokens, so exact multi-step arithmetic becomes pattern-matching that breaks on unfamiliar digits. **Tokenization**, the **training objective**, and weak **length generalization** each contribute. The failure is narrow, not total.

Models recall single facts and estimate well; they break on chained exact steps. Two distinct problems get merged under "bad at math": output-format failure, which prompting can fix, and genuine computational error, which it cannot. Routing arithmetic to a calculator or interpreter removes most of the second, and moves the risk into tool selection and result integration.

- **Failure profile**: Multi-digit exact steps, not single facts
- **Root representation**: Numbers split into arbitrary subword tokens
- **Fix that works**: Route math to a calculator or interpreter

## The Arithmetic Gap Is Real but Narrow

**Failure is concentrated, not general.** Large models reliably recall single-digit products, round numbers, and common conversions because those appear millions of times in training text. Breakdowns cluster where an exact answer requires chaining irreversible steps: multi-digit multiplication, long division, decimal alignment, unit conversion across several factors.

Two different things get called "bad at math." The first is **format compliance** — producing an answer in the shape the grader expects. A small-model study found GSM8K accuracy at 0.23% with a bare prompt but 81.73% when the answer format was recoverable, a gap of 81.5 points; on the harder MATH benchmark the same intervention recovered only 1.06 points . That asymmetry is the informative part: on grade-school problems the bottleneck was output format, while on competition problems reasoning dominated, with per-subject regimes ranging from format-bound to reasoning-bound to confidently wrong .

The second is genuine computational error. When researchers systematically perturbed GSM8K word problems — same structure, larger and stranger numbers — all six tested models degraded, and error analysis attributed a substantial share of wrong answers to **calculation errors** rather than faulty reasoning . Larger digits also corrupted reasoning steps, not just arithmetic . The gap is narrow in scope and wide in consequence: it sits exactly where finance, science, and engineering need precision.

> Most "AI can't do math" demos mix three failures: formatting, arithmetic, and reasoning.

> Note: The GSM8K and MATH figures come from one 8B model under specific prompting conditions; treat the magnitudes as illustrative of the format-versus-reasoning split, not as frontier-model benchmarks.

## Numbers Enter the Model as Tokens, Not Quantities

**A number is a string before it is a value.** Tokenizers built for text split on frequency, not on decimal structure. "100400" can become "100" and "400", a split that encodes nothing about hundreds of thousands . The model receives a sequence of subword IDs, and place value, alignment, and carry must be inferred from patterns across examples.

The consequence shows up in comparisons, not just arithmetic. The often-cited failure that **9.11 > 9.9** is a magnitude error a token-distance representation makes likely: "11" is a familiar number larger than "9", and the decimal point is a token like any other . Embeddings do carry some numeric structure — probing work finds approximate magnitude encoded — but approximate is not exact, and exactness is what arithmetic demands.

Representation-layer fixes exist and are mostly unproven at scale. One proposal re-tokenizes numbers as three-digit **triads** with explicit magnitude suffixes (k, m, b, t) and depth markers for fractions, so the token string itself states the scale . The authors present it as a hypothesis with validation left for future work, so treat it as a plausible mechanism rather than a demonstrated fix . Digit-level tokenization is the simpler variant with the same trade-off: place value becomes learnable, at the cost of far longer sequences and slower inference.

> The model never sees a magnitude. It sees a token that usually appears near numbers of that size.

## Next-Token Prediction Rewards Plausible Steps, Not Exact Ones

**The objective is likelihood, not correctness.** A model trained on next-token prediction is rewarded for continuations that resemble good solutions. Nothing in that loss checks whether the intermediate sum is right. The result is **locally fluent, globally wrong** arithmetic: each line looks like a plausible step, the final answer is stated with confidence, and the error is invisible without recomputation.

Chain-of-thought helps because it converts one hard prediction into many easier ones, but it does not install a carry algorithm. What appears to work is changing the shape of the steps. Turing Programs decompose an algorithmic task into unit operations — copy the current state, modify one symbol — mimicking a Turing machine's tape; with that format, transformers showed robust **length generalization** on addition and multiplication, handling numbers longer than any seen in training . The accompanying argument is that a transformer can implement such a program, making generalization possible for any algorithmic task expressed that way .

The trade-off is length and fragility: every emitted step is another chance to slip, and long scratchpads cost tokens and latency. It also reframes the problem. Models are not failing to understand arithmetic; they are being asked to run an exact procedure through a channel optimized for plausible text. Give the procedure an explicit, mechanical form and the error rate drops sharply .

> Note: Turing Programs were demonstrated on algorithmic tasks such as addition, multiplication, and in-context gradient descent — not on open-ended word problems, where parsing remains a separate source of error.

## Shortcuts and Distribution Shift Break Generalization

**Pattern-matching generalizes sideways, not forward.** Train on ten-digit addition and test on twenty, and performance collapses — the classic **length generalization** failure . A system that had learned the carry rule would not care about length. A system that learned "answers to problems shaped like this" cares enormously.

Perturbation studies make the same point from the other direction. Swapping in larger numbers while keeping the story and structure identical raised errors in every tested model, and the increase appeared in reasoning steps as well as final arithmetic . If the underlying competence were algorithmic, changing 12 to 1,247 should cost nothing.

Two boundary conditions matter. First, **contamination**: public benchmarks may overlap training data, so a high score is weak evidence of arithmetic skill, and clean length-split evaluations are the honest test. Second, failure modes are not uniform across difficulty. The same small-model analysis found format-bound subjects, reasoning-bound subjects, and a confabulation-heavy regime where the model answers confidently with the wrong kind of mathematics . Improving formatting helps the first group, does nothing for the second, and can slightly hurt .

A model's math score therefore describes performance on a distribution, not a guaranteed capability. Change the numbers, the notation, or the length, and you are sampling a different distribution.

> If the model had learned the algorithm, the number of digits would not matter.

## Tools and Deliberate Computation Move the Boundary

**Externalize the arithmetic.** A calculator or Python interpreter turns an exactness problem into a routing problem. The model's job shrinks to parsing the question, writing an unambiguous expression, calling the tool, and reporting the result — tasks where next-token prediction is genuinely well suited.

Tool use is not free reliability. An evaluation of tool-augmented agents built on 8B to 70B open models measured task completion, **tool selection accuracy**, cost, and where failures begin; arithmetic errors largely disappear while errors move into orchestration — picking the wrong tool, mis-formatting arguments, or misreading the returned value . Agents coordinating several tools degrade further as task complexity rises .

The design lesson is to make computation **verifiable rather than trusted**. Execute code and check the output; cross-check by an independent route (estimate the magnitude, verify parity, confirm units); require the model to state the expression before evaluating it, so a wrong expression is visible. Independent verification catches errors that a second sample from the same model will not, because correlated mistakes survive self-consistency.

This is why "AI can't do math" already feels dated in production: the systems people actually use route arithmetic out. The residual risk is quieter and more expensive — a correct calculation applied to the wrong formula, or a tool silently skipped when the model thought it knew the answer.

> The calculator is reliable. The model deciding whether to open it is not.

## Common misconceptions

- **Myth:** AI simply cannot do math. **Reality:** Fact recall, rounding, and estimation are usually fine. Errors concentrate in chained exact computation and in unfamiliar number formats, which is a much narrower claim.
- **Myth:** A bigger model will fix the arithmetic. **Reality:** Scale improves accuracy on familiar distributions but does not remove tokenization limits or the length-generalization cliff; models still degrade past the digit lengths they saw in training.
- **Myth:** The model is doing the calculation, just badly. **Reality:** On multi-digit problems it may be matching patterns rather than running an algorithm. That distinction matters because pattern-matching predicts exactly where failures appear: longer numbers, reordered expressions, changed notation.
- **Myth:** Adding a calculator makes the system reliable. **Reality:** It moves failure to tool selection and result integration. Agents with several tools degrade further as task complexity rises.

## FAQ

### A model answers 12 × 47 correctly but fails on 1,247 × 3,918. Which explanation fits the evidence best?

The structure is identical and only the digits changed. Failure that scales with digit length is the signature of length generalization limits rather than a missing reasoning step.

### Why does decomposing arithmetic into copy-and-modify steps improve length generalization?

Turing-style scratchpads externalize intermediate state as text, turning an exact procedure into a sequence of small lookups and edits that transformers can execute at lengths beyond training.

### After a model is given a calculator tool, what is the most likely remaining failure?

Tool-augmented evaluations show arithmetic errors largely vanish while orchestration errors — tool choice, argument formatting, result integration — become the dominant failure mode, worsening as tasks require more tools.

### How much of the arithmetic gap is tokenization versus architecture and training data?

If tokenization is the dominant cause, a representation change buys large gains cheaply; if not, effort belongs in training objectives and tool integration.

### Do models that route math to tools ever internalize the underlying algorithm?

Outsourcing arithmetic makes systems reliable now but may cap what they can do on problems where the right computation is not obvious in advance.

### How much benchmark performance is contamination rather than competence?

Without clean length-split and perturbation evaluations, reported math scores cannot distinguish memorized items from generalizable procedure.

---

Delve Editorial · https://delve.prisflow.com/p/why-does-ai-struggle-with-basic-math
