OccamLLM: Fast and Exact Language Model Arithmetic in a Single Step
On the map: LLM reasoning → Mathematical reasoning
Abstract (arXiv)
Despite significant advancements in text generation and reasoning, Large Language Models (LLMs) still face challenges in accurately performing complex arithmetic operations. Language model systems often enable LLMs to generate code for arithmetic operations to achieve accurate calculations. However, this approach compromises speed and security, and fine-tuning risks the language model losing prior capabilities. We propose a framework that enables exact arithmetic in a single autoregressive step, providing faster, more secure, and more interpretable LLM systems with arithmetic capabilities. We use the hidden states of a LLM to control a symbolic architecture that performs arithmetic. Our implementation using Llama 3 with OccamNet as a symbolic model (OccamLlama) achieves 100% accuracy on single arithmetic operations (+,-,×,div,sin,cos,log,exp,√), outperforming GPT 4o with and without a code interpreter. Furthermore, OccamLlama outperforms GPT 4o with and without a code interpreter on average across a range of mathematical problem solving benchmarks, demonstrating that OccamLLMs can excel in arithmetic tasks, even surpassing much larger models. We will make our code public shortly.
Key facts. Cited by 7 papers in the map (data through 14 Oct 2026). Placed in Mathematical reasoning, one of 17 directions in LLM reasoning. Builds on 25 of its 40 references that are in the map. First posted on arXiv 4 Jun 2024.
Builds on
25 of 40 references.
Closest ancestors · 2
Same direction, newest first
- 2023Solving Challenging Math Word Problems Using GPT-4 Code Interpreter with Code-based Self-Verification15 Aug
- 2023How well do Large Language Models perform in Arithmetic tasks?16 Mar
Other references · 23
- 2017Attention Is All You Needcited by 60,361
- 2017Proximal Policy Optimization Algorithmscited by 15,215
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
- 2021Training Verifiers to Solve Math Word Problemscited by 10,109
- 2022Fast Inference from Transformers via Speculative Decodingcited by 1,653
- 2022Program of Thoughts Prompting: Disentangling Computation from Reasoning for Numerical Reasoning Taskscited by 1,076
- 2021Are NLP Models really able to Solve Simple Math Word Problems?cited by 878
- 2016Solving General Arithmetic Word Problemscited by 360
- 2023LLM-Adapters: An Adapter Family for Parameter-Efficient Fine-Tuning of Large Language Modelscited by 324
- 2023Sentiment Analysis in the Era of Large Language Models: A Reality Checkcited by 268
- 2023Prompting Large Language Model for Machine Translation: A Case Studycited by 250
- 2021Internet-Augmented Dialogue Generationcited by 217
11 more
- 2018Learning Equations for Extrapolation and Controlcited by 156
- 2023Accelerating LLM Inference with Staged Speculative Decodingcited by 151
- 2016Extrapolation and learning equationscited by 110
- 2023Is ChatGPT a Good Sentiment Analyzer? A Preliminary Studycited by 96
- 2019Recurrent Neural Networks (RNNs): A gentle Introduction and Overviewcited by 68
- 2023GPT Can Solve Mathematical Problems Without a Calculatorcited by 68
- 2020OccamNet: A Fast Neural Model for Symbolic Regression at Scalecited by 14
- 2023Arithmetic with Language Models: from Memorization to Computationcited by 12
- 2024Bayesian Parameter-Efficient Fine-Tuning for Overcoming Catastrophic Forgettingcited by 9
- 2024Delving into Parameter-Efficient Fine-Tuning in Code Change Learning: An Empirical Studycited by 8
- 2022AI-Assisted Discovery of Quantitative and Formal Models in Social Sciencecited by 6
Built on by
Citing papers per year: 2025: 3; 2026: 4.
7 papers.
- 2026Large Language Model Reasoning Failurescited by 21
- 2025L2M: Mutual Information Scaling Law for Long-Context Language Modelingcited by 9
- 2025Comprehension Without Competence: Architectural Limits of LLMs in Symbolic Computation and Reasoningcited by 9
- 2025ASyMOB: Algebraic Symbolic Mathematical Operations Benchmarkcited by 5
- 2026AI-rithmeticcited by 1
- 2026Value-Aware Numerical Representations for Transformer Language Modelscited by 0
- 2026Large Language Models as Amortized Pareto-Front Generators for Constrained Bi-Objective Convex Optimizationcited by 0
- 2026Large Language Models as Amortized Pareto-Front Generators for Constrained Bi-Objective Convex Optimization12 May 2026
- 2026AI-rithmetic11 Feb 2026
- 2026Large Language Model Reasoning Failures5 Feb 2026
- 2026Value-Aware Numerical Representations for Transformer Language Models14 Jan 2026
- 2025Comprehension Without Competence: Architectural Limits of LLMs in Symbolic Computation and Reasoning14 Jul 2025
- 2025ASyMOB: Algebraic Symbolic Mathematical Operations Benchmark28 May 2025
- 2025L2M: Mutual Information Scaling Law for Long-Context Language Modeling6 Mar 2025
Similar, not cited
Close in wording, no citation either way
- 2024Language Models Do Hard Arithmetic Tasks Easily and Hardly Do Easy Arithmetic Tasks
- 2025Efficient numeracy in language models through single-token number embeddings
- 2024Unraveling Arithmetic in Large Language Models: The Role of Algebraic Structures
- 2025StreetMath: Study of LLMs' Approximation Behaviors
- 2022Limitations of Language Models in Arithmetic and Symbolic Induction
- 2025Do Large Language Models Truly Grasp Addition? A Rule-Focused Diagnostic Using Two-Integer Arithmetic
- 2024Improving Arithmetic Reasoning Ability of Large Language Models through Relation Tuples, Verification and Dynamic Feedback
- 2024Assessing the Emergent Symbolic Reasoning Abilities of Llama Large Language Models