Identifying and Mitigating the Influence of the Prior Distribution in Large Language Models

Liyi Zhang, Veniamin Veselovsky, R. Thomas McCoy, Thomas L. GriffithsarXiv 2025 · DOI

Introduction

Large Language Models (LLMs) like Llama 3 exhibit a puzzling paradox: they can solve complex reasoning tasks yet frequently stumble on simple, deterministic operations such as counting letters or solving basic ciphers. Recent research from Princeton and Yale suggests these failures are not necessarily due to a lack of capability, but rather a systemic bias toward the "prior distribution"—the high-probability token sequences learned during pre-training.

The Problem: Prior Distribution Bias

The core issue lies in the model's statistical intuition. LLMs are trained to predict the next token based on massive datasets, leading them to favor common sequences over rare ones. For instance, when asked to count characters, a model might default to a multiple of ten (like "20" or "30") because those numbers appear more frequently in training data than a specific count like "23."

Figure 1: LLM performance is significantly higher on common sequences compared to uncommon ones across deterministic tasks.

This "prior-dominated" behavior causes the model's statistical training to override the specific context provided in the prompt. The researchers categorized tasks into prior-dominated (e.g., counting, acronyms) and prior-insensitive (e.g., multiplication), finding that hallucinations were almost exclusively tied to the former.

Methodology and Interventions

To investigate whether the models "know" the correct answer internally, the researchers applied several techniques to Llama 3 (8B):

  1. Logit Lens: Analyzing internal predictions at every layer to locate where the bias emerges.
  2. In-Context Prompting: Adding a simple instruction—"Do not rely on your prior knowledge"—to the prompt.
  3. Stratified Finetuning: Using Low-Rank Adaptation (LoRA) to train on one range of data (e.g., counting 10-50 items) and testing on another (51-100) to ensure the model learns the underlying mechanism rather than memorizing answers.

Key Results

The findings were transformative. The "Logit Lens" revealed that the correct information is often present in the model's internal representations but is suppressed by the prior in the final layers. By applying simple interventions, performance was dramatically recovered.

Figure 2: Accuracy gains after intervention (blue) compared to the baseline (red) across various tasks.

As shown in the results, accuracy in the "Acronyms" task rose from a meager 12.8% to nearly 100% through finetuning. Even simple prompting ("ignore the prior") improved counting accuracy from 11.5% to nearly 50%.

Mechanistic Insights

A striking discovery was the "all-or-none" pattern of prior influence. Layers within the network tend to either strongly correlate with the prior or not at all, suggesting that the bias is localized rather than distributed evenly. Furthermore, the success of stratified finetuning proves that LLMs possess the latent logic required for these tasks; the intervention simply acts as a filter to remove the "noise" of the prior distribution.

Conclusion

This research shifts the perspective on LLM hallucinations from a lack of "reasoning" to a conflict between internal logic and statistical priors. By identifying that the correct answers are often already computed "under the hood," developers can use lightweight interventions—like specific prompting or single-layer finetuning—to unlock the full potential of existing models without massive retraining.

Summary updated

BibTeX
@misc{zhang2025identifying,
  author = {Liyi Zhang and Veniamin Veselovsky and R. Thomas McCoy and Thomas L. Griffiths},
  title = {{Identifying and Mitigating the Influence of the Prior Distribution in Large Language Models}},
  year = {2025},
  eprint = {2504.12585},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2504.12585},
}
Figure