TLDR: A research paper by Davies et al. investigates how large language models (LLMs) embed numbers, finding that while numbers can be reconstructed from embeddings, LLMs do not represent continuous values as truly continuous. The study shows that increasing decimal precision, mixed signs, and large magnitudes degrade performance. Crucially, a significant portion of the embedding space is dedicated to “noise” unrelated to the numerical value, indicating that LLMs introduce substantial extraneous variation, which has implications for applications requiring precise numerical understanding.
Large Language Models (LLMs) have become incredibly powerful, demonstrating remarkable abilities in understanding and generating human language. They are increasingly being deployed in critical areas that demand precise mathematical reasoning, such as accounting, medical calculations, and even radiotherapy planning. However, a recent research paper titled “Language Models Do Not Embed Numbers Continuously” delves into a fundamental question: how well do these advanced models truly represent numerical values, especially continuous ones?
Authored by Alex O. Davies, Roussel Nzoyem, Nirav Ajmeri, and Telmo M. Silva Filho from the University of Bristol, UK, this study challenges the assumption that LLMs model continuous values as continuously as one might expect. While previous work has shown that LLM embeddings can reconstruct original numerical values, this paper investigates whether the underlying representation truly captures the continuous nature of numbers. You can read the full paper here.
The Challenge of Numerical Representation
The researchers highlight that the way LLMs handle numbers is crucial, especially in scientific and safety-critical applications. For instance, in climate science, atmospheric aerosol concentrations can vary by many orders of magnitude. If an LLM incorrectly associates “2.847 × 10-9 kg m-3” with “2.847 × 10-6 kg m-3” just because they share the same mantissa, it could lead to significant errors. Similarly, in drug discovery, a small difference in inhibitor potency (e.g., picomolar vs. millimolar) can mean the difference between an effective drug and an inactive compound. Even in astronomy, understanding stellar velocities requires precise handling of both positive and negative values, where a negative sign might not imply semantic opposition but rather a direction relative to an observer.
These examples underscore the need for LLMs to not only store numerical information but also to understand its continuous and ordinal nature, as well as the significance of signs and magnitudes.
Unpacking the Embedding Space: The Methodology
To evaluate how LLMs embed numbers, the researchers developed a general and lightweight framework. Instead of focusing on complex geometric structures, they proposed three key metrics:
- Linear R2: This measures how well a linear model can reconstruct the original numerical values from their high-dimensional embeddings. A high R2 indicates good reconstructability.
- PCA Correlation: This assesses whether the primary direction of variation in the embedding space aligns with the original numerical ordering of the input values.
- PCA Explained Variance: This metric quantifies how much of the total variation within the embedding space is captured by its first principal component. For a truly continuous, one-dimensional input like a scalar number, one would expect this to be close to 100%.
The study used models from three major providers: Google Gemini, OpenAI (text-embedding-3-large, text-embedding-3-small, text-embedding-ada-002), and Voyage AI (voyage-3-large, voyage-3.5, voyage-3.5-lite). They tested these models across datasets of positive decimals, mixed-sign decimals, and mixed-sign integers with varying levels of precision and magnitude.
Key Findings: Continuity is Lacking, Noise is Abundant
The results paint a nuanced picture:
Firstly, the good news: LLM embeddings can indeed be used to reconstruct numbers with reasonable fidelity. Most models maintained R2 scores above 0.95 for simpler datasets, confirming that numerical information is largely preserved in the embedding space. However, this performance degraded as decimal precision increased and when mixed-sign values were introduced, especially for larger magnitudes.
Secondly, the primary principal component of the embedded representations did correlate meaningfully with the input precision across most models. This suggests that the main axis of variation in the embedding space generally aligns with the numerical ordering of the input scalars, indicating that models do capture the fundamental ordinal structure of numbers.
However, a significant limitation emerged from the third metric: the explained variance by the first principal component remained consistently low across all models, often below 40% even for the simplest datasets. This is a critical finding. Given that the first component does correlate with the original numbers, the low explained variance implies that the embedding space contains substantial additional variation—essentially, noise—that is not present in the original one-dimensional numerical input.
Visualizations further supported this. For mixed-sign integers, the first principal component often encoded only the sign of the number, while the second component broadly encoded the magnitude. This suggests a separation of concerns that isn’t ideal for a truly continuous representation, and for larger magnitudes, neither the first nor second principal components effectively represented the number’s magnitude.
Implications for LLM Applications
These findings have several important implications:
- Precision Matters: Numerical understanding degrades significantly with increasing precision. This suggests that rounding numbers to fewer decimal places might improve performance in tasks requiring numerical reasoning.
- Signs are Tricky: The presence of negative values consistently degraded performance. The models struggled with the concept of negative numbers more than expected, often encoding only the sign in the primary component of variation. Caution is advised when using embeddings for datasets with both positive and negative values.
- Noise Interference: LLM embedding models introduce systematic noise into numerical representations. This extraneous variation, orthogonal to the numerical content, can interfere with applications requiring precise numerical relationships, such as mathematical reasoning or quantitative analysis.
Also Read:
- Unlocking How Large Language Models Perceive Problem Difficulty
- A New Framework for Classifying Language Model Hallucinations
Conclusion and Future Directions
The research concludes that while LLM embedding models can preserve enough numerical information for reconstruction, they introduce substantial noise that limits their effectiveness for precise numerical applications. There’s a fundamental trade-off: preserving numerical information often comes with extraneous variation.
Future work should focus on developing specialized embedding architectures for numerical data, perhaps through targeted pretraining or architectural modifications that better isolate numerical information. Techniques for denoising numerical embeddings or identifying the most relevant dimensions for numerical tasks could also enhance the practical utility of existing models for quantitative applications.


