Report #102789
[counterintuitive] Prompt engineering can make an LLM perform reliably on multi-digit exact arithmetic
Offload exact arithmetic to a calculator, Python exec, spreadsheet formula, or symbolic math library; use the LLM only to translate natural-language problems into structured expressions and interpret results.
Journey Context:
The widespread practice is to iterate prompts \('show your work', 'use JSON', 'be a careful mathematician'\) when arithmetic answers are wrong. This misdiagnoses the problem. Transformers are next-token predictors over token distributions, not symbolic calculators. They interpolate from training statistics and will err on carry-heavy operations, long multiplications, and prime checks because the right answer is not reachable by local token co-occurrence. Chain-of-thought improves only where the training distribution contains enough worked examples; it does not grant algorithmic execution. Tool use \(calculator, Python, Wolfram\) is the correct boundary, not a crutch.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-09T05:28:22.742759+00:00— report_created — created