Language Models Encode Numbers Using Digit Representations in Base 10

Amit Arnold Levy, Mor Geva
10/15/2024
cs.LG

No official code found. Best implementation: amitlevy/base10 (6 stars, last commit 2025-05-13).

Abstract

Large language models (LLMs) frequently make errors when handling even simple numerical problems, such as comparing two small numbers. A natural hypothesis is that these errors stem from how LLMs represent numbers, and specifically, whether their representations of numbers capture their numeric values. We tackle this question from the observation that LLM errors on numerical tasks are often distributed across the digits of the answer rather than normally around its numeric value. Through a series of probing experiments and causal interventions, we show that LLMs internally represent numbers with individual circular representations per-digit in base 10. This digit-wise representation, as opposed to a value representation, sheds light on the error patterns of models on tasks involving numerical reasoning and could serve as a basis for future studies on analyzing numerical mechanisms in LLMs.

View on arXivView PDF

Code Implementations(1)

amitlevy/base10Community100%

Code for the experiments in "Language Models Encode Numbers Using Digit Representations in Base 10"

61Python, Jupyter NotebookOct 15, 20241 years ago

Similar Papers

Cite this paper

@article{levy2024language,
  title  = {Language Models Encode Numbers Using Digit Representations in Base 10},
  author = {Amit Arnold Levy and Mor Geva},
  year   = {2024},
  eprint = {2410.11781},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2410.11781v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2410.11781.svg)](https://codeofpaper.com/paper/2410.11781)

Discussion