LLMs Know More About Numbers than They Can Say
This paper reveals that while large language models often fail to verbally compare numbers in mixed notations, their hidden states actually encode accurate numerical magnitudes and rankings, and leveraging this internal knowledge through auxiliary training objectives can significantly improve their explicit numerical reasoning performance.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
The Big Idea: The "Silent Genius" Problem
Imagine you have a brilliant student who has memorized every math textbook in the library. They can solve complex equations in their head instantly. However, if you ask them to say the answer out loud, they stutter, guess, or get it wrong.
That is exactly what this paper discovered about Large Language Models (LLMs) like GPT-4, Llama, and others.
The Problem:
When you ask an AI, "Which is bigger: 5.7 × 10² or 580?" (which is a fancy way of writing 570 vs. 580), the AI often gets it wrong. It might say 570 is bigger, even though 580 is clearly larger. This happens even though the AI can easily calculate "5.7 times 100" if asked directly.
The researchers asked: Does the AI actually know the numbers, or is it just guessing?
The Investigation: Peeking Under the Hood
To find out, the researchers didn't just ask the AI questions; they put on "X-ray glasses" and looked inside the AI's brain (its hidden layers) while it was thinking.
Think of an LLM like a giant factory assembly line. Text goes in one end, gets processed through many rooms (layers), and comes out as an answer. The researchers stopped the line at different rooms to see what the "workers" (neurons) were thinking about the numbers.
They found two surprising things:
1. The "Log-Magnitude" Secret (The Internal Calculator)
The researchers found that deep inside the AI, there is a hidden "secret code" that represents the size of a number.
- The Analogy: Imagine the AI sees the number "580." Instead of just seeing the text "5-8-0," a specific part of its brain instantly translates that into a mental "volume knob" setting that says "This is loud." It translates "5.7 × 10²" into the exact same volume knob setting.
- The Proof: They built a simple tool (a linear probe) that could read this secret code. When they did, the tool could predict the actual size of the number with 99% accuracy. The AI knew the numbers were almost identical in size.
2. The "Comparison" Secret (The Internal Judge)
They also looked to see if the AI knew which number was bigger before it spoke.
- The Analogy: Imagine the AI has a tiny judge in its brain that holds up two apples and whispers, "Left one is bigger," to itself.
- The Proof: When they asked this internal judge, it was right 95% of the time. It knew 580 was bigger than 570.
The Tragedy: The "Mute" Problem
So, the AI knows the answer. It has the calculation. It has the comparison. But when it opens its mouth to speak, it fails.
- The Result: When asked to say the answer out loud, the AI only got it right 50% to 70% of the time. That's barely better than flipping a coin!
- Why? The paper suggests the AI is like a person who knows the answer but is too nervous to speak, or is so focused on mimicking the style of the question that they forget the math.
- Example: If the AI sees a sample question where the answer is always the second number, it might just start guessing "the second number" without actually doing the math.
The Solution: Training the Brain, Not Just the Mouth
The researchers wanted to see if they could fix this. They tried a new training method.
- The Old Way: Train the AI to just give the right answer (like teaching a student to memorize the answer key).
- The New Way: While training, they also forced the AI to "check its work" internally. They added a rule: "Before you speak, make sure your internal 'volume knob' and 'judge' are correct."
The Result:
This worked like magic. By forcing the AI to pay attention to its internal understanding of numbers, its spoken accuracy jumped up significantly (from ~57% to ~90%+ for some models).
The Takeaway
- LLMs are smarter than they sound: They have a deep, internal understanding of numbers that is much better than their ability to talk about them.
- The bottleneck is speech, not math: The problem isn't that the AI can't do math; it's that it can't translate that math into words reliably.
- We can fix it: If we train AI to care about its internal "number sense," it becomes much better at talking about numbers.
In short: The AI isn't bad at math. It's just bad at telling you the math. But with a little bit of the right training, we can help it find its voice.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.