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

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

TL;DR

When faced with noisy or ambiguous inputs, transformer models don't just output random nonsense—they actively force meaning onto the chaos by activating coherent, internal semantic concepts. This phenomenon, termed "conceptual wandering," peaks in the middle layers of the network and directly drives model hallucinations, which can be both predicted and mitigated by monitoring these internal activation patterns.

What Problem Does This Paper Address?

Despite the widespread deployment of generative AI, large language models (LLMs) and vision transformers still suffer from a critical vulnerability: hallucinations. They confidently invent facts, confabulate reasoning, and misinterpret inputs.

While standard benchmarks can easily quantify how often a model fails, we lack a mechanistic understanding of why and how these errors form internally. This paper investigates the root cause of hallucinations by exploring how transformers represent information under varying levels of uncertainty—ranging from slightly scrambled inputs to completely meaningless Gaussian noise.

Methods

The authors leverage Sparse Autoencoders (SAEs), a popular tool in mechanistic interpretability, to dissect the transformer's residual stream (its internal communication highway). SAEs untangle dense, opaque neural activations into a sparse, human-understandable set of linear features or "concepts."

The experimental pipeline includes:

  1. Noise-Trained SAEs: Training SAEs exclusively on the internal activations of a vision transformer fed with pure Gaussian noise to see if structured concepts emerge from semantically void inputs.
  2. Input Perturbation: Systematically degrading real text and images (via n-gram shuffling and patch shuffling) to observe how increasing uncertainty affects concept activation.
  3. Concept Evaluation: Measuring the semantic purity (coherence) and steerability (the ability to causally force a specific model output by manually amplifying a feature) of the discovered concepts.
  4. Predicting and Suppressing Hallucinations: Using Partial Least Squares (PLS) regression to map input prompt activations to downstream hallucination scores, and subsequently zeroing out the "hallucination-driving" features to fix the model's output.
Figure 1: Workflow to examine hallucination risk in each layer of the transformer. To assess the extent to which transformer models infer meaningful concepts from semantically void inputs, we study the semanticity of concepts in SAEs trained on residual stream activations of 1.3 million Gaussian noise samples from a pre-trained CLIP vision transformer at each layer by probing the concepts with natural images from the ImageNet-1k validation set. Many concepts are highly interpretable and consistent, despite the SAEs only ever being exposed to pure noise residual stream activations during training. While this noise training setup is specific to our first experiment, subsequent experiments adopt the same concept evaluation approach with alternative transformer models and input modalities. See Preliminaries and Appendix A for further experimental details.

Datasets

The study evaluates both vision and language modalities using several key datasets:

  • ImageNet-1k (Validation Set): 50,000 natural images used to probe and validate concepts discovered in vision transformers (CLIP-ViT-B/32).
  • FineWeb-Edu: Used to train baseline text SAEs on the Pythia-160m-deduped model.
  • Vectara Hallucination Leaderboard Dataset: 1,006 source articles used for a text summarization task evaluated by the HHEM-2.1 hallucination rating model on Gemma 2B-IT.
  • Benchmark Datasets: TruthfulQA, TriviaQA, and CoQA were leveraged to benchmark hallucination detection performance against existing methods.

Key Insights and Ideas

  • Input-Insensitive Inductive Bias: Transformers possess an ingrained bias to find structure. When given pure noise, they don't remain silent; they map the noise onto familiar internal semantic webs (e.g., robustly activating specific concepts like "turtles," "schooners," or "baseballs").
  • The "Conceptual Wandering" Phase: As input uncertainty increases, the number of active internal concepts actually expands rather than contracts. This expansion is localized primarily in the middle layers of the network, where the model broadly explores alternative semantic hypotheses.
  • A Predictable and Intervenable Path to Failure: Hallucinations in generated text are not random post-processing glitches. They are reliably encoded in the constellation of features activated by the input prompt itself. Crucially, because this relationship is linear, these errors can be intercepted and suppressed before text generation even begins.
Figure 2: Semantic concepts are reliably invoked by vision transformer layer 9 activations from pure noise. Each panel shows the top 4 images among 50,000 candidate images from the ImageNet- 1k validation set that most activated a particular semantic concept. These semantic concepts are defined by an SAE trained on pure noise activations from the residual stream at layer 9 of a CLIP vision transformer. Above each image we report the corresponding semantic label for that image. Patch colors indicate the individual patch activation strengths within that image for a given semantic concept (yellow = more activation of the concept). See Appendix B for additional concept examples.

Key Results

  • Meaning from Chaos: In the middle and late layers of a vision transformer fed with pure noise, up to 30% of the unique concepts identified were highly interpretable, and a significant portion were causally steerable.
  • U-Shaped Feature Expansion: Shuffling text or image inputs caused a massive spike in the number of active SAE concepts ($L_0$). This effect peaked sharply at layer 6 for vision (38 extra concepts) and layer 9 for text (81 extra concepts), confirming that middle layers bear the brunt of managing input uncertainty.
Figure 4: Increasing uncertainty in vision or text inputs elicits more semantic structure in mid- layers of transformers. The average number of SAE concepts identified (L0) increases dramatically with increasing input perturbation. We report the average change in L0 from baseline, corresponding to the number of SAE concepts with non-zero activations, across (a) patch-shuffled image activations and (b) n-gram-shuffled text activations for each transformer layer. Error bars show one standard deviation. Smaller patches and lower n-gram count induce greater input uncertainty for images and text, respectively. For both modalities, the L0 difference between natural inputs and perturbed inputs peaks in the middle layers, and increases with increasing levels of deliberate scrambling of transformer input information.
  • Hallucination Prediction: A linear PLS model trained on Layer 11 activations predicted continuous hallucination scores on unseen text summaries with a cross-validated $R^2$ of $0.271 \pm 0.010$, achieving a binary classification accuracy of 73.0%. This approach outperformed several established generation-based detection methods on TruthfulQA and TriviaQA.
  • Successful Mitigation: By identifying and suppressing just the top 10 hallucination-associated concepts in Layer 11, the authors reduced the mean hallucination score of the most problematic summaries by 0.19 (dropping from 0.91 down to 0.72).

Limitations and Future Work

While these findings span multiple modalities and model types, the authors note that it remains to be seen how these internal mechanics scale up to massive frontier models containing 10B to 100B+ parameters. Additionally, future work is needed to explore how sequence length and sampling temperature interact with this mid-layer conceptual wandering. Finally, the authors emphasize that while SAEs are incredibly useful, they are not perfect oracles and will continue to improve alongside advancing interpretability techniques.

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