Large language models (LLMs) demonstrate great performance in text generation. However, LLMs are still suffering from hallucinations. In this work, we propose an inference-time method, Self-Highlighted Hesitation (SH2), to help LLMs decode more truthfully. SH2 is based on a simple fact rooted in information theory that for an LLM, the tokens predicted with lower probabilities are prone to be more informative than others. Our analysis shows that the tokens assigned with lower probabilities by an LLM are more likely to be closely related to factual information, such as nouns, proper nouns, and adjectives. Therefore, we propose to ``highlight'' the factual information by selecting the tokens with the lowest probabilities and concatenating them to the original context, thus forcing the model to repeatedly read and hesitate on these tokens before generation. During decoding, we also adopt contrastive decoding to emphasize the difference in the output probabilities brought by the hesitation. Experimental results demonstrate that our SH2, requiring no additional data or models, can effectively help LLMs elicit factual knowledge and distinguish hallucinated contexts. Significant and consistent improvements are achieved by SH2 for LLaMA-7b, LLaMA2-7b and Mistral-7b on multiple hallucination tasks.
翻译:大型语言模型(LLM)在文本生成中展现了卓越性能。然而,LLM仍面临幻觉问题。本文提出一种推理时方法——自我高亮犹豫(SH2),以帮助LLM更真实地解码。SH2基于信息论中的一个简单事实:对LLM而言,概率较低的预测令牌往往比其他令牌更具信息量。我们的分析表明,LLM赋予低概率的令牌更可能与事实信息密切相关,例如名词、专有名词和形容词。因此,我们提出通过选择概率最低的令牌并将其拼接至原始上下文来“高亮”事实信息,从而迫使模型在生成前反复阅读并对这些令牌进行犹豫。在解码过程中,我们还采用对比解码来强调犹豫带来的输出概率差异。实验结果表明,我们的SH2无需额外数据或模型,即可有效帮助LLM提取事实知识并区分幻觉上下文。SH2在LLaMA-7b、LLaMA2-7b和Mistral-7b上针对多个幻觉任务实现了显著且一致的改进。