Modular Arithmetic: Language Models Solve Math Digit by Digit

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Baeumel, Tanja, Gurgurov, Daniil, Ghussin, Yusser al, van Genabith, Josef, Ostermann, Simon
Formato: Preprint
Publicado: 2025
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866909720924651520
author Baeumel, Tanja
Gurgurov, Daniil
Ghussin, Yusser al
van Genabith, Josef
Ostermann, Simon
author_facet Baeumel, Tanja
Gurgurov, Daniil
Ghussin, Yusser al
van Genabith, Josef
Ostermann, Simon
contents While recent work has begun to uncover the internal strategies that Large Language Models (LLMs) employ for simple arithmetic tasks, a unified understanding of their underlying mechanisms is still lacking. We extend recent findings showing that LLMs represent numbers in a digit-wise manner and present evidence for the existence of digit-position-specific circuits that LLMs use to perform simple arithmetic tasks, i.e. modular subgroups of MLP neurons that operate independently on different digit positions (units, tens, hundreds). Notably, such circuits exist independently of model size and of tokenization strategy, i.e. both for models that encode longer numbers digit-by-digit and as one token. Using Feature Importance and Causal Interventions, we identify and validate the digit-position-specific circuits, revealing a compositional and interpretable structure underlying the solving of arithmetic problems in LLMs. Our interventions selectively alter the model's prediction at targeted digit positions, demonstrating the causal role of digit-position circuits in solving arithmetic tasks.
format Preprint
id arxiv_https___arxiv_org_abs_2508_02513
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Modular Arithmetic: Language Models Solve Math Digit by Digit
Baeumel, Tanja
Gurgurov, Daniil
Ghussin, Yusser al
van Genabith, Josef
Ostermann, Simon
Computation and Language
Artificial Intelligence
While recent work has begun to uncover the internal strategies that Large Language Models (LLMs) employ for simple arithmetic tasks, a unified understanding of their underlying mechanisms is still lacking. We extend recent findings showing that LLMs represent numbers in a digit-wise manner and present evidence for the existence of digit-position-specific circuits that LLMs use to perform simple arithmetic tasks, i.e. modular subgroups of MLP neurons that operate independently on different digit positions (units, tens, hundreds). Notably, such circuits exist independently of model size and of tokenization strategy, i.e. both for models that encode longer numbers digit-by-digit and as one token. Using Feature Importance and Causal Interventions, we identify and validate the digit-position-specific circuits, revealing a compositional and interpretable structure underlying the solving of arithmetic problems in LLMs. Our interventions selectively alter the model's prediction at targeted digit positions, demonstrating the causal role of digit-position circuits in solving arithmetic tasks.
title Modular Arithmetic: Language Models Solve Math Digit by Digit
topic Computation and Language
Artificial Intelligence
url https://arxiv.org/abs/2508.02513