Enhancing Logical Reasoning in Large Language Models through Symbolic Logic Integration to Reduce Hallucinated Outputs
Abstract
Large Language Models (LLMs) often produce outputs that are inconsistent with their internal reasoning. For example, the same query can produce different answers across multiple runs, and complex reasoning often yields logically inconsistent results. This paper studies whether the addition of symbolic reasoning to LLMs can reduce hallucinations. We tested this hypothesis by building a symbolic pipeline into an LLM using Prolog. We built two benchmark datasets of 90 queries for two novel domains (academic relations and business operations). The symbolic pipeline in Prolog achieved an average accuracy rate of 94.0% compared to 83.3% for baseline LLM responses (GPT-4, Google Gemini, and Anthropic). The findings of this research show that symbolic reasoning in LLMs improves accuracy on structured logical queries.