NL2LOGIC: AST-Guided Translation of Natural Language into First-Order Logic with Large Language Models
Rizky Ramadhana Putra, Raihan Sultan Pasha Basuki, Yutong Cheng, Peng Gao

TL;DR
NL2LOGIC is a novel framework that uses an abstract syntax tree to improve the translation of natural language into first-order logic with large language models, achieving high syntactic accuracy and better semantic faithfulness.
Contribution
It introduces an AST-guided translation approach combining semantic parsing and deterministic code generation, significantly enhancing logic translation accuracy and interpretability.
Findings
Achieves 99% syntactic accuracy on benchmarks.
Improves semantic correctness by up to 30%.
Enhances downstream reasoning accuracy by 31%.
Abstract
Automated reasoning is critical in domains such as law and governance, where verifying claims against facts in documents requires both accuracy and interpretability. Recent work adopts structured reasoning pipelines that translate natural language into first-order logic and delegate inference to automated solvers. With the rise of large language models, approaches such as GCD and CODE4LOGIC leverage their reasoning and code generation capabilities to improve logic parsing. However, these methods suffer from fragile syntax control due to weak enforcement of global grammar constraints and low semantic faithfulness caused by insufficient clause-level semantic understanding. We propose NL2LOGIC, a first-order logic translation framework that introduces an abstract syntax tree as an intermediate representation. NL2LOGIC combines a recursive large language model based semantic parser with an…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
Taxonomy
TopicsTopic Modeling · Natural Language Processing Techniques · Multimodal Machine Learning Applications
