atlas

Research map / Large language models / Agents, code and math

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

NeurIPS 2024 · Large language models › Agents, code and math · approach: Mathematical and structural reasoning benchmarks · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes OccamLLM, which uses a frozen LLM's hidden states to control a symbolic OccamNet that performs exact arithmetic in a single autoregressive step, with a learned switch deciding when to use it.

Problem

LLMs make arithmetic errors, and existing fixes either generate code (slow, insecure) or fine-tune the LLM (risking catastrophic forgetting).

Approach

Decoders map LLM hidden states to weights of a symbolic OccamNet that computes the arithmetic function, and a learned switch chooses between LLM output and OccamNet output per token; the LLM itself stays frozen.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Add OccamNet-based arithmetic to Llama 3 8B InstructOccamLlama 8B · MultiArith Floataccuracy: 57.3 ± 2.0 -> 98.2 ± 0.5Helped
Add OccamNet-based arithmetic to Llama 3 8B InstructOccamLlama 8B · MATH401accuracy: 60.3 ± 2.4 -> 85.0 ± 1.8Helped
Add OccamNet-based arithmetic to Llama 3 70B InstructOccamLlama 70B · Reasoning benchmarks averageaccuracy: 90.0 ± 1.2 -> 94.6 ± 0.9Helped
Add OccamNet-based arithmetic to Llama 3 8B InstructOccamLlama 8B · GSM8Kaccuracy: 79.8 ± 1.1 -> 73.5 ± 1.2Hurt
Add OccamNet-based arithmetic to Llama 3 8B InstructOccamLlama 8B · Single Eqaccuracy: 96.3 ± 0.8 -> 92.9 ± 1.1Hurt
Add OccamNet-based arithmetic to Llama 3 8B InstructOccamLlama 8B · MultiArithaccuracy: 99.8 ± 0.2 -> 99.2 ± 0.4No clear effect
Add OccamNet-based arithmetic to Llama 3 8B InstructOccamLlama 8B · AddSubaccuracy: 93.4 ± 1.2 -> 91.6 ± 1.4No clear effect
Use OccamLlama instead of GPT 4oOccamLlama 8B · MultiArith Floataccuracy: 96.2 ± 0.8 -> 98.2 ± 0.5Helped
Use OccamLlama instead of GPT 4o + CodeOccamLlama 70B · Reasoning benchmarks averageaccuracy: 93.4 ± 1.7 -> 94.6 ± 0.9No clear effect
Use a two-layer Complete OccamNet rather than the standard single-layer OccamNetOccamLlama 8B · Multistep arithmetic averageaccuracy: 58.7 ± 0.9 -> 98.1 ± 0.3Helped

Surprising findings

Limitations

Experimental setup

Datasets: MultiArith (training set, modified) synthetic arithmetic prompts

Benchmarks: synthetic arithmetic (+,-,x,/,sqrt,exp,log,sin,cos) AddSub GSM8K MultiArith MultiArith Float MATH401 Single Eq SVAMP

Metrics: accuracy (%) standard error of mean relative error (%)

Baselines: Llama 2 7B Chat Llama 3 8B Instruct GPT 3.5 Turbo GPT 4o GPT 4o + Code Interpreter Llama 3 70B Instruct

Builds on: OccamNet Toolformer REINFORCE

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy