Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

In-Context Sharpness as Alerts: An Inner Representation Perspective for Hallucination Mitigation

About

Large language models (LLMs) frequently hallucinate and produce factual errors, yet our understanding of why they make these errors remains limited. In this study, we delve into the underlying mechanisms of LLM hallucinations from the perspective of inner representations, and discover a salient pattern associated with hallucinations: correct generations tend to have sharper context activations in the hidden states of the in-context tokens, compared to the incorrect ones. Leveraging this insight, we propose an entropy-based metric to quantify the ``sharpness'' among the in-context hidden states and incorporate it into the decoding process to formulate a constrained decoding approach. Experiments on various knowledge-seeking and hallucination benchmarks demonstrate our approach's consistent effectiveness, for example, achieving up to an 8.6 point improvement on TruthfulQA. We believe this study can improve our understanding of hallucinations and serve as a practical solution for hallucination mitigation.

Shiqi Chen, Miao Xiong, Junteng Liu, Zhengxuan Wu, Teng Xiao, Siyang Gao, Junxian He• 2024

Related benchmarks

TaskDatasetResultRank
Multiple-Choice ClassificationMMLU
Accuracy60.69
47
Open-ended generationTriviaQA--
37
Text GenerationGSM8K
Accuracy53.39
35
Free-form text generationCoQA
Accuracy63.4
22
Question AnsweringCoQA
Factual Accuracy25.02
21
Question AnsweringTYDIQAGP
Factual Accuracy27.12
21
Short Answer Question AnsweringHotpotQA
EM39.2
21
Question AnsweringTruthfulQA
Factual Accuracy43.53
21
Question AnsweringTriviaQA
Factual Accuracy44.17
21
Short Answer Question AnsweringNatural Questions (NQ)
EM39.2
21
Showing 10 of 16 rows

Other info

Follow for update