Do I Know This Entity? Knowledge Awareness and Hallucinations in Language Models

Javier Ferrando, Oscar Balcells Obeso, Senthooran Rajamanoharan, Neel Nanda

Executive Summary

Researchers have discovered that Large Language Models (LLMs) possess specific internal "directions" in their neural circuitry that signal whether they actually know a specific entity (like a movie or athlete). By using Sparse Autoencoders (SAEs) to isolate these "knowledge awareness" features, the team demonstrated they could causally steer a model to either hallucinate about real people or refuse to answer questions it actually knows the answer to.

Introduction: The Hallucination Problem

We’ve all been there: you ask an AI a niche question, and it either confidently makes up a lie (hallucination) or politely demurs (refusal). While we know that models do this, we haven't really understood how they decide. Is there a specific "I don't know this" switch inside the transformer?

Understanding the mechanistic roots of hallucinations is a major goal for AI safety and reliability. If we can find the internal representations that distinguish between known facts and unknown territory, we can potentially build models that are more honest about their own limitations. This paper investigates whether models have self-knowledge—internal representations about their own capabilities—and how these representations drive behavior.

Methodology: Finding the Knowledge Compass

The authors employed Sparse Autoencoders (SAEs)—a popular tool in mechanistic interpretability—to deconstruct the complex activations of models like Gemma 2 and Llama 3.

  1. Feature Discovery: They used SAEs to find specific "latents" (interpretable directions in the model's hidden states) that fire consistently when the model encounters an entity it doesn't recognize.
  2. Activation Steering: To prove these directions aren't just passive markers, they performed "brain surgery" by manually increasing or decreasing these activations.
Overview of the SAE intervention methodology, showing how steering latents can shift a model from refusal to hallucination.
  1. Activation Patching: They used this technique to trace the flow of information, identifying which specific attention heads are responsible for moving entity attributes to the final output and how the "unknown" signal disrupts them.

Experimental Setup

The study relied on a mix of curated and real-world data to test the model's boundaries:

  • Wikidata Entities: A custom dataset of thousands of basketball players, movies, cities, and songs.
  • Known vs. Unknown Split: Entities were categorized based on the model's actual performance (e.g., if the model correctly identifies the director and release year of a movie, it's "known").
  • Post-Cutoff Validation: To ensure the "unknown" features were robust, they tested them on 283 songs released in August 2024—well after the models' training data cutoff.
  • Baselines: FineWeb and The Pile were used to ensure these features weren't just firing on every random word.

Core Findings

The investigation yielded several fascinating insights into how LLMs process familiarity.

  • The "Middle Layer" Sweet Spot: Knowledge awareness isn't scattered everywhere. The most general, "entity-agnostic" features (those that work for movies and cities alike) peak in the middle layers of the network.
Separation scores for known and unknown latents across layers, peaking in the middle layers.
  • Causal Control: These internal directions act as a steering wheel for behavior. By boosting the "known entity" latent, researchers could force a model to hallucinate a biography for a non-existent person rather than refusing. Conversely, steering the "unknown" latent induced nearly 100% refusal across all entity types, even for world-famous entities.
  • Finetuning Repurposes Base Features: Interestingly, these features exist in the base (pre-trained) models, but the chat (instruction-tuned) models "repurpose" them to trigger refusal behavior.
  • Attention Disruption: Mechanistically, the "unknown" signal works by "blinding" the model’s attribute extraction heads. When the signal fires, downstream attention heads stop looking at the entity's name, preventing the model from retrieving facts about it.

Steering and Behavioral Impact

The practical implications of these findings are significant. By "deleting" the unknown direction from the model's weights (weight orthogonalization), the researchers significantly reduced the model's tendency to refuse, though this predictably led to more hallucinations. Furthermore, the discovered directions generalized well; a single "unknown" latent could detect a fake athlete, a fake city, or a fake song with high accuracy. Beyond just "known/unknown," the authors also found latents that correlate with the model being "unsure," which can predict when a model is about to give a wrong answer even if it doesn't refuse.

Conclusion and Future Directions

The authors acknowledge a few key boundaries. The work focuses strictly on factual recall of entities and doesn't yet cover procedural knowledge or abstract reasoning. Additionally, categorizing an entity as "known" based on a few questions might include some lucky guesses by the model. Finally, while they found directions for "unknown" entities, finding directions for internal uncertainty ("I know this but I'm confused by the prompt") is a more complex challenge.

Future work aims to see if these techniques can be used to create "truthfulness" filters that catch hallucinations before they are even generated, paving the way for more reliable and self-aware AI systems.

Summary updated

BibTeX
@inproceedings{ferrando2025do,
  author = {Javier Ferrando and Oscar Balcells Obeso and Senthooran Rajamanoharan and Neel Nanda},
  title = {{Do I Know This Entity? Knowledge Awareness and Hallucinations in Language Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=WCRQFlji2q},
}
Figure