Introduction
As Large Language Models (LLMs) are increasingly integrated into high-stakes domains such as law, medicine, and scientific research, the reliability of their reasoning processes has come under intense scrutiny. While these models often arrive at the correct final answer, their intermediate steps are frequently riddled with subtle contradictions, unsupported inferences, or "hallucinated" logic masked by polished, persuasive prose. This phenomenon—being "right for the wrong reasons"—renders traditional evaluation metrics like accuracy insufficient.
This paper introduces MATP (Multi-step Automated Theorem Proving), a framework designed to bridge the gap between unstructured natural language reasoning and the rigorous world of formal logic. By translating reasoning chains into First-Order Logic (FOL) and verifying them using automated theorem provers, MATP exposes the logical hollows within LLM outputs and distinguishes truly sound reasoning from mere linguistic pattern matching.
The Limitations of Current Verification
Existing methods for evaluating LLM reasoning fall short in three primary areas:
- Fact-checking: While effective for verifying external data, it fails to detect internal logical inconsistencies.
- Self-consistency: Majority voting can be misled by systematic errors that models repeat across multiple iterations.
- Prompt-based verification: Using one LLM to check another is often as unreliable as the reasoning it aims to judge, as the verifier inherits the same probabilistic biases as the generator.
MATP addresses these issues by moving away from probabilistic judgment toward deterministic formal verification.
The MATP Framework
The MATP pipeline consists of four distinct stages designed to provide a granular assessment of a model's logical path:
1. NL2FOL (Natural Language to First-Order Logic)
Using a high-performing model (such as GPT-4o) with specialized prompting, MATP translates premises, reasoning steps, and conclusions into formal FOL. To ensure the quality of this translation, the framework implements "Quality Assurance Strategies" that enforce consistent predicate usage and correct quantifier scoping, preventing the logic engine from failing due to linguistic ambiguity.
2. Logical Verification
The translated FOL formulas are converted into the standardized TPTP format and processed by Vampire, a state-of-the-art automated theorem prover. Vampire evaluates each individual reasoning step to determine if it is provable (logically follows from premises), refutable (contradicts premises), or indeterminate (cannot be proven or disproven).
3. Proof Path Existence
Beyond checking isolated steps, MATP searches for a "valid proof path." This is defined as a subset of correct steps that, when taken together, logically necessitate the final conclusion. This step is crucial for identifying models that reach the right answer through a series of unrelated—though individually correct—statements.
4. Fine-Grained Classification
MATP categorizes LLM outputs into a hierarchy of logical soundness:
- T1 (Ideal): Every step is correct, and a valid proof path exists.
- T2 (Robust): The model makes some errors, but a valid proof path is still present within the output.
- T3 (Accidental): All steps are individually correct, but they do not logically lead to the conclusion.
- T4 (Flawed): The steps are logically incorrect, and no valid path exists—the hallmark of a "hallucinated" proof.
- F1/F2: Categories reserved for instances where the final answer is incorrect.
Experimental Insights
The framework was evaluated on over 10,000 reasoning instances from 10 different LLMs across benchmarks like PrOntoQA-OOD, ProofWriter, and FOLIO. The results revealed several critical insights into the current state of AI reasoning:
The "Fluency Trap"
General-purpose models like GPT-3.5 and LLaMA-8B frequently fall into the "Fluency Trap." They produce reasoning that appears structurally sound to a human reader but is revealed by the ATP to be "information regurgitation" or logical shortcuts. These models often score high in T3 and T4 categories, indicating that their apparent reasoning is a byproduct of predicting likely word sequences rather than following a latent logical structure.
Specialized Reasoning Models
There is a stark divide in quality that standard accuracy scores fail to capture. Reasoning-specialized models, such as DeepSeek-R1 and QwQ-32B, consistently produce T1 chains. On the PrOntoQA benchmark, DeepSeek-R1 achieved over 96% T1 reasoning, significantly outperforming general models of similar size. This suggests that these models are actually adhering to a more rigorous internal logical framework.
Verification Superiority
MATP significantly outperformed prompting-based baselines, showing an improvement of over 42 percentage points in Macro F1-score for verifying individual reasoning steps. On a dedicated classification dataset, MATP achieved 99% accuracy in distinguishing between sound and flawed reasoning chains.
Challenges and Future Directions
While MATP represents a significant step forward, two primary bottlenecks remain:
- The Translation Gap: While NL2FOL is highly accurate for simple tasks, it struggles with complex linguistic nuances, such as the difference between "either...or" and "and/or" in human-authored datasets like FOLIO.
- Implicit Knowledge: LLMs often rely on unstated common sense (e.g., knowing that "up" is the opposite of "down"). Because MATP only verifies what is explicitly stated, it may flag sound human-like reasoning as "indeterminate" if the common-sense premise is missing.
Future work will focus on moving from linear "path existence" to reasoning graphs, allowing for more complex, non-linear debugging of LLM thought processes and the autonomous injection of background knowledge to support more naturalistic reasoning verification.
Summary updated