Large language models (LLMs) have demonstrated impressive language understanding and generation capabilities, enabling them to answer a wide range of questions across various domains. However, these models are not flawless and often produce responses that contain errors or misinformation. These inaccuracies, commonly referred to as hallucinations, render LLMs unreliable and even unusable in many scenarios. In this paper, our focus is on mitigating the issue of hallucination in LLMs, particularly in the context of question-answering. Instead of attempting to answer all questions, we explore a refusal mechanism that instructs LLMs to refuse to answer challenging questions in order to avoid errors. We then propose a simple yet effective solution called Learn to Refuse (L2R), which incorporates the refusal mechanism to enable LLMs to recognize and refuse to answer questions that they find difficult to address. To achieve this, we utilize a structured knowledge base to represent all the LLM's understanding of the world, enabling it to provide traceable gold knowledge. This knowledge base is separate from the LLM and initially empty. It can be filled with validated knowledge and progressively expanded. When an LLM encounters questions outside its domain, the system recognizes its knowledge scope and determines whether it can answer the question independently. Additionally, we introduce a method for automatically and efficiently expanding the knowledge base of LLMs. Through qualitative and quantitative analysis, we demonstrate that our approach enhances the controllability and reliability of LLMs.
翻译:大型语言模型(LLMs)展现出惊人的语言理解与生成能力,能够回答涵盖多个领域的海量问题。然而,这些模型并非完美无缺,其生成的回答常包含错误或虚假信息。这些不准确性(通常称为“幻觉”)使得LLMs在许多场景中不可靠甚至无法使用。本文聚焦于缓解LLMs中的幻觉问题,特别是在问答场景下。我们提出一种拒绝机制,指导LLMs避免回答具有挑战性的问题以规避错误,而非试图回答所有问题。进而提出一种简单有效的解决方案——L2R(学习拒绝),通过融入拒绝机制使LLMs能够识别并拒绝回答其难以处理的问题。为此,我们利用结构化知识库完整表示LLMs对世界的理解,使其能够提供可追溯的金标知识。该知识库独立于LLMs且初始为空,可逐步填充已验证的知识并动态扩展。当LLMs遇到领域外问题时,系统可识别其知识范围并判断能否独立作答。此外,我们引入一种自动高效扩展LLMs知识库的方法。通过定性与定量分析,证明该方法显著提升了LLMs的可控性与可靠性。