Fine-Tuned Large Language Models for Logical Translation: Reducing Hallucinations with Lang2Logic

Muyu Pan, Dheeraj Kodakandla, Mahfuza Farooque
12/2/2025
cs.CLcs.AI

No confident code implementation found for this paper. 9 possible matches can be shown below.

Abstract

Recent advances in natural language processing (NLP), particularly large language models (LLMs), have motivated the automatic translation of natural language statements into formal logic without human intervention. This enables automated reasoning and facilitates debugging, finding loop invariants, and adhering to specifications in software systems. However, hallucinations-incorrect outputs generated by LLMs are challenging, particularly for logical translation tasks requiring precision. This work introduces a novel framework that inputs English sentences, converts them into logical expressions, and then translates them into Conjunctive Normal Form (CNF) for satisfiability solving. It employs classical NLP techniques with self-defined grammar, symbolic computation libraries, and a fine-tuned language model to reduce hallucinations. In the early experiments, we observed that the fine-tuned model, trained on different grammar settings, could intentionally correct the same types of hallucinations made by the original model. Thus, it provides reliable CNF generation.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 9 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{pan2025finetuned,
  title  = {Fine-Tuned Large Language Models for Logical Translation: Reducing Hallucinations with Lang2Logic},
  author = {Muyu Pan and Dheeraj Kodakandla and Mahfuza Farooque},
  year   = {2025},
  eprint = {2512.02987},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2512.02987v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2512.02987.svg)](https://codeofpaper.com/paper/2512.02987)

Discussion