Command Palette
Search for a command to run...
LLM-기호론 정리기 증명을 통한 자연어 설명의 검증 및 정제
LLM-기호론 정리기 증명을 통한 자연어 설명의 검증 및 정제
Xin Quan Marco Valentino Louise A. Dennis André Freitas
초록
자연어 설명은 설명 기반 및 다단계 자연어 추론(Natural Language Inference, NLI) 모델을 평가하기 위한 대리 지표로 활용된다. 그러나 NLI에 대한 설명의 타당성을 평가하는 것은 일반적으로 적합한 데이터셋의 크라우드소싱을 수반하며, 이 과정은 많은 시간이 소요되고 논리적 오류에 취약하다. 본 논문은 이러한 기존 한계를 극복하기 위해 대규모 언어 모델(Large Language Model, LLM)과 정리기(Theorem Prover, TP)의 통합을 통한 자연어 설명의 검증 및 정제를 탐구한다. 구체적으로, 우리는 TP를 LLM과 통합하여 설명 문장을 생성하고 형식화하며, NLI를 위한 잠재적 추론 전략을 제시하는 신경-기호(neuro-symbolic) 프레임워크인 Explanation-Refiner를 제안한다. 이때 TP는 설명의 논리적 타당성에 대한 형식적 보증을 제공하고 이후의 개선을 위한 피드백을 생성하는 데 활용된다. 본 논문은 Explanation-Refiner가 최신 LLM의 설명적 추론 능력, 자동 형식화(autoformalisation) 성능, 오류 수정 메커니즘을 종합적으로 평가하는 데 사용될 수 있을 뿐만 아니라, 다양한 도메인에서 서로 다른 복잡도를 가진 설명의 품질을 자동으로 향상시키는 데에도 효과적으로 활용될 수 있음을 실증한다.
One-sentence Summary
Researchers at the University of Manchester, Idiap Research Institute, and collaborating institutions propose Explanation-Refiner, a neuro-symbolic framework that integrates large language models with theorem provers to verify and refine natural language explanations for NLI, providing formal guarantees of logical validity and iterative feedback to enhance explanation quality across diverse domains.
Key Contributions
-
Explanation-Refiner is a neuro-symbolic framework that combines large language models with theorem provers to generate, formalise, and iteratively refine natural language explanations for natural language inference while checking their logical validity.
-
An autoformalisation and error correction mechanism uses Neo-Davidsonian event semantics to preserve sentence-level semantic content during translation into logical forms and uses theorem prover feedback to identify and correct erroneous inference steps.
-
Experiments on textual entailment and multiple-choice question answering tasks show improved logical validity of human-annotated explanations across varying explanation complexities, supporting automated enhancement of explanatory reasoning.
Introduction
Natural Language Inference models increasingly generate explanations to make their reasoning more transparent, and those explanations can serve as evidence of whether a model has captured the needed logical steps. However, prior evaluation is limited because language generation metrics require costly and error-prone crowd-sourced explanation corpora, and those metrics often miss fine-grained properties such as logical validity, faithfulness, and robustness. Human-annotated explanations also tend to be incomplete or contain logical errors, which can bias evaluation.
The authors present Explanation-Refiner, a neuro-symbolic framework that combines large language models with a theorem prover to verify and refine natural language explanations. They use LLMs to generate and autoformalise explanatory sentences, Neo-Davidsonian event semantics with first-order logic to reduce semantic loss, and Isabelle/HOL to check deductive validity and provide feedback. In experiments, this approach improves the logical validity of explanations and reduces syntax errors from autoformalisation, revealing both the promise and limits of current LLMs for verifiable reasoning.
Dataset
-
The authors use three NLI datasets for evaluation: e-SNLI, QASC, and WorldTree.
-
The evaluation set contains 300 samples in total, selected using the sampling strategy from Valentino et al. (2021), which aims to maximize representativeness and mutual exclusivity across syntactic and semantic features in the datasets.
-
The paper casts multiple-choice question answering into an NLI setting. Each task instance includes a question q and a set of candidate answers C = {c1, c2, ..., cn}, where one candidate answer is the correct answer.
-
To convert a multiple-choice question into an NLI example, the question and the correct candidate answer are combined into a hypothesis h_i.
-
If the question includes a context, the authors use that context to construct the premise p_i for the NLI formulation.
Method
The authors propose Explanation-Refiner, a neuro-symbolic framework that verifies whether explanatory sentences for NLI tasks are logically valid and, when they are not, iteratively repairs the errors. The method treats natural-language explanations as candidate logical evidence and then uses a theorem prover as an external verifier. Given a premise pi, a hypothesis hi, and an explanation Ei, the LLM is prompted to perform autoformalisation, converting each explanatory fact f∈Ei into an axiom ai. The axioms form a set A={a1,a2,…,an}. The system then asks the theorem prover to prove a goal of the form
pi∧B→hi,where B⊆A contains the axioms needed for the entailment. Refer to the framework diagram.
The pipeline is organized around three major modules: autoformalisation, proof construction, and verification with refinement. In the first stage, the LLM translates the premise, hypothesis, and explanation into an Isabelle/HOL theory. The explanation sentences become axioms, the premise becomes assumed known propositions, and the hypothesis becomes the theorem to be proved. This converts the natural-language reasoning task into a formal deductive setting where logical validity can be checked mechanically.
To preserve semantic information from complex natural-language sentences, the authors adopt Neo-Davidsonian event semantics together with first-order logic. Instead of collapsing a sentence into a flat predicate structure, verbs are reified as event variables, and their participants are attached through semantic roles such as agent and patient. For example, a sentence describing a wolf eating a sheep as an example of predator hunting prey can be formalised as a statement in which eating and hunting are events, wolf and predator describe the agent, sheep and prey describe the patient, and an example relation connects the two events:
∀xye1(wolf(x)∧sheep(y)∧eating(e1)∧agent(e1,x)∧patient(e1,y)→∃e2(predator(x)∧prey(y)∧hunting(e2)∧agent(e2,x)∧patient(e2,y)∧example(e1,e2))).For static or descriptive statements that do not involve events, the system uses ordinary FOL forms such as
∀x(gravity(x)→force(x))and
∀xy(greater(x,y)→larger(x,y)).Because LLMs can produce syntactically invalid symbolic output, the framework includes a syntax refinement mechanism before the theorem prover attempts semantic reasoning. The theorem prover acts as a checker and returns error messages when the generated Isabelle/HOL theory cannot be parsed or type-checked. These errors are grouped into type unification errors, which arise when declared argument types do not match the actual argument types in logical clauses, and other syntax errors, such as missing brackets, undefined entity names, or invalid logical symbols. The LLM is then prompted with the generated theory, the prover error, and examples of how to repair that error type. This iterative syntax correction improves the formal encoding until the theory is structurally well formed.
After the theory is syntactically valid, the system moves to proof construction. The LLM first produces a rough inference in natural language, which serves as a preliminary proof strategy. This inference identifies which explanatory sentences are sufficient and necessary for deriving the hypothesis, and which are redundant or unrelated. Based on this preliminary reasoning, the LLM constructs formal proof steps that can be submitted to Isabelle/HOL. A typical proof step follows the schema
show X using Y by Z,where X is the target proposition, Y denotes the assumptions used, and Z is an automated proof tactic. In practice, the tactic blast is often used because it is a general Isabelle tactic for first-order logic theorem proving.
The final stage performs verification and refinement. The constructed theory, including axioms, theorem statement, and proof steps, is given to the theorem prover. If the prover succeeds, the explanation is treated as logically valid. If the proof fails or times out, the system extracts the first relevant error from the solver, locates the failed proof step, and identifies the axioms B⊆A that were applied in that step. It then removes redundant or irrelevant facts, especially those not referenced by the successful proof steps or those marked as unnecessary in the preliminary inference. The LLM receives a refined feedback package containing the error message, the failed proof step, the associated proof strategy, and the explanatory sentences corresponding to the axioms. This feedback guides the LLM to revise the original explanation Ei, correcting logical omissions, invalid inferences, or misformalised facts. The loop then repeats. With each iteration, the framework narrows the set of logical errors and progressively refines the explanatory sentences until the resulting theory is verifiable and the explanation can be regarded as logically sound.
Experiment
The experiments evaluate five LLMs on three NLI-style datasets, where explanations are formally verified and iteratively refined using an external theorem prover. The results show that prover-guided feedback consistently improves logical validity and reduces syntactic errors, with autoformalisation quality strongly influencing model performance. Stronger models, especially GPT-4, benefit most from refinement, although explanation complexity, occasional factual inaccuracies, and rare trivial explanations remain challenges.