Although large language models (LLMs) have demonstrated impressive text generation capabilities, they are easily misled by the untruthful context provided by users or knowledge augmentation tools, thereby producing hallucinations. To alleviate the LLMs from being misled by untruthful information and take advantage of knowledge augmentation, we propose Truth-Aware Context Selection (TACS), a lightweight method to shield untruthful context from the inputs. TACS begins by performing truth detection on the input context, leveraging the parameterized knowledge within the LLM. Subsequently, it constructs a corresponding attention mask based on the truthfulness of each position, selecting the truthful context and discarding the untruthful context. Additionally, we introduce a new evaluation metric, Disturbance Adaption Rate, to further study the LLMs' ability to accept truthful information and resist untruthful information. Experimental results show that TACS can effectively filter information in context and significantly improve the overall quality of LLMs' responses when presented with misleading information.
翻译:虽然大语言模型(LLMs)已展现出令人印象深刻的文本生成能力,但它们容易受到用户或知识增强工具提供的虚假上下文误导,进而产生幻觉。为减轻大语言模型被虚假信息误导的影响,同时充分利用知识增强的优势,我们提出真理感知上下文选择(TACS)——一种轻量级方法,用以屏蔽输入中的虚假上下文。TACS首先利用大语言模型内部的参数化知识对输入上下文进行真实性检测;随后,根据每个位置的真实性构建对应的注意力掩码,选择真实上下文并丢弃虚假上下文。此外,我们引入一项新评估指标——干扰适应率,以进一步研究大语言模型接纳真实信息与抵抗虚假信息的能力。实验结果表明,在面临误导信息时,TACS能有效过滤上下文中的信息,显著提升大语言模型整体响应质量。