用代码引导知识图谱,减少大模型因提示词产生的幻觉。
Mitigating Prompt-Induced Hallucinations in Large Language Models via Structured Reasoning
- 引入代码模块引导知识图谱探索,增强推理结构化。
- 在多个数据集上提升命中率,HIT@1最高达95%以上。
- 适合需要高准确性和可验证性的问答与推理任务。
为缓解大语言模型中的幻觉问题,本文提出一种减轻提示词诱发幻觉的方法。基于知识蒸馏链式模型,引入代码模块引导知识图谱探索,并将代码作为思维链提示的一部分,形成外部知识输入,为模型提供更准确、结构化的信息。在此设计基础上,构建改进的知识蒸馏链式模型,用于分析和约束大语言模型的推理过程,从而提升推理准确性。我们在GPT-4和LLaMA-3.3上对所提方法进行了多数据集实证评估。实验结果表明,引入代码模块显著增强了模型捕捉上下文信息的能力,有效缓解了提示词诱发的幻觉。具体而言,HIT@1、HIT@3和HIT@5分别提升15.64%、13.38%和13.28%。此外,该方法在多个评估设置下达到超过95%的HIT@1、HIT@3和HIT@5分数。结果表明,该方法大幅降低幻觉行为,同时提升大语言模型的准确性和可验证性。
原文摘要 · Abstract (English)
To address hallucination issues in large language models (LLMs), this paper proposes a method for mitigating prompt-induced hallucinations. Building on a knowledge distillation chain-style model, we introduce a code module to guide knowledge-graph exploration and incorporate code as part of the chain-of-thought prompt, forming an external knowledge input that provides more accurate and structured information to the model. Based on this design, we develop an improved knowledge distillation chain-style model and leverage it to analyze and constrain the reasoning process of LLMs, thereby improving inference accuracy. We empirically evaluate the proposed approach using GPT-4 and LLaMA-3.3 on multiple public datasets. Experimental results demonstrate that incorporating code modules significantly enhances the model's ability to capture contextual information and effectively mitigates prompt-induced hallucinations. Specifically, HIT@1, HIT@3, and HIT@5 improve by 15.64%, 13.38%, and 13.28%, respectively. Moreover, the proposed method achieves HIT@1, HIT@3, and HIT@5 scores exceeding 95% across several evaluation settings. These results indicate that the proposed approach substantially reduces hallucination behavior while improving the accuracy and verifiability of large language models.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。