通过复制粘贴缓解大语言模型的幻觉
Copy-Paste to Mitigate Large Language Model Hallucinations
AI总结:
通过复制粘贴方法提升大语言模型上下文忠实性,减少幻觉并提高测试性能。
摘要:
尽管检索增强生成(RAG)使大语言模型(LLMs)能够生成上下文相关的响应,但上下文忠实性仍然具有挑战性,因为LLMs可能不一致地信任提供的上下文,导致幻觉,这会削弱可靠性。我们观察到在RAGTruth上响应复制程度与上下文不忠实的幻觉之间存在反相关性,表明较高的复制程度通过促进真实的上下文信念来减少幻觉。我们提出了CopyPasteLLM,通过两阶段的高复制响应偏好训练获得。我们设计了三种提示方法以提高复制程度,证明高复制响应在上下文忠实性和幻觉控制方面表现更优。这些方法使生成的响应能够完全自动化地转换为高复制偏好数据以训练CopyPasteLLM。在FaithEval、ConFiQA和PubMedQA上,CopyPasteLLM在反事实和原始上下文中均取得最佳性能,显著地在FaithEval上比最佳基线提高了12.2%至24.5%的准确率,同时仅需365个训练样本——仅为基线数据的1/50。为了阐明CopyPasteLLM的有效性,我们提出了上下文-参数复制捕获算法。有趣的是,这揭示了CopyPasteLLM在生成过程中重新校准了对内部参数知识而非外部知识的依赖。所有代码均可在https://github.com/longyongchao/CopyPasteLLM上获得。
英文摘要:
While Retrieval-Augmented Generation (RAG) enables large language models (LLMs) to generate contextually grounded responses, contextual faithfulness remains challenging as LLMs may not consistently trust provided context, leading to hallucinations that undermine reliability. We observe an inverse correlation between response copying degree and context-unfaithful hallucinations on RAGTruth, suggesting that higher copying degrees reduce hallucinations by fostering genuine contextual belief. We propose CopyPasteLLM, obtained through two-stage high-copying response preference training. We design three prompting methods to enhance copying degree, demonstrating that high-copying responses achieve superior contextual faithfulness and hallucination control. These approaches enable a fully automated pipeline that transforms generated responses into high-copying preference data for training CopyPasteLLM. On FaithEval, ConFiQA and PubMedQA, CopyPasteLLM achieves best performance in both counterfactual and original contexts, remarkably with 12.2% to 24.5% accuracy improvements on FaithEval over the best baseline, while requiring only 365 training samples -- 1/50th of baseline data. To elucidate CopyPasteLLM's effectiveness, we propose the Context-Parameter Copying Capturing algorithm. Interestingly, this reveals that CopyPasteLLM recalibrates reliance on internal parametric knowledge rather than external knowledge during generation. All codes are available at https://github.com/longyongchao/CopyPasteLLM
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。