Abstract
Large language models (LLMs) have shown promise as potential knowledge bases, yet they often struggle with question-answering tasks and are prone to hallucinations. While previous research attributes these issues to knowledge gaps in the model's parameters, our investigation reveals a different phenomenon: LLMs often retain correct knowledge even when generating incorrect answers. Through analysis of model's internal representations, we find that correct answers frequently appear among high-probability tokens despite not being selected as final outputs. Based on this observation, we introduce Hits@k, a new metric to assess knowledge retention independent of expression accuracy. Our extensive experiments demonstrate that LLMs store significantly more knowledge than their QA performance suggests. Building on these findings, we develop SkipUnsure, a method to improve answer accuracy by leveraging detected but unexpressed knowledge. Experiments on both open-domain and specific-domain datasets show consistent improvements, with accuracy gains of up to 11.8% on DBPedia and 6.3% on IMDB, without requiring model retraining.
Introduction
When a Large Language Model (LLM) provides an incorrect answer or claims ignorance, the standard interpretation is that the model lacks the necessary information—a "knowledge gap." However, current generation methods typically rely on greedy decoding, which selects only the single most probable token at each step. This research investigates whether the failure lies not in the storage of knowledge, but in its expression.
As illustrated above, a model might assign a high probability to a correct answer (e.g., "Olympia") but still output a more common but incorrect token (e.g., "Seattle") if the latter has a slightly higher logit value. This "submerged knowledge" suggests that we are systematically underestimating the factual content stored within LLM parameters.
Methodology
To quantify this phenomenon, we move beyond top-1 accuracy to analyze the model's full probability distribution (logits).
Hits@k Metric
We introduce Hits@k, a metric adapted from recommendation systems. It measures whether the ground-truth answer appears anywhere within the model's top k predicted tokens. This allows us to evaluate knowledge retention independently of the final output selection.
SkipUnsure (Unsure Filtering)
We also developed a two-stage decoding process called SkipUnsure. If the model's primary prediction is a non-informative token (such as "unsure," a null string, or a stop word), the method filters these out and forces the model to generate the next most likely informative token. This acts as a probe to determine if the correct information was suppressed by a "wall of uncertainty."
Experimental Setup
We evaluated a diverse set of models, including the Llama 2 and 3 families, Qwen 2, and Mistral, with parameter counts ranging from 1.5B to 70B. Testing was conducted across three domains:
- DBPedia: Open-domain Wikipedia knowledge.
- IMDB: Movie-related facts.
- GoodReads: Book-related facts.
Entities were further categorized into Head (popular), Torso, and Tail (obscure) to analyze how entity frequency affects memory.
Key Findings
The Storage-Expression Gap
Our results reveal a massive discrepancy between what models output and what they internally "know." For example, while many models achieve less than 15% raw accuracy on specific tasks, the correct answer is often present in the top 5 tokens at a much higher rate.
As shown in the comparison above, model rankings shift significantly when evaluated by Hits@k versus standard Accuracy. Some models that appear less accurate in generation actually store more information than their more "expressive" counterparts.
Training Quality vs. Size
Interestingly, model size is not the sole determinant of knowledge retention. Newer, better-trained models (like Llama 3-8B) frequently outperform significantly larger older models (like Llama 2-70B) in Hits@k scores. This suggests that data quality and training recipes are more critical for knowledge storage than raw parameter count.
The "Unsure" Paradox
Prompting models to be cautious can inadvertently mask knowledge. A model might assign 0.5 probability to "unsure" and 0.3 to the correct answer. In standard usage, this is a failure; however, our SkipUnsure method recovered significant accuracy gains—up to 11.8% on DBPedia for Llama 3-70B—by simply bypassing the "unsure" response.
Conclusion
This study demonstrates that LLMs are more knowledgeable than they appear. The "knowledge gap" frequently cited in literature is often an "expression gap" caused by decoding limitations. By utilizing metrics like Hits@k and methods like SkipUnsure, we can better assess and utilize the latent knowledge within these models. Future work should focus on developing safer, more calibrated decoding strategies that can reliably "mine" this submerged knowledge without increasing the risk of hallucinations.
Summary updated