The Geometry of Numerical Reasoning: Language Models Compare Numeric Properties in Linear Subspaces

This paper investigates whether large language models (LLMs) utilize numerical attributes encoded in a low-dimensional subspace of the embedding space when answering questions involving numeric comparisons, e.g., Was Cristiano born before Messi? We first identified, using partial least squares regression, these subspaces, which effectively encode the numerical attributes associated with the entities in comparison prompts. Further, we demonstrate causality, by intervening in these subspaces to manipulate hidden states, thereby altering the LLM's comparison outcomes. Experiments conducted on three different LLMs showed that our results hold across different numerical attributes, indicating that LLMs utilize the linearly encoded information for numerical reasoning.
View on arXiv@article{el-shangiti2025_2410.13194, title={ The Geometry of Numerical Reasoning: Language Models Compare Numeric Properties in Linear Subspaces }, author={ Ahmed Oumar El-Shangiti and Tatsuya Hiraoka and Hilal AlQuabeh and Benjamin Heinzerling and Kentaro Inui }, journal={arXiv preprint arXiv:2410.13194}, year={ 2025 } }