
Contextual hallucinations in LLMs refer to instances where the models generate content that is factually incorrect or contextually irrelevant, even when provided with correct facts. This occurs when LLMs fail to generate accurate outputs despite being given the correct information within the input context.

Contextual hallucinations in LLMs impact reliability by generating factually incorrect or contextually irrelevant content, even when provided with correct facts. This undermines the accuracy and trustworthiness of LLMs in critical applications such as document-based question answering and summarization.

Methods to combat LLM hallucinations generally focus on using the internal representations of LLMs, such as hidden states or attention outputs5. Existing techniques often utilize the LLM's hidden states, attention block outputs, or entailment models trained on large annotated datasets5. However, these methods do not specifically address contextual hallucinations, where the provided context is key.