通过对比检索头输出,减少大模型幻觉生成。
DeCoRe: Decoding by Contrasting Retrieval Heads to Mitigate Hallucinations
- 不训练模型,通过遮蔽检索头并对比输出来增强上下文忠实性。
- 在摘要、指令遵循等任务上分别提升18.6%、10.9%和5.5%。
- 适合需要高事实准确性的问答与摘要场景。
大语言模型常产生与上下文不符或事实错误的幻觉输出。近期研究发现Transformer架构中的特定注意力头(检索头)负责提取相关上下文信息。我们假设遮蔽这些检索头会引发幻觉,并提出一种无需训练的解码策略DeCoRe:通过动态对比基础模型与遮蔽检索头后的模型输出,利用条件熵作为引导,增强上下文与参数中的有效信息。大量实验表明,DeCoRe显著提升了对上下文忠实性要求高的任务表现:摘要任务(XSum提升18.6%)、指令遵循(MemoTrap提升10.9%)、开放书问答(NQ-Open提升2.4%,NQ-Swap提升5.5%)。
原文摘要 · Abstract (English)
Large Language Models (LLMs) often hallucinate, producing unfaithful or factually incorrect outputs by misrepresenting the provided context or incorrectly recalling internal knowledge. Recent studies have identified specific attention heads within the Transformer architecture, known as retrieval heads, responsible for extracting relevant contextual information. We hypothesise that masking these retrieval heads can induce hallucinations and that contrasting the outputs of the base LLM and the masked LLM can reduce hallucinations. To this end, we propose Decoding by Contrasting Retrieval Heads (DeCoRe), a novel training-free decoding strategy that amplifies information found in the context and model parameters. DeCoRe mitigates potentially hallucinated responses by dynamically contrasting the outputs of the base LLM and the masked LLM, using conditional entropy as a guide. Our extensive experiments confirm that DeCoRe significantly improves performance on tasks requiring high contextual faithfulness, such as summarisation (XSum by 18.6%), instruction following (MemoTrap by 10.9%), and open-book question answering (NQ-Open by 2.4% and NQ-Swap by 5.5%).
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。