arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.07812cs.CL
收藏

LLMs对数字了解得比他们能说的更多

LLMs Know More About Numbers than They Can Say

Shanghai Jiao Tong University(上海交通大学);Johns Hopkins University(约翰霍普金斯大学)

Fengting Yuchi, Li Du, Jason Eisner

AI总结:

研究发现LLM对数字大小的内部表示影响其数值推理能力,通过隐藏状态探测和微调提升准确性。

摘要:

尽管最先进的LLM能够解决数学问题,但我们发现它们在处理混合符号的数值比较时会出现错误:"5.7×10²和580哪个更大?"这引发了一个根本性的问题:LLM是否真的知道这些数字有多大?我们探测了几个较小的开源LLM的隐藏状态。一个适当的隐藏层的单线性投影可以编码两种数字的对数大小,使我们能够在受限的合成文本中以约2.3%的相对误差恢复数字,或在科学论文中以19.06%的误差恢复。此外,阅读一对数字后的隐藏状态编码了它们的排名,线性分类器可以达到90%以上的准确率。然而令人惊讶的是,当被明确要求对相同的数字对进行排序时,这些LLM的准确率仅为50-70%,对于那些探测效果较差的模型,表现更差。最后,我们显示在微调过程中将分类探测器的对数损失作为辅助目标可以进一步提高语言化准确性,比基模型多提高3.22%,证明了改进模型内部大小表示可以增强其数值推理能力。我们的代码可在https://github.com/VCY019/Numeracy-Probing获得。

英文摘要:

Although state-of-the-art LLMs can solve math problems, we find that they make errors on numerical comparisons with mixed notation: "Which is larger, $5.7 \times 10^2$ or $580$?" This raises a fundamental question: Do LLMs even know how big these numbers are? We probe the hidden states of several smaller open-source LLMs. A single linear projection of an appropriate hidden layer encodes the log-magnitudes of both kinds of numerals, allowing us to recover the numbers with relative error of about 2.3% (on restricted synthetic text) or 19.06% (on scientific papers). Furthermore, the hidden state after reading a pair of numerals encodes their ranking, with a linear classifier achieving over 90% accuracy. Yet surprisingly, when explicitly asked to rank the same pairs of numerals, these LLMs achieve only 50-70% accuracy, with worse performance for models whose probes are less effective. Finally, we show that incorporating the classifier probe's log-loss as an auxiliary objective during finetuning brings an additional 3.22% improvement in verbalized accuracy over base models, demonstrating that improving models' internal magnitude representations can enhance their numerical reasoning capabilities. Our code is available at https://github.com/VCY019/Numeracy-Probing.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑