TL;DR
Semantic Self-Verification (SSV) is a new neuro-symbolic approach that significantly boosts the logical reasoning capabilities of Large Language Models (LLMs) by using a solver to verify their work. By generating concrete examples to test abstract logical formalizations, SSV achieves state-of-the-art accuracy on complex puzzles and provides a "verified" flag with near-100% precision, potentially automating human-in-the-loop verification for many tasks.
What Problem Does This Paper Address?
While LLMs are impressive, they frequently stumble on complex logical reasoning tasks, like those found in the LSAT. A popular solution is to have the LLM translate a natural language (NL) problem into a formal program (e.g., Python or Z3 code) that a specialized logical solver can execute.
The bottleneck is the translation gap: LLMs often make subtle semantic errors when formalizing NL constraints into abstract logic. For example, a model might accidentally use an "Exists" quantifier when a "ForAll" is required. Because natural language is informal and the target code is rigid, these small bugs lead to completely wrong answers, and users have no way of knowing if the output is trustworthy without manual checking.
Methods
The authors introduce Semantic Self-Verification (SSV), a framework that treats the LLM as both a coder and a test-case generator.
- Program Generation: The LLM translates the NL problem (like the one in Figure 1) into a formal representation, such as Z3 SMT solver code (Figure 2).
- Semantic Verification: Instead of just running the code, the LLM is prompted to generate concrete instantiations (simple "if-then" examples) for every constraint in the problem. For a constraint like "Stacy does not repair any machine Yolanda repairs," the LLM might generate a positive example ("Stacy repairs radios, Yolanda repairs TVs") and a negative one ("Stacy and Yolanda both repair TVs").
- Solver-Based Check: The logical solver then checks if the abstract formalization is consistent with these concrete examples. If the code uses the wrong quantifier (as shown in Figure 4), the solver will flag the inconsistency.
- Semantic Repair: If a check fails, the failing example is fed back to the LLM as a "semantic error" to guide it in fixing the code.
- Near-Certain Reasoning: If the code passes all checks and satisfies well-formedness properties, the system returns the answer with an
isVerified = Trueflag.
Datasets
The researchers evaluated SSV across five diverse logical reasoning benchmarks:
- AR-LSAT: Analytical reasoning questions from actual Law School Admission Tests (the most challenging).
- FOLIO: Expert-crafted real-world knowledge problems requiring first-order logic.
- LogicalDeduction: Object sequence ordering tasks from the BigBench benchmark.
- PrOntoQA: Synthetic deductive reasoning tasks.
- ProofWriter: Implications and proofs over natural language.
Key Insights and Ideas
- Concrete vs. Abstract: LLMs are much better at generating simple, concrete examples of a rule than they are at writing the abstract rule itself in code. SSV leverages this strength to verify the harder task.
- Consistency as Truth: The core idea is akin to a "consensus-based ensemble." By checking if two independent outputs from the LLM (the abstract code and the concrete examples) agree through the lens of a logical solver, the system can filter out hallucinations.
- Reducing Human Effort: By providing a high-confidence
isVerifiedsignal, the system can automate the "easy" cases, allowing humans to focus only on the complex ones where the AI couldn't verify its own logic.
Key Results
SSV sets a new high bar for logical reasoning in AI:
- Accuracy Leap: On the difficult AR-LSAT dataset, SSV achieved 71.3% accuracy, a massive jump from the previous state-of-the-art (Logic-LM) at 43%, and even surpassing the average human performance of 59.7%.
- Perfect Precision: When using GPT-4, the "verified" flag had 100% precision on AR-LSAT, FOLIO, and LogicalDeduction. If the system said it was sure, it was right.
- Significant Coverage: The system was able to verify 21.7% of the hardest cases and over 75% of the cases in easier datasets like ProofWriter.
Limitations and Future Work
- Ambiguity: Natural language is inherently ambiguous. Verification proves consistency, not necessarily that the AI interpreted a vague sentence exactly as a human would.
- Insufficient Examples: Currently, the system only generates one positive and one negative example per constraint. This might miss "corner cases" where the logic fails.
- Model Sensitivity: The precision and coverage drop when using weaker models like GPT-3.5, suggesting that the quality of the underlying LLM is still a critical factor.
- Future Directions: The authors suggest exploring more exhaustive example generation strategies and applying this consistency-based verification to other domains like mathematical proofs or automated planning.
Summary updated