KDCM: Reducing Hallucination in LLMs through Explicit Reasoning Structures
Jinbo Hao, Kai Yang, Qingzhen Su, Yifan Li, Chao Jiang
TL;DR
This paper tackles prompt-induced hallucinations in large language models by augmenting a knowledge distillation chain with a programmable code-guided reasoning module that leverages external structured knowledge like knowledge graphs. The enhanced framework constrains intermediate reasoning steps, improving robustness, interpretability, and prediction accuracy for multi-step tasks. Experiments with GPT-4 and LLaMA-3.3 show substantial gains in HIT@1, HIT@3, and HIT@5, with many results exceeding 95%, indicating a strong reduction in hallucinations while maintaining model flexibility. The approach promises safer, more reliable reasoning in complex domains, though it introduces higher inference cost and requires access to suitable external knowledge resources; future work includes extending to multimodal reasoning and integration with retrieval and reinforcement learning strategies.
Abstract
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.
