LoRP: LLM-based Logical Reasoning via Prolog
•We propose LoRP, a hybrid reasoning framework combining LLMs and Prolog.•A systematic FOL-to-Prolog translation mechanism extends Prolog’s expressiveness.•LoRP decouples language understanding and symbolic inference via four reasoning stages.•Extensive experiments show LoRP achieves state-of-the-ar...
Gespeichert in:
| Veröffentlicht in: | Knowledge-based systems Jg. 327; S. 114140 |
|---|---|
| Hauptverfasser: | , , , , |
| Format: | Journal Article |
| Sprache: | Englisch |
| Veröffentlicht: |
Elsevier B.V
09.10.2025
|
| Schlagworte: | |
| ISSN: | 0950-7051 |
| Online-Zugang: | Volltext |
| Tags: |
Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
|
| Zusammenfassung: | •We propose LoRP, a hybrid reasoning framework combining LLMs and Prolog.•A systematic FOL-to-Prolog translation mechanism extends Prolog’s expressiveness.•LoRP decouples language understanding and symbolic inference via four reasoning stages.•Extensive experiments show LoRP achieves state-of-the-art accuracy and robustness.•LoRP improves deep logical reasoning and generalizes well across LLM architectures.
Enhancing the logical reasoning capabilities of large language models (LLMs) is crucial for advancing LLMs’s applications in complex problem-solving contexts. Neurosymbolic programming-based approaches have demonstrated significant advantages in logical reasoning. Prolog is a high-level declarative programming language based on formal logic, well-suited for handling complex deductive reasoning tasks. However, its strict syntactic structure imposes inherent limitations on expressiveness, making it difficult to represent certain common logical constructs found in natural language. Since first-order logic (FOL) is the most fundamental formal language for logical semantic representation, we take it as a reference for analysis and find that even some of its most basic structures cannot be directly expressed in Prolog. To address this, we propose a systematic translation mechanism from FOL to Prolog, thereby extending Prolog’s expressiveness to support richer logical representations. Building on this foundation, we propose LoRP (LLM-based Logical Reasoning via Prolog), a novel framework that utilizes LLMs to convert natural language queries into Prolog code, and delegates reasoning to the external SWI-Prolog interpreter. This hybrid architecture combines the formal rigor of symbolic logic with the flexibility of LLMs, enabling precise, interpretable, and verifiable reasoning. Empirical evaluations demonstrate that LoRP significantly improves LLMs’ reasoning performance, particularly as inference depth increases. It also exhibits strong generalization and stability across various model architectures. These findings highlight the potential of symbolic-neural integration as a promising direction for advancing the logical reasoning capabilities of LLMs. |
|---|---|
| ISSN: | 0950-7051 |
| DOI: | 10.1016/j.knosys.2025.114140 |