2024-10-27 · 进阶 · 自然语言处理 · 机器学习

DeCoRe: Decoding by Contrasting Retrieval Heads to Mitigate Hallucinations

该论文提出了DeCoRe,一种通过对比检索头输出以减轻大型语言模型幻觉的新颖解码策略。

更新于 2024-11-09。作者:Aryo Pradipta Gema、Chen Jin、Ahmed Abdulaal、Tom Diethe、Philip Teare、Beatrice Alex、Pasquale Minervini、Amrutha Saseendran。

中文摘要

大型语言模型(LLMs)常常出现幻觉,通过错误地表现所提供的环境或错误地回忆内部知识,产生不忠实或不准确的信息输出。最近的研究已经确定了Transformer架构中特定的注意力头,被称为检索头,它们负责提取相关的上下文信息。我们假设屏蔽这些检索头可以诱导幻觉,并且对比基础LLM和屏蔽LLM的输出可以减少幻觉。为此,我们提出了Decoding by Contrasting Retrieval Heads(DeCoRe),这是一种新颖的无需训练的解码策略,它可以增强上下文和模型参数中找到的信息。DeCoRe通过使用条件熵作为指导,动态对比基础LLM和屏蔽LLM的输出,从而减轻潜在的幻觉响应。我们的广泛实验证实,DeCoRe在需要高度上下文忠实性的任务上显著提高了性能,例如摘要(XSum提高了18.6%)、指令跟随(MemoTrap提高了10.9%)和开放式问答(NQ-Open提高了2.4%和NQ-Swap提高了5.5%)。

英文摘要

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%).

解读

一句话总结

该论文提出了DeCoRe,一种通过对比检索头输出以减轻大型语言模型幻觉的新颖解码策略。

问题1:这篇论文想要解决什么具体问题?

• 问题背景:大型语言模型(LLMs)容易产生幻觉,产生不忠实或事实错误的结果。 • 现有方案不足:现有方法难以有效减轻LLMs的幻觉问题。 • 研究目标:提出DeCoRe,通过对比检索头输出以减轻LLMs的幻觉问题。

问题2:论文的核心创新点是什么?

• 技术创新:通过对比检索头输出,动态对比基础LLM和掩码LLM的输出,并使用条件熵作为引导。 • 方法改进:提出了一种新的解码策略,无需训练即可减轻幻觉。 • 优势:显著提高了需要高上下文忠实度的任务,如摘要、指令遵循和开放式问答的性能。

问题3:实验结果如何验证了方法的有效性?

• 关键实验:在摘要、指令遵循、开放式问答和事实回忆等任务上进行了实验。 • 性能提升:DeCoRe在XSum摘要任务上提高了18.6%,在MemoTrap指令遵循任务上提高了10.9%,在NQ-Open开放式问答任务上提高了2.4%,在NQ-Swap开放式问答任务上提高了5.5%。 • 对比结果:DeCoRe在大多数任务中优于基线方法。

问题4:这个研究的实际应用价值是什么?

• 应用场景:摘要、指令遵循、开放式问答和事实回忆等任务。 • 实施建议:DeCoRe可以结合其他方法,如思维链提示,以进一步提高性能。 • 局限与展望:DeCoRe在某些任务上可能不如其他方法有效,需要进一步研究和改进。

来源