Introduction
Large Language Models (LLMs) frequently demonstrate what appears to be sophisticated numerical reasoning. However, this performance often masks a significant dependency: the accuracy of these models is tightly coupled with the frequency of specific numbers within their pretraining data. This paper investigates whether few-shot numerical performance is a robust emergent skill or merely a reflection of statistical patterns learned from the pretraining corpus.
Problem Statement
When an LLM correctly calculates $24 \times 18$ but fails on $23 \times 18$, the assumption of underlying mathematical logic becomes questionable. The "black box" nature of pretraining data makes it difficult to distinguish between genuine reasoning and "data leakage"—where the model simply recalls specific instances seen millions of times during training. This study seeks to quantify the extent to which term frequency predicts performance on numerical tasks.
Methodology
The researchers analyzed the EleutherAI/GPT model family (GPT-J-6B and GPT-Neo) using The Pile, an 800GB public pretraining corpus. The experimental pipeline involved several key steps:
- Frequency Counting: Calculating occurrences of individual numbers, pairs, and full equations in the corpus.
- Task Design: Evaluating models on arithmetic, operation inference, and unit conversion.
- Performance Gap Analysis: Measuring the accuracy difference between the most and least frequent terms.
Key Insights
The study reveals that a model's ability to solve a math problem is largely a "popularity contest." If a number appears frequently in the training data, the model is significantly more likely to handle it correctly. Notably, even the frequency of a single operand (unigram frequency) is a strong predictor of success, suggesting that internal representations for common numbers are more refined. The performance gap between frequent and rare terms can reach up to 70%, indicating that LLMs may function more as sophisticated lookup tables than as logical reasoners.
Results
The primary finding is a massive correlation between term frequency and accuracy. As shown in the data, numbers that appear more often in the pretraining set consistently yield higher accuracy in reasoning tasks.
Furthermore, providing more few-shot examples often widened the performance gap. This suggests that prompts help the model retrieve existing patterns from pretraining rather than teaching new reasoning capabilities. In unit conversion tasks, the model excelled at common conversions (e.g., decades to years) but struggled with less frequent numerical inputs in similar patterns (e.g., weeks to days).
Conclusion and Future Work
The findings suggest that current benchmarks for numerical reasoning are heavily biased by pretraining data distributions. The authors argue that future evaluations must account for term frequencies to validly claim a model possesses reasoning skills. Future research should explore whether different training objectives or data balancing techniques can mitigate this "popularity bias" and foster more robust, frequency-independent numerical logic.
Summary updated