[KongchangAI]
· 2 min read· 1,230 words

FOL-Proof: Verifying LLM Logical Translations with Deterministic Semantics

FOL-Proof: Verifying LLM Logical Translations with Deterministic Semantics

FOL-Proof builds a semantic firewall for LLM logical translation using deterministic semantic analysis and SMT equivalence checking.

FOL-Proof is a "semantic firewall" pipeline for verifying LLM-generated first-order logic (FOL) translations. It uses the English Resource Grammar (ERG) and Minimal Recursion Semantics (MRS) to deterministically generate candidate logical forms, then uses an SMT solver to check logical equivalence with the LLM output. It conservatively abstains when uncertain, achieving near-perfect selective accuracy on ProofWriter, RuleTaker, PrOntoQA, and the LongFaithCheck benchmark, significantly outperforming LLM judge and round-trip translation baselines.

Large language models (LLMs) are increasingly used to translate natural language statements into first-order logic (FOL) to enhance reasoning capabilities. However, LLMs are prone to errors, and a semantically unfaithful FOL formula can break downstream reasoning. To address this, researchers propose FOL-Proof, a semantic firewall pipeline that verifies LLM-generated FOL translations through independently derived linguistic interpretations.

FOL-Proof paper title

Why do we need to verify LLM logical translations?

LLMs perform well on logical translation tasks, but their outputs are not always reliable. Even a subtle semantic deviation can cause an entire reasoning chain to reach a wrong conclusion. Traditional verification methods, such as directly having another LLM act as a judge (LLM judge) or performing round-trip translation, often fail to capture deep logical inconsistencies. FOL-Proof emerged precisely to solve this pain point: instead of relying on another potentially error-prone LLM, it uses deterministic semantic analysis tools to build a trustworthy verification baseline.

LLM-as-a-judge (LLM judge) refers to the practice of having another large language model assess the quality of candidate outputs. It is widely used for evaluation because it is flexible and requires no training. But its fundamental limitation is that the judge model and the generator model share similar pretraining distributions and failure modes, making the judge prone to being "blind" to subtle but critical semantic deviations; moreover, judgments are heavily influenced by prompt wording and lack reproducibility.

Round-trip translation verification translates the generated FOL formula back into natural language and compares it with the original sentence. This method can catch some obvious errors but is insensitive to logical structure—two semantically different formulas may be paraphrased into natural language sentences with similar wording, thereby masking deeper inconsistencies. The reason FOL-Proof emphasizes "independently derived linguistic interpretations" is precisely that both of the above baselines lack a truly independent basis for judgment, whereas the combination of ERG/MRS and SMT provides deterministic cross-validation that does not depend on probabilistic models.

How FOL-Proof works: the semantic firewall

The core of FOL-Proof is a three-step pipeline:

1. Deterministically generating candidate translations

FOL-Proof first uses semantic analysis tools such as the English Resource Grammar (ERG) and Minimal Recursion Semantics (MRS) to deterministically generate a set of candidate logical forms from natural language statements. These tools are based on rigorous linguistic theory and can provide interpretable, non-probabilistic parsing results.

The English Resource Grammar (ERG) is one of the broadest-coverage computational grammars of English, built on the Head-driven Phrase Structure Grammar (HPSG) framework and long maintained by the DELPH-IN consortium. It encodes English syntactic rules and lexical information into a unified constraint system, performing deep syntactic and semantic analysis of input sentences.

Minimal Recursion Semantics (MRS) is the semantic representation format output by ERG. It characterizes sentence meaning in a flat, underspecified way: semantic predicates are given as a list, and scope relations are expressed using handles and labeled constraints, thereby avoiding premature choices about scope ambiguities such as quantifiers and negation. A natural language sentence parsed by ERG typically yields multiple MRS representations, corresponding to different syntactic or semantic ambiguity readings. MRS itself is not an FOL formula; it requires further conversion (e.g., solving MRS constraints into a concrete logical form) to obtain FOL candidates suitable for reasoning. This property of being "grammar-driven with ambiguities explicitly preserved" is precisely the foundation that enables FOL-Proof to enumerate candidate logical forms deterministically.

2. Logical equivalence checking with an SMT solver

For each candidate translation, FOL-Proof invokes an SMT (Satisfiability Modulo Theories) solver to check whether it is logically equivalent to the LLM-generated FOL formula. If a candidate translation is logically equivalent to the LLM's output, that translation is considered faithful and accepted; otherwise, it is rejected, or optionally repaired through repeated LLM calls.

An SMT (Satisfiability Modulo Theories) solver is a generalization of SAT solvers to背景 theories (such as integer arithmetic, arrays, bit-vectors, uninterpreted functions, etc.): it determines whether a set of first-order logic formulas is satisfiable under specific theories. In the context of FOL-Proof, logical equivalence checking is typically implemented via proof by contradiction—transforming the equivalence of two formulas into checking whether their "exclusive or" is unsatisfiable, i.e., handing the case where "one is true and the other is false" to the solver for judgment. If that case is unsatisfiable, the two formulas are logically equivalent.

It should be noted that the satisfiability of first-order logic (especially with quantifiers) is generally undecidable, and SMT solvers may return "unknown" rather than a definite true/false. This is precisely the technical motivation for FOL-Proof's abstention mechanism: when the solver cannot give a definite answer within resource limits, the system conservatively chooses to abstain rather than mistaking "unknown" for "not equivalent."

3. Conservative abstention mechanism

FOL-Proof is designed to be conservative: when the search is incomplete, unsupported syntactic structures are encountered, or the check result is uncertain, the system chooses abstention rather than incorrectly rejecting a potentially correct translation. This conservatism ensures that the verification process does not introduce new errors.

The advantage of this approach is that it does not rely on LLM self-evaluation but instead provides cross-validation through independent, deterministic semantic analysis. Compared with directly using an LLM judge or round-trip translation baselines, FOL-Proof achieves near-perfect selective accuracy.

Experimental evaluation: performance on benchmarks and adversarial tests

The researchers evaluated FOL-Proof on several established benchmarks, including ProofWriter, RuleTaker, and PrOntoQA, and also introduced a new adversarial benchmark, LongFaithCheck. Experimental results show that FOL-Proof performs excellently across these tests, achieving near-perfect selective accuracy, while the direct LLM judge and round-trip translation baselines perform significantly worse.

This result highlights the value of deterministic semantic verification in logical translation tasks. Especially in adversarial scenarios, where LLMs may be misled or produce subtle errors, FOL-Proof's conservative strategy can effectively avoid false acceptance or rejection.

Implications and outlook

FOL-Proof represents an important attempt to introduce formal verification methods into LLM reasoning pipelines. It does not seek to replace LLMs but serves as a safety layer that ensures LLM outputs are logically reliable. This approach has potentially significant implications for application scenarios requiring high trustworthiness, such as legal reasoning and medical diagnosis assistance.

Future work may further expand the range of syntactic structures supported by FOL-Proof and explore how to integrate it into more complex reasoning systems. As LLMs are applied ever more deeply in critical domains, the demand for such verification tools will only grow.

One-line Summary

FOL-Proof builds a semantic firewall for LLM logical translation using deterministic semantic analysis and SMT equivalence checking.

Paragraph Summary

FOL-Proof is a "semantic firewall" pipeline for verifying first-order logic (FOL) translations generated by large language models. To address the problem that LLM translations may be semantically unfaithful and thereby break downstream reasoning, it does not rely on another potentially error-prone LLM judge. Instead, it first uses the English Resource Grammar (ERG) and Minimal Recursion Semantics (MRS) to deterministically generate candidate logical forms, then uses an SMT solver to check each one for logical equivalence with the LLM output: if an equivalent candidate exists, it is accepted; otherwise, it is rejected or optionally repaired. The system conservatively abstains when the search is incomplete, the grammar is unsupported, or the check is uncertain, avoiding false rejections. On ProofWriter, RuleTaker, PrOntoQA, and the new adversarial benchmark LongFaithCheck, FOL-Proof achieves near-perfect selective accuracy, significantly outperforming LLM judge and round-trip translation baselines, and can serve as a trustworthy verification layer for high-reliability reasoning scenarios.

#FOL-Proof#first-order logic#LLM verification#SMT solver#semantic firewall#logical translation#ERG#MRS#ProofWriter
Share:

Related articles