TL;DR
Large Language Models (LLMs) often struggle with numerical reasoning, producing incorrect outputs. This paper reveals that a subtle "Benford's Law" digit bias, learned from web-scraped training data, is a primary cause of these numerical hallucinations. By identifying and pruning specific neurons responsible for this bias, the authors demonstrate a causal link between this low-level statistical artifact and high-level reasoning failures.
What Problem Does This Paper Address?
Despite impressive advancements, Large Language Models (LLMs) frequently fail at basic numerical tasks, producing mathematically incorrect or logically inconsistent outputs. This phenomenon, known as numerical hallucination, is a significant barrier to their reliability. While previous work has pointed to dataset biases in general language tasks (like over-representing certain phrases), this paper specifically investigates whether a statistical bias in digit distribution within the training data could be the root cause of numerical errors. The core question is: does the skewed frequency of leading digits in natural data (Benford's Law) get internalized by LLMs, leading them to systematically favor smaller digits and thus hallucinate numerical outputs?
Methods
The researchers employed a multi-pronged approach to investigate digit bias in LLMs:
- Corpus Analysis: They first analyzed the Olmo-Mix-1124 pretraining corpus to confirm if it exhibits a digit distribution consistent with Benford's Law.
- Diagnostic Benchmark: They created a "Digit Bias Benchmark" with seven numerical reasoning tasks. Crucially, the ground-truth answers for these tasks were engineered to have a uniform distribution of digits (0-9), eliminating task-specific biases. This allows for a cleaner observation of the model's inherent generation bias.
- Logit Lens: This technique was used to trace how digit preferences evolve across different layers of the LLM. By examining the "logit lens" output at each layer, they could visualize where and how the bias emerges.
- Neuron-Level Analysis: They developed a "Digit Selectivity Score" (DSC) to quantify how strongly individual neurons in the Feed-Forward Network (FFN) layers favor specific digits. This allowed them to pinpoint which neurons were most responsible for the digit bias.
- Causal Intervention (Pruning): To establish causality, they identified the top 0.01% most digit-1-selective neurons and pruned them. This intervention was applied only during the generation of digit tokens.
Datasets
- Training Data: Olmo-Mix-1124 (a 22.4TB dataset for pretraining LLMs).
- Evaluation Benchmarks:
- Digit Bias Benchmark (New): A custom benchmark with seven numerical reasoning tasks (add/sub, multiplication, division, evaluate, nearest integer root, linear_1d, sequence next term) designed to have uniformly distributed digits in ground-truth answers.
- Real-world Benchmarks: GSM8k and SVAMP (used for evaluating the impact of pruning on more complex reasoning tasks).
Key Insights and Ideas
- Benford's Law in LLM Training Data: The pretraining corpus (Olmo-Mix-1124) indeed shows a strong digit distribution that aligns with Benford's Law, meaning smaller digits appear more frequently as leading digits.
- LLMs Internalize Digit Bias: When evaluated on the Digit Bias Benchmark (with uniform ground-truth digits), LLMs consistently overgenerate smaller digits, mirroring the bias found in their training data.
- First Error Digits are More Biased: The distribution of the first digit where a model's output deviates from the correct answer shows an even stronger skew towards smaller digits, suggesting that digit bias actively steers the model off course during hallucination.
- FFNs in Later Layers are the Culprits: The digit bias primarily originates from a subset of highly digit-selective neurons within the Feed-Forward Network (FFN) components of the later layers of the LLM.
- Pruning Biased Neurons Corrects Errors: Selectively pruning the most digit-1-selective neurons can measurably reduce the overgeneration of digit '1' and, more importantly, correct previously erroneous outputs, providing causal evidence for the link between digit bias and hallucination.
Key Results
- LLMs consistently overgenerate smaller digits on a benchmark designed with uniform digit distributions.
- The first error digit in incorrect generations exhibits an even stronger Benford's Law-like distribution.
- Pruning the top 0.01% most digit-1-selective FFN neurons led to a reduction in digit '1' generation frequency and a measurable correction rate (e.g., 1.36% on the "Evaluate" task for Llama2-7B) on the Digit Bias Benchmark.
- Similar correction effects were observed on real-world mathematical reasoning benchmarks like GSM8k and SVAMP.
Limitations and Future Work
- Scale of Models: The experiments were conducted on relatively small-scale decoder-only LLMs (7B-9B parameters). It's an open question whether these patterns hold for larger models or Mixture-of-Experts (MoE) architectures.
- Pruning Coarseness: The pruning intervention is described as "coarse" and might negatively affect some previously correct predictions. While it demonstrates causality, more fine-grained or adaptive debiasing methods could yield better performance.
- Causality vs. Correlation: While the pruning intervention provides strong causal evidence, the authors note that establishing a definitive causal relationship would ideally require controlled interventions during training, which is left for future work.
- Generalizability of Pruning: The current pruning strategy is presented as a probing mechanism to understand bias, not necessarily a general-purpose debiasing tool.
Summary updated