mlsanityData to 14 Oct 2026

OccamLLM: Fast and Exact Language Model Arithmetic in a Single Step

arXiv 2406.06576 ↗First posted 4 Jun 2024cs.CL cs.AI cs.LGcited by 7

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

  1. 2023Solving Challenging Math Word Problems Using GPT-4 Code Interpreter with Code-based Self-Verification15 Aug
  2. 2023How well do Large Language Models perform in Arithmetic tasks?16 Mar

Other references · 23

  1. 2017Attention Is All You Needcited by 60,361
  2. 2017Proximal Policy Optimization Algorithmscited by 15,215
  3. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
  4. 2021Training Verifiers to Solve Math Word Problemscited by 10,109
  5. 2022Fast Inference from Transformers via Speculative Decodingcited by 1,653
  6. 2022Program of Thoughts Prompting: Disentangling Computation from Reasoning for Numerical Reasoning Taskscited by 1,076
  7. 2021Are NLP Models really able to Solve Simple Math Word Problems?cited by 878
  8. 2016Solving General Arithmetic Word Problemscited by 360
  9. 2023LLM-Adapters: An Adapter Family for Parameter-Efficient Fine-Tuning of Large Language Modelscited by 324
  10. 2023Sentiment Analysis in the Era of Large Language Models: A Reality Checkcited by 268
  11. 2023Prompting Large Language Model for Machine Translation: A Case Studycited by 250
  12. 2021Internet-Augmented Dialogue Generationcited by 217
11 more
  1. 2018Learning Equations for Extrapolation and Controlcited by 156
  2. 2023Accelerating LLM Inference with Staged Speculative Decodingcited by 151
  3. 2016Extrapolation and learning equationscited by 110
  4. 2023Is ChatGPT a Good Sentiment Analyzer? A Preliminary Studycited by 96
  5. 2019Recurrent Neural Networks (RNNs): A gentle Introduction and Overviewcited by 68
  6. 2023GPT Can Solve Mathematical Problems Without a Calculatorcited by 68
  7. 2020OccamNet: A Fast Neural Model for Symbolic Regression at Scalecited by 14
  8. 2023Arithmetic with Language Models: from Memorization to Computationcited by 12
  9. 2024Bayesian Parameter-Efficient Fine-Tuning for Overcoming Catastrophic Forgettingcited by 9
  10. 2024Delving into Parameter-Efficient Fine-Tuning in Code Change Learning: An Empirical Studycited by 8
  11. 2022AI-Assisted Discovery of Quantitative and Formal Models in Social Sciencecited by 6

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 3; 2026: 4.

7 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2024Language Models Do Hard Arithmetic Tasks Easily and Hardly Do Easy Arithmetic Tasks
  2. 2025Efficient numeracy in language models through single-token number embeddings
  3. 2024Unraveling Arithmetic in Large Language Models: The Role of Algebraic Structures
  4. 2025StreetMath: Study of LLMs' Approximation Behaviors
  5. 2022Limitations of Language Models in Arithmetic and Symbolic Induction
  6. 2025Do Large Language Models Truly Grasp Addition? A Rule-Focused Diagnostic Using Two-Integer Arithmetic
  7. 2024Improving Arithmetic Reasoning Ability of Large Language Models through Relation Tuples, Verification and Dynamic Feedback
  8. 2024Assessing the Emergent Symbolic Reasoning Abilities of Llama Large Language Models