ART:通过注意力替换技术提升大语言模型的事实性
ART: Attention Replacement Technique to Improve Factuality in LLMs
AI总结:
本文提出ART技术,通过替换大语言模型浅层的均匀注意力模式为局部注意力模式,减少幻觉问题,适用于多种LLM架构。
摘要:
大语言模型(LLMs)中的幻觉问题仍然是一个重要挑战,特别是在问答任务中,模型常生成看似合理但错误或不相关的信息。尽管已有多种方法试图缓解幻觉,但注意力模式与幻觉之间的关系尚未完全探讨。本文分析了LLMs各层和注意力头的注意力分数分布,揭示了一个共同且引人注目的现象:浅层LLMs主要依赖于均匀的注意力模式,即模型在整个序列上均匀分布注意力。这种均匀的注意力模式可能导致幻觉,因为模型未能聚焦于最相关的信息。为缓解此问题,我们提出了一种无需训练的注意力替换技术(ART),该技术将浅层的均匀注意力模式替换为局部注意力模式。这种改变使模型更关注相关上下文,从而减少幻觉。通过广泛的实验,ART在多种LLM架构上显著减少了幻觉,证明了其有效性及泛化能力,无需微调或额外训练数据。
英文摘要:
Hallucination in large language models (LLMs) continues to be a significant issue, particularly in tasks like question answering, where models often generate plausible yet incorrect or irrelevant information. Although various methods have been proposed to mitigate hallucinations, the relationship between attention patterns and hallucinations has not been fully explored. In this paper, we analyze the distribution of attention scores across each layer and attention head of LLMs, revealing a common and intriguing phenomenon: shallow layers of LLMs primarily rely on uniform attention patterns, where the model distributes its attention evenly across the entire sequence. This uniform attention pattern can lead to hallucinations, as the model fails to focus on the most relevant information. To mitigate this issue, we propose a training-free method called Attention Replacement Technique (ART), which replaces these uniform attention patterns in the shallow layers with local attention patterns. This change directs the model to focus more on the relevant contexts, thus reducing hallucinations. Through extensive experiments, ART demonstrates significant reductions in hallucinations across multiple LLM architectures, proving its effectiveness and generalizability without requiring fine-tuning or additional training data.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。