Abstract
Large Language Models (LLMs) have shown human-like reasoning abilities but still struggle with complex logical problems. This paper introduces a novel framework, Logic-LM, which integrates LLMs with symbolic reasoning to improve logical problem-solving. Our method first utilizes LLMs to translate a natural language problem into a symbolic formulation. Afterward, a deterministic symbolic solver performs inference on the formulated problem. We also introduce a self-refinement stage, which utilizes the symbolic solver's error messages to revise symbolic formalizations. We demonstrate Logic-LM's effectiveness on four logical reasoning datasets: ProofWriter, PrOntoQA, FOLIO, and LogicalDeduction. Our results show significant improvement compared to LLMs alone, with an average performance boost of 62.6% over standard prompting and 23.5% over chain-of-thought prompting. Our findings suggest that Logic-LM, by combining LLMs with symbolic logic, offers a promising avenue for faithful logical reasoning.
Introduction
While Large Language Models (LLMs) like GPT-4 are surprisingly adept at mimicking human conversation, they frequently stumble on complex logical puzzles. A common failure mode is "unfaithful reasoning": the model generates a plausible-looking "Chain-of-Thought" (CoT), but the final conclusion does not actually follow from the steps provided.
Because LLMs are fundamentally probabilistic next-token predictors, they lack a formal mechanism to guarantee that their reasoning adheres to the laws of logic. In contrast, symbolic solvers—such as those used in formal mathematics or circuit design—are 100% faithful and transparent, but they cannot interpret natural language. Logic-LM addresses this gap by using the LLM as a translator and the symbolic solver as the reasoning engine.
The Logic-LM Framework
Logic-LM is a neuro-symbolic framework that decomposes logical problem-solving into four distinct stages:
- Problem Formulator: Instead of solving the problem directly, the LLM is prompted to translate the natural language description into a formal symbolic representation. The framework supports multiple logic types, including Logic Programming (LP) for deductive reasoning, First-Order Logic (FOL) for complex quantification, Constraint Satisfaction (CSP) for arrangement problems, and Satisfiability (SAT) for analytical reasoning.
- Symbolic Reasoner: A deterministic external solver (such as Pyke, Prover9, or Z3) takes the symbolic code and executes the inference. This ensures the reasoning process is mathematically sound and verifiable.
- Self-Refinement: If the solver returns a syntax or execution error, the LLM is prompted with the error message to "debug" and revise its symbolic formulation. This iterative loop significantly increases the executable rate of the generated logic.
- Result Interpreter: The solver's output (e.g., "True," "Unsatisfiable," or a specific variable assignment) is translated back into a natural language answer for the user.
Experimental Evaluation
The framework was evaluated on five diverse logical reasoning benchmarks: ProofWriter and PrOntoQA (multi-hop deductive reasoning), FOLIO (first-order logic), LogicalDeduction (constraint-based ordering), and AR-LSAT (analytical reasoning from the Law School Admission Test).
Key Insights
- Representation vs. Reasoning: LLMs are often better at representing problems than solving them. By shifting the burden of execution to a symbolic engine, the LLM can focus on its strength: mapping ambiguous natural language to structured data.
- Robustness to Depth: In standard LLM reasoning, accuracy drops precipitously as the number of reasoning "hops" increases. Logic-LM is remarkably robust; once a problem is correctly formulated, the symbolic solver handles five hops as easily as one.
- The Compiler Feedback Loop: The self-refinement module mimics a human programmer. By treating the symbolic solver as a compiler that provides error messages, the LLM can iteratively correct its own translation errors.
Results
Logic-LM demonstrated a significant performance leap across all benchmarks:
- Average Improvement: The framework outperformed standard prompting by 39.2% and Chain-of-Thought (CoT) by 18.4% across the tested datasets.
- GPT-4 Synergy: When using GPT-4 as the base model, Logic-LM achieved nearly 90% accuracy on LogicalDeduction and significantly boosted performance on the challenging AR-LSAT (improving from ~35% with CoT to 43%).
- Scalability: On the ProofWriter dataset, as reasoning depth increased to 5+ hops, Logic-LM maintained high accuracy while CoT performance collapsed.
Conclusion and Future Work
Logic-LM demonstrates that integrating LLMs with symbolic solvers provides a more faithful and scalable approach to logical reasoning than relying on LLMs alone. However, the framework is currently limited by the expressiveness of the supported symbolic languages and the LLM's ability to translate natural language perfectly. Future work will explore integrating Statistical Relational Learning (SRL) to handle uncertainty and probabilistic reasoning, potentially allowing the system to tackle more ambiguous, real-world scenarios where logic is not strictly binary.
Summary updated