HackerPapers

arXiv:2410.21272cs.CL

Arithmetic Without Algorithms: Language Models Solve Math With a Bag of Heuristics

Yaniv Nikankin, Anja Reusch, Aaron Mueller, Yonatan Belinkov

Abstract

Do large language models (LLMs) solve reasoning tasks by learning robust generalizable algorithms, or do they memorize training data? To investigate this question, we use arithmetic reasoning as a representative task. Using causal analysis, we identify a subset of the model (a circuit) that explains most of the model's behavior for basic arithmetic logic and examine its functionality. By zooming in on the level of individual circuit neurons, we discover a sparse set of important neurons that implement simple heuristics. Each heuristic identifies a numerical input pattern and outputs corresponding answers. We hypothesize that the combination of these heuristic neurons is the mechanism used to produce correct arithmetic answers. To test this, we categorize each neuron into several heuristic types-such as neurons that activate when an operand falls within a certain range-and find that the unordered combination of these heuristic types is the mechanism that explains most of the model's accuracy on arithmetic prompts. Finally, we demonstrate that this mechanism appears as the main source of arithmetic accuracy early in training. Overall, our experimental results across several LLMs show that LLMs perform arithmetic using neither robust algorithms nor memorization; rather, they rely on a "bag of heuristics".

arXiv comments
Journal reference
DOI
Subjects
cs.CLComputation and Language

On Hacker News

Linked by 2 identifiable commenters in 2 comments across 2 threads, from Jul 2025 to Sep 2026. Found in 1 HN submission from Nov 2024 to Nov 2024. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments2 threads

  1. When did Google get so weird? 1 comment
    • LLMs can in fact do arithmetic, just not reliably owing to how numbers are represented probabilistically: https://arxiv.org/abs/2410.21272

      dcrazyView on HNParent context

    • If LLMs can't even do basic arithmetic [1,2,3], why should anyone trust them with what they put in their mouths? [1] https://arxiv.org/abs/2410.21272 [2] https://arxiv.org/abs/2406.02356 [3] https://github.com/0xnurl/gpts-cant-count

      puttycatView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.