Introduction
Large Language Models (LLMs) often struggle with multi-hop logical deduction. While solver-augmented systems attempt to bridge this gap by using LLMs as parsers for external symbolic solvers, these pipelines are frequently undermined by parsing errors. This paper introduces LoGiPT, a method that trains LLMs to directly emulate the internal reasoning traces of symbolic solvers. By internalizing the logic engine, LoGiPT achieves state-of-the-art performance on complex deductive benchmarks, outperforming even GPT-4.
The Challenge: The Brittle Parsing Wall
Current state-of-the-art approaches for logical reasoning typically rely on solver-augmented LMs. In these systems, an LLM parses natural language (NL) into symbolic logic (SL), which is then processed by an external theorem prover (e.g., a Prolog engine). However, this architecture is inherently brittle. A single syntax error in the LLM's output can cause the external solver to fail entirely. Empirical observations show that some models achieve success rates as low as 17% on these parsing tasks, leading to a complete breakdown in reasoning. Furthermore, reasoning purely in natural language often results in unfaithful logic chains or hallucinations.
Methodology: Internalizing the Solver
To address these limitations, the researchers developed LoGiPT. Instead of treating the symbolic solver as an external tool, LoGiPT is fine-tuned to "be" the solver by mimicking its internal execution traces.
The development of LoGiPT involves three key stages:
- Revealing the Solver Trace: The team modified the
pykelogic programming tool to output its "hidden" reasoning steps, such as variable binding ("Bind $x$ to 'Dave'") and rule application. - Instruction Tuning: A dataset of over 40,000 four-turn conversations was constructed. These conversations guide the model through defining predicates, parsing context into facts and rules, generating a full symbolic reasoning trace, and finally answering a specific query.
- Model Training: Open-source models, specifically Vicuna-13B and CodeLlama-13B, were fine-tuned on this "solver-distilled" data. This process allows the model to internalize strict logical syntax while retaining the flexibility of a neural network.
Experimental Setup and Datasets
LoGiPT was evaluated on two rigorous deductive reasoning benchmarks:
- ProofWriter: Tests up to 5-hop reasoning under an Open-World Assumption (True, False, or Unknown).
- PrOntoQA: A synthetic dataset focusing on pure logical structure under a Closed-World Assumption (True or False).
Results and Discussion
LoGiPT demonstrated significant improvements over existing baselines, effectively bypassing the "parsing wall" that plagues tool-augmented systems.
Key findings include:
- Superiority over GPT-4: On the ProofWriter benchmark, LoGiPT (CodeLlama-13B) achieved 89.50% accuracy, notably higher than the GPT-4-powered LogicLM system (79.66%).
- Process vs. Output Distillation: The study found that distilling the process of a solver is far more effective than distilling only its outputs. Grounding the model in formal "Bind" and "Unbind" actions significantly improved reasoning fidelity.
- Symbolic vs. Natural Language: Replacing symbolic reasoning steps with natural language equivalents caused performance to plummet (e.g., from 89% to 52% on ProofWriter), confirming that symbolic representations are superior for complex deduction.
Conclusion
LoGiPT represents a shift in how we approach logical reasoning in LLMs. By training models to internalize the mechanics of symbolic solvers, we can create systems that are both more robust and more capable than those relying on external tool-calling. While future work is needed to expand rule diversity and explore backward-chaining, LoGiPT proves that 13B-parameter models can dominate much larger closed-source counterparts when specialized in the language of deduction.
Summary updated