From Noise to Narrative: Tracing the Origins of Hallucinations in Transformers

Praneet Suresh, Jack Stanley, Sonia Joseph, Luca Scimeca, Danilo Bzdok

Generative AI models are increasingly deployed in high-stakes scientific, business, and government environments. Yet, their tendency to "hallucinate"—confidently generating plausible but factually incorrect or ungrounded information—remains a critical hurdle to widespread trust and adoption. While the AI industry has developed numerous benchmarks to measure how often these models hallucinate, a deep, mechanistic understanding of why they do so has lagged.

Recent research investigates the internal workings of transformers to observe how they behave when faced with uncertainty, ambiguity, or pure noise. The findings reveal that transformers possess a strong inductive bias to impose semantic structure on unstructured inputs. Essentially, these models "see shapes in the clouds," and this overzealous pattern-matching is a root cause of hallucinations. Remarkably, by tracking internal activations, researchers demonstrated that it is possible to reliably predict and even suppress a model's hallucinations simply by analyzing how it processes the input prompt.

Peering Inside the Black Box with Sparse Autoencoders

To trace the exact origins of hallucinations inside the network's layers, the researchers employed Sparse Autoencoders (SAEs). SAEs are a popular mechanistic interpretability tool designed to translate dense, unreadable neural network activations into sparse, human-understandable "concepts" (such as "dogs," "bookshelves," or "water").

The team designed three core experiments to test how models handle varying degrees of uncertainty:

  1. The Noise Test: Pure Gaussian noise was fed into a frozen CLIP Vision Transformer. SAEs were trained on the model's internal activations to determine if the model was "thinking" about real concepts even when looking at static.
  2. The Scramble Test: To observe how models handle degraded, ambiguous structures, researchers fed patch-shuffled images to vision models and n-gram-shuffled text to language models (Pythia-160m).
  3. Prediction and Intervention: Using the Gemma 2B-IT language model on a summarization task (via the Vectara Hallucination Leaderboard dataset), the team mapped SAE concept activations triggered by the input prompt to the hallucination score of the generated output using Partial Least Squares (PLS) regression. Finally, they actively suppressed the concepts most associated with hallucination to see if it corrected the output.

Key Findings: Meaning from Noise and Conceptual Wandering

The experiments yielded several profound insights into transformer mechanics:

  • Transformers See Shapes in the Clouds: Pre-trained models have a massive bias toward finding meaning. Even when fed pure Gaussian noise, the CLIP model activated coherent, high-level semantic concepts. These concepts were highly interpretable (achieving a cosine similarity > 0.75 with real ImageNet labels) and "steerable," meaning researchers could artificially inject them to alter the model's classification of a neutral image.
  • "Conceptual Wandering" in Middle Layers: One might assume that a scrambled, nonsensical input would cause a model to activate fewer concepts. The opposite is true. When faced with ambiguity, the model searches wildly for meaning, activating significantly more concepts than it does for normal inputs. For instance, when text was scrambled at the single-word level, the Pythia model activated an average of 81 extra concepts in layer 9 compared to normal text. This explosion of concept activation peaks in the middle layers of the transformer.

Predicting and Controlling Hallucinations at the Prompt

Perhaps the most actionable insight from the study is that hallucinations start at the prompt. You do not need to wait for a model to generate a bad answer to know it is going to hallucinate.

The specific pattern of concepts that light up when the model reads the input prompt is a highly reliable predictor of whether the resulting output will be unfaithful. By looking solely at Layer 11 concept activations from the input prompt, the researchers predicted Gemma 2B-IT's output hallucination scores with an $R^2$ of 0.271 and a binary classification accuracy of 73.0%. This method outperformed several existing hallucination detection baselines.

Furthermore, the researchers proved that these hallucinations could be controlled. By identifying the top 10 concepts (out of 16,384) most responsible for hallucinations in Layer 11 and mathematically suppressing them to zero, they reduced the mean hallucination score of the worst-offending summaries by 0.19 (dropping from 0.91 to 0.72).

Limitations and Future Directions

While these findings offer a promising basis for automatically quantifying a model's hallucination risk and aligning AI models with human values, the authors note certain limitations. The experiments were conducted on small-to-medium models (up to 2 billion parameters like Gemma 2B). While the authors suspect these dynamics will generalize, their exact manifestation in 100B+ parameter frontier models remains to be explicitly verified. Additionally, the methodology assumes SAEs are accurate proxies for the model's true internal state, and while highly effective, they are not perfect oracles.

Future work will explore how hallucination and concept activation interact with longer context windows and higher sampling temperatures, which naturally introduce more variance into generation. Nonetheless, tracing hallucinations back to their mechanistic origins marks a significant step forward in building safer, more reliable generative AI systems.

Summary updated

BibTeX
@inproceedings{suresh2025from,
  author = {Praneet Suresh and Jack Stanley and Sonia Joseph and Luca Scimeca and Danilo Bzdok},
  title = {{From Noise to Narrative: Tracing the Origins of Hallucinations in Transformers}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=xd7cXU2P4G},
}
Figure