Language Models Do Not Embed Numbers Continuously

Alex Owen Davies, Roussel Desmond Nzoyem, Nirav Ajmeri, Telmo M Silva Filho · DOI

Abstract

Large Language Models (LLMs) are increasingly used for quantitative tasks, yet their internal representation of numbers remains poorly understood. This study investigates whether embedding models from major providers (OpenAI, Google, and Voyage AI) capture the continuous, one-dimensional nature of numerical values. We find that LLM embeddings often represent numbers as fragmented, noisy clusters, prioritizing string patterns or signs over actual magnitude. This discontinuity poses significant risks for high-precision scientific applications.

Introduction

We increasingly rely on LLMs for tasks involving complex data, from climate modeling to drug discovery. In these fields, the difference between $10^{-9}$ and $10^{-6}$ is critical. Most practitioners assume that if an LLM "understands" a number, its internal representation (the embedding) must map that number onto a continuous scale. However, LLMs are trained primarily on text, not math. This paper investigates whether embedding models actually capture the "one-dimensional" nature of numbers or if they see them as a collection of discrete, unrelated tokens.

Methodology

The authors propose a lightweight, model-agnostic framework to measure the "purity" of numerical embeddings. They map a scalar number $x$ into a high-dimensional embedding $\hat{X}$ and evaluate the result using three key metrics:

  1. Linear Reconstruction ($R^2$): Can a simple linear model predict the original number from its embedding?
  2. PCA Correlation: Does the first Principal Component (PC1) of the embeddings align with the actual number line?
  3. PCA Explained Variance: How much of the embedding's "energy" is dedicated to representing the number's value versus "noise" or other features?
Figure 2: Framework for evaluating numerical embeddings by mapping scalars to high-dimensional space and analyzing reconstruction and PCA properties.

Experimental Setup

The researchers generated three synthetic datasets to stress-test models across different numerical properties:

  • Positive Decimals: Values in $[0, 1]$ with precision ranging from 1 to 20 decimal places.
  • Mixed-Sign Decimals: Values in $[-1, 1]$ to observe transitions through zero.
  • High-Magnitude Mixed-Sign Integers: Values ranging up to $\pm 10^7$ to test scale effects.

Flagship models tested include OpenAI’s text-embedding-3-large, Google’s gemini-embedding-001, and Voyage AI’s voyage-3.5 suite.

Key Insights and Results

The study reveals several fundamental flaws in how current LLMs represent numbers:

The "Noise" Dominance

Even when a model can reconstruct a number with high accuracy ($R^2 > 0.95$), the actual "numerical value" often explains less than 40% of the variance in the embedding. The majority of the embedding space is filled with "noise"—likely artifacts of how the number was formatted as a string during training.

The Sign Split and Visual Discontinuity

One of the most striking findings is the "sign split." Many models (especially Gemini and OpenAI) create a massive gap between positive and negative numbers. Instead of a continuous line passing through zero, the embeddings form two distinct clusters based on the "+" or "-" sign.

Figure 6: PCA visualizations of integer embeddings. Note the clear separation between positive and negative values and the non-linear, fragmented structures.

As shown in Figure 6, the first principal component often only encodes the sign of the number, while the second component encodes the magnitude, effectively breaking the number line into a "V" shape or two separate clouds.

Precision and Model Performance

As decimal places increase, representation quality drops, as models treat numbers more like character sequences. Interestingly, Voyage AI models consistently outperformed OpenAI and Google in preserving numerical structure, suggesting their training or architecture is better suited for quantitative data.

Conclusion and Recommendations

The study highlights that "off-the-shelf" embedding models do not naturally treat numbers as continuous values. While fine-tuning on scientific data might help, current models suffer from "string noise" inherent in their text-based training.

For practitioners, the advice is simple: round your numbers. Reducing decimal precision before embedding can lead to cleaner, more reliable representations by minimizing the impact of tokenization artifacts. Future work should focus on developing "numerical-native" architectures that can isolate magnitude from high-dimensional noise.

Summary updated

BibTeX
@misc{davies2025language,
  author = {Alex Owen Davies and Roussel Desmond Nzoyem and Nirav Ajmeri and Telmo M Silva Filho},
  title = {{Language Models Do Not Embed Numbers Continuously}},
  year = {2025},
  eprint = {2510.08009},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.08009},
}
Figure