First, to be fair, Large Language Models (LLMs) have gotten MUCH better at math, both internally and through function calling. Internally, better training data and larger models allow for more patterns relating to math the LLM can draw from. Additionally, models trained to use tools and function calling are more capable of recognizing when parts of a prompt should be formatted for and sent to an external tool for processing. However, math is still a weak point for these language models, and here’s why.

As the term Large Language Model suggests, these are statistical language models that generate text using learned language patterns and probability and guided by user input. LLMs don’t actually perform calculations; they are still just predicting likely text based on patterns they’ve seen, not performing math operations or solving equations the way a calculator or spreadsheet would.

They can either rely on patterns in text they have seen to attempt to solve math problems (think of person trying to perform a complex mathematical equation in their head without a calculator) or they can pass these problems to external tools via function calling (for example, attempting to identify the data and equation to sent to Wolfram Alpha, or generating and executing Python code to solve).

Even in the latter case, the pipeline can be fragile; the LLM must identify the problem and data, format it correctly to pass along to an agent, receive the results, and — where things often break down — interpret and render the results.

This means LLMs can make mistakes with even simple math at several failure points: Interpreting the problem, attempting to solve the problem using language patterns, improperly extracting the problem and data, failures in passing the data to an agent, improperly interpreting the agent’s output, and incorrectly rendering that output as text.

Furthermore, each rerun or regeneration might give a different result as LLMs use pseudorandomness to slightly vary output, even for the same prompts.

Compare this to software like spreadsheets, including Microsoft Excel. Unlike LLMs, spreadsheets rely on actual, repeatable calculation. Assuming your formulas and data are correct, you will get correct and consistent solutions.

So what can you do?

  • Validate as many equations and as much input data as possible from authoritative sources beforehand.
  • Be concise, avoiding extraneous text or explanations that might cause drift.
  • Don’t work over long sessions. As with text, LLMs can suffer from hallucination, user-induced bias, context drift, and overload, and these issues show up in math as well.
  • Break tasks into logical steps and start each step in a new session using validated output from the last. Errors will compound over extended sessions.
  • Validate all LLM output, regardless of whether it used function calling or agents.

In conclusion, this doesn’t mean LLMs provide no value for math use cases. There are still many situations where they can help identify patterns, form equations, and solve problems as long as it’s understood that output needs to be validated and understood before use, especially in critical fields like finance, medicine, engineering, construction, chemistry, and anywhere else precision is vital and safety is involved.

Leave a comment

Dave Ziegler

I’m a full-stack AI/LLM practitioner and solutions architect with 30+ years enterprise IT, application development, consulting, and technical communication experience.

While I currently engage in LLM consulting, application development, integration, local deployments, and technical training, my focus is on AI safety, ethics, education, and industry transparency.

Open to opportunities in technical education, system design consultation, practical deployment guidance, model evaluation, red teaming/adversarial prompting, and technical communication.

My passion is bridging the gap between theory and practice by making complex systems comprehensible and actionable.

Founding Member, AI Mental Health Collective

Community Moderator / SME, The Human Line Project

Let’s connect

Discord: AightBits