arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2403.01548cs.CLcs.AIcs.LG

上下文内锐度作为警报:从内部表征视角缓解幻觉

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

City University of Hong Kong(香港城市大学);National University of Singapore(新加坡国立大学);Shanghai Jiao Tong University(上海交通大学);Stanford University(斯坦福大学);Penn State University(宾夕法尼亚州立大学);Hong Kong University of Science and Technology(香港科技大学)

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

AI总结:

该研究从大语言模型内部表征视角发现幻觉与上下文激活锐度相关,提出基于熵的锐度度量及约束解码方法,有效缓解幻觉,在TruthfulQA上最高提升8.6个点。

摘要:

大语言模型(LLM)频繁产生幻觉并生成事实性错误,但人们对其出错原因的理解仍十分有限。本研究从内部表征视角深入探究LLM幻觉的潜在机制,发现了一种与幻觉相关的显著模式:与错误生成相比,正确生成的上下文内词元在隐藏状态中往往具有更锐利的上下文激活。基于这一发现,我们提出一种基于熵的度量指标来量化上下文内隐藏状态的“锐度”,并将其融入解码过程,构建出一种约束解码方法。在多个知识问答与幻觉基准上的实验表明,该方法具有持续的有效性,例如在TruthfulQA上最高提升了8.6个点。本研究有望加深对幻觉的理解,并提供一种实用的幻觉缓解方案。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑