arXiv:2601.04086cs.CL2026-01被引 1

用可执行代码引导推理,减少大模型幻觉。

KDCM: Reducing Hallucination in LLMs through Explicit Reasoning Structures

  • 在推理提示中嵌入可执行代码模块,引导模型使用外部知识图谱。
  • 相比基线,命中率在多个设置中提升超13%,最高达95%以上。
  • 适合需要高可信推理的场景,如医疗、金融等专业领域。

为缓解大语言模型中的幻觉问题,本文提出一种聚焦于提示引发错误的框架。方法通过扩展链式知识蒸馏,引入可编程模块以指导知识图谱探索。该模块以可执行代码形式嵌入推理提示,使模型在推理时能利用外部结构化知识。基于此设计,构建了增强型蒸馏推理框架,显式调控中间推理步骤,提升预测可靠性。在GPT-4和LLaMA-3.3上对多个公开基准进行评估,结果表明代码引导推理显著改善上下文建模能力并降低提示诱导幻觉。具体而言,HIT@1、HIT@3和HIT@5分别提升15.64%、13.38%和13.28%,多个评估场景下得分超过95%。结果表明该方法有效抑制错误推理,同时提升准确率与可解释性。

原文摘要 · Abstract (English)

To mitigate hallucinations in large language models (LLMs), we propose a framework that focuses on errors induced by prompts. Our method extends a chain-style knowledge distillation approach by incorporating a programmable module that guides knowledge graph exploration. This module is embedded as executable code within the reasoning prompt, allowing the model to leverage external structured knowledge during inference. Based on this design, we develop an enhanced distillation-based reasoning framework that explicitly regulates intermediate reasoning steps, resulting in more reliable predictions. We evaluate the proposed approach on multiple public benchmarks using GPT-4 and LLaMA-3.3. Experimental results show that code-guided reasoning significantly improves contextual modeling and reduces prompt-induced hallucinations. Specifically, HIT@1, HIT@3, and HIT@5 increase by 15.64%, 13.38%, and 13.28%, respectively, with scores exceeding 95% across several evaluation settings. These findings indicate that the proposed method effectively constrains erroneous reasoning while improving both accuracy and interpretability.

大模型幻觉抑制推理结构知识图谱

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。