ImageNet classification with deep convolutional neural networks
Alex Krizhevsky, Ilya Sutskever et al.
153
Citations
25
Influential Citations
Conference on Empirical Methods in Natural Language Processing
Venue
2024
Year
When asked to summarize articles or answer questions given a passage, large language models (LLMs) can hallucinate details and respond with unsubstantiated answers that are inaccurate with respect to the input context. This paper describes a simple approach for detecting such **contextual hallucinations**. We hypothesize that contextual hallucinations are related to the extent to which an LLM attends to information in the provided context versus its own generations. Based on this intuition, we propose a simple hallucination detection model whose input features are given by the ratio of attention weights on the context versus newly generated tokens (for each attention head). We find that a linear classifier based on these _lookback ratio_ features is as effective as a richer detector that utilizes the entire hidden states of an LLM or a text-based entailment model. The lookback ratio-based detector—**Lookback Lens**—is found to transfer across tasks and even models, allowing a detector that is trained on a 7B model to be applied (without retraining) to a larger 13B model. We further apply this detector to mitigate contextual hallucinations, and find that a simple classifier-guided decoding approach is able to reduce the amount of hallucination, for example by 9.6% in the XSum summarization task.
Hallucination in large language models remains a critical barrier to their deployment in high-stakes applications. This paper addresses the specific problem of contextual hallucinations—where the model generates information not supported by the provided input. The authors propose a remarkably simple yet effective detector, Lookback Lens, based on the ratio of attention weights on the context versus generated tokens. This approach is interpretable, computationally lightweight, and transfers across tasks and model sizes, making it highly practical for real-world use.
The significance lies in the insight that attention patterns themselves encode a signal about whether the model is relying on the context or drifting into unsupported generation. By distilling this into a single scalar feature per head, the method achieves performance comparable to much more complex detectors that use full hidden states or entailment models. This opens the door to lightweight, on-the-fly hallucination detection without requiring additional large models or extensive fine-tuning.
This work provides a practical, interpretable tool for improving LLM reliability. The simplicity of the approach means it can be easily integrated into existing pipelines without heavy computational overhead. The cross-model transfer property suggests that the attention-based signal is a fundamental property of LLMs, not an artifact of a specific architecture. This could lead to more robust hallucination mitigation strategies and deeper understanding of how LLMs process context versus generate freely.
Alex Krizhevsky, Ilya Sutskever et al.
Ashish Vaswani, Noam Shazeer et al.
Douglas M. Bates, Martin Mächler et al.
Diederik P. Kingma, Jimmy Ba