A user asks an agent how many servers they need to handle a peak load. A number comes back, correctly, and the agent explains its reasoning. So who did the arithmetic?
Not the agent. Not the language model either. And understanding why matters the moment the number comes back wrong, because the fix depends entirely on which part failed.
The question hides three different jobs
“Solving a maths problem” sounds like one task. In an agentic system it is at least four, and they live in different places.
| Job | Who does it | What it involves |
|---|---|---|
| Understanding the problem | The LLM | Reading an ambiguous request and working out what is actually being asked |
| Deciding to compute | The LLM | Recognising that this needs a calculation, and emitting a tool call for it |
| Doing the computation | Neither — the runtime | A Python sandbox, a calculator function, a computer algebra system |
| Running the loop | The agent | Executing the call, feeding the result back, deciding whether to continue |
Read that table twice, because the surprise is in row three. The exact arithmetic is performed by a deterministic piece of software that is neither the model nor the agent. It is a calculator. It was always a calculator.
The LLM solves the framing. The runtime solves the arithmetic. The agent solves the orchestration. Nobody solves the whole thing.
The agent adds no mathematical ability
This is the part that gets assumed away, so it is worth stating bluntly: wrapping an agent around a language model does not make the model better at arithmetic. Not a little better. Not at all.
An agent is control flow. It is a loop that calls a model, reads what comes back, executes any tool the model asked for, appends the result, and calls the model again. There is no mathematical faculty anywhere in that description. The model inside is the same model, with the same inability to compute rather than generate numbers.
What the agent adds is access. It can hand the model a calculator and then actually run it. That is a plumbing improvement, and plumbing improvements are the difference between a right answer and a confident wrong one — but they are not intelligence, and conflating the two leads people to trust agent output more than the architecture justifies.
The case that should worry you: an agent with no calculator
Plenty of things called agents are a prompt and a loop with no computational tools attached at all.
For maths, such a system is worse than a single model call. The loop adds steps, each one generated the same unreliable way, and then adds a confident narrative explaining the result. The model computes inline exactly as it would have on its own, except now there is scaffolding around the answer that makes it look like something was verified.
| Setup | Computation is | Net effect on maths |
|---|---|---|
| Single model call | Generated inline | Unreliable, and visibly so |
| Agent, no computational tool | Generated inline, across more steps | Equally unreliable, less visibly so |
| Agent with a calculator or sandbox | Executed by the runtime | Exact, if the setup was right |
| Agent with a tool it fails to call | Generated inline | Unreliable, and nobody notices |
That last row is the common one in production. The tool exists, the model does not reach for it, and the system quietly degrades to the first row while everyone assumes it is in the third. Whether the model reaches for the tool is governed by the prompt and the tool descriptions, which is a decision that sits with the model, not the agent framework.
Where the agent genuinely does help
There are two places the loop earns its keep mathematically, and both are real.
Multi-step problems stop compounding errors
Consider a calculation with four dependent stages. Asked in a single pass, the model generates all four, and an error in stage one silently corrupts stages two through four — a known weakness of long chains of generated reasoning.
In an agent loop, each stage can be an exact tool call. Stage one is computed by the runtime and the real result is written back into the context. Stage two is computed from that real value, not from a predicted one. The error does not propagate because there is no error to propagate. This is a structural advantage that no amount of better prompting gives you.
Verification becomes affordable
Checking an answer is almost always cheaper than producing one. A single model call cannot exploit that — it has one shot. An agent can: compute the result, then substitute it back into the original equation and confirm it holds; or compute it a second way and compare; or assert that the answer falls in a sane range.
This is the agentic pattern that actually raises reliability, and it is the one most systems skip. The loop is what makes a cheap check possible, and a cheap check is worth more than a better model.
When the number is wrong, which part failed?
This is the practical payoff of separating the jobs. A wrong answer from an agent has five distinct causes, and they need five different fixes. Guessing wrong here is how teams spend a week improving a prompt when the problem was a schema.
| What went wrong | Symptom | Where to fix it |
|---|---|---|
| Model misread the problem | Correct arithmetic, wrong question answered | Prompt and context — the request was ambiguous or under-specified |
| Model never called the tool | Plausible number, no tool call in the trace | Tool description and system prompt; make the tool’s trigger obvious |
| Model called the tool with bad arguments | Tool ran, inputs are wrong in the trace | Tighter schema and argument validation |
| Tool computed the wrong formula correctly | Exact execution, wrong expression | Validation layer — check the setup, not the output |
| No suitable tool exists | Model has no option but to generate | Architecture — add the tool |
Every row is diagnosable from an execution trace, which is why tracing matters more for agents than for single calls. Without the trace you cannot distinguish row two from row four, and they have nothing in common.
So what is the answer?
The LLM is the only component that understands the problem, and the only one that cannot calculate. The runtime is the only component that can calculate, and it understands nothing — it will execute whatever expression it is handed, including a wrong one. The agent connects them and is responsible for neither the understanding nor the arithmetic.
A correct answer therefore requires all three to do their own job and no more. The failures all come from one of them taking on another’s work: the model computing instead of delegating, the runtime being trusted to notice a bad formula, or the agent being credited with a reliability that comes entirely from the calculator bolted to its side.
If you want a single sentence: the LLM decides what to compute, something else computes it, and the agent is the part that makes sure both of those actually happened.
Key Takeaways
- “Solving a maths problem” is four jobs — understanding, deciding to compute, computing, and looping — held by three different components.
- The exact arithmetic is done by a deterministic runtime that is neither the agent nor the model.
- An agent adds no mathematical ability. It adds access to something that has it, plus the loop to use it.
- An agent with no computational tool is worse than a single model call for maths: equally unreliable, but wrapped in scaffolding that looks like verification.
- The most common production failure is a tool that exists and never gets called, which silently degrades the system to inline generation.
- The loop genuinely helps in two ways: exact intermediate results stop errors compounding, and cheap verification becomes affordable.
- A wrong number has five possible causes with five different fixes — and you need the execution trace to tell them apart.
Frequently Asked Questions (FAQ)
Q: Does the AI agent or the LLM solve a maths problem?
Neither, on its own. The LLM works out what needs calculating and asks for it. A deterministic runtime — a sandbox or calculator function — performs the actual arithmetic. The agent runs the loop that connects them and feeds the result back. The exact computation is done by ordinary software, not by either of the two things people usually credit.
Q: Does making a model agentic improve its arithmetic?
Not by itself. An agent is control flow, not capability — the model inside is unchanged and still cannot compute. What changes is that the agent can hand the model a calculator and actually execute it. If no such tool is attached, agentic framing improves nothing and makes the unreliability harder to spot.
Q: Why would an agent be worse than a plain LLM at maths?
Because of the appearance of rigour. With no computational tool available, the agent generates its numbers inline just as a single call would, but across more steps and with a confident explanation attached. The answer is no more reliable and considerably more convincing, which is the worst combination.
Q: What if the agent has a calculator but does not use it?
This is the most common real failure. The model decides whether to call a tool, and that decision is driven by the system prompt and the tool’s description. A vaguely described tool gets skipped, and the system silently falls back to generating the number. It is only visible in the execution trace, which is why tracing is not optional for agents.
Q: How do agents help with multi-step calculations?
By making each intermediate result real. In a single generated chain, an early error flows into every later step. In an agent loop each step can be an exact tool call whose true result is written back into the context, so the next step builds on a computed value rather than a predicted one. Errors stop compounding because there are none to compound.
Q: Can an agent check its own maths?
Yes, and this is where the loop adds the most value. It can substitute the answer back into the original problem, compute the same quantity a second way, or assert the result falls within a sensible range. Verification is usually far cheaper than solving, and a loop is what makes a second pass possible at all.
Q: Who is responsible when an agent returns the wrong number?
It depends on which job failed, and there are five candidates: the model misread the problem, the model skipped the tool, the model passed bad arguments, the tool executed a wrong formula faithfully, or no suitable tool existed. Each has a different fix, and only the execution trace tells you which one you are looking at.
Q: Can the runtime catch a mistake the model made?
No. A sandbox executes the expression it is given and has no view of the question that expression was meant to answer. It will compute the wrong thing perfectly and report success. Catching that requires a validation step that checks the setup rather than the output.
Q: Should the model or the agent decide which tool to call?
The model decides, by emitting a tool call; the agent executes what it asked for. Agent code can constrain the options — restricting which tools are available in a given state — but the selection itself happens inside the model, shaped by the prompt and the tool descriptions it was shown.
Related Reading: