Introduction
Determining whether a Large Language Model (LLM) possesses specific factual knowledge typically requires a "generate-and-verify" approach. This involves prompting the model, waiting for a complete response, and then cross-referencing the output against external ground truth. While effective, this post-hoc evaluation is computationally expensive and reactive, failing to identify potential hallucinations until they have already been produced.
Researchers from Tel Aviv University have introduced KEEN (Knowledge Estimation of ENtities), a novel method to estimate an LLM's internal knowledge about a subject before any text generation occurs. By probing the model's internal hidden representations as it processes an entity's name, KEEN can forecast future performance with high accuracy.
Methodology
The core premise of KEEN is that an LLM's knowledge about a specific entity is localized and accessible within its internal states the moment the entity is identified.
Feature Extraction and Probing
When a model processes a subject name (e.g., "Napoleon"), KEEN extracts hidden states from the upper-intermediate layers at the position of the entity's final token. The researchers explored three probing variants:
- Hidden States (HS): Utilizing raw vector representations.
- Vocabulary Projection (VP): Mapping hidden states onto the model's vocabulary to identify human-readable "knowledge signals."
- VP-k: A sparse, interpretable version using only the top-k influential tokens.
The probe is a simple linear layer trained to minimize the Mean Squared Error (MSE) between its prediction and the model's actual average accuracy on a set of questions regarding that specific entity.
Experimental Setup
The study evaluated KEEN across several benchmarks and architectures:
- Benchmarks: PopQA (for question-answering accuracy) and FActScore (for open-ended biography factuality).
- Models: GPT2-XL, Pythia (6B, 12B), LLaMA2 (7B, 13B), and Vicuna 13B.
Key Results and Discussion
KEEN demonstrates a remarkable ability to "read the model's mind." The probe consistently achieved high Pearson correlations with actual performance metrics, ranging from 0.58–0.68 for QA accuracy and 0.66–0.77 for open-ended generation (OEG) factuality.
Internal Uncertainty and Fine-Tuning
Beyond simple accuracy prediction, KEEN scores correlate with a model's tendency to "hedge" (e.g., stating "I don't know"). This suggests that internal uncertainty is detectable before the model explicitly decides to output a hedging phrase. Furthermore, KEEN effectively tracks the impact of fine-tuning; as a model learns new data, its KEEN scores for target entities increase, while unrelated entities may show a decrease, reflecting the phenomenon of catastrophic forgetting.
Efficiency and Interpretability
Unlike traditional evaluation methods, KEEN requires only a single forward pass of the entity name. This makes it orders of magnitude faster than generating and scoring full responses. Additionally, the VP-k variant provides interpretability: if the internal representation of a person strongly activates tokens like "Senator" or "Physicist," the model is statistically more likely to provide accurate factual information about that individual.
Conclusion and Future Directions
KEEN proves that LLM knowledge is highly centralized and "ready for recall" upon entity recognition. While currently focused on named entities, future work may expand this approach to abstract concepts or procedural knowledge.
The practical implications are significant: KEEN could serve as a real-time "gatekeeper" in Retrieval-Augmented Generation (RAG) systems. If a low KEEN score is detected for a subject, the system could preemptively trigger a search query or external verification, preventing hallucinations before they are ever written.
Summary updated