Design and Evaluation of NeuroSymbolic Translation Models and Algorithms Used to Formalize Natural Language into Formal Logic
2026 (English)Independent thesis Advanced level (degree of Master (One Year)), 20 credits / 30 HE credits
Student thesisAlternative title
Design och utvärdering av neuro-symboliska översättningsmodeller och algoritmer som används för att formalisera naturligt språk till formell logik (Swedish)
Abstract [en]
Large Language Models hallucinate, which is a known phenomenon. While hallucination is not something that can be removed entirely, a neuro-symbolic approach can minimize hallucination-based problems, by combining formal paradigms with Large Language Models. This combination leads to easier pinpointing of errors that can occur, as well as LLM hallucinations becoming less likely to cause silent issues. The thesis tackles the idea of translating natural language into formal paradigms, so that the translation can then be used by a sound solver. This approach makes it so that the LLM based issues can only be present in the translation step, which makes the reasoning step always correct, with respect to the translation. For the aforementioned translation, a front-end/back-end prototype was created, in which three pipelines were implemented. The pipelines that were implemented were: CFG-Pipeline, EG-Pipeline and LLM-Pipeline. The CFG-Pipeline uses feature-context-free grammar for parsing. The EG-Pipeline also uses feature-context-free grammar for parsing but it can be extended by using an LLM to generate grammar code. The LLM-Pipeline translates the language directly, where no grammar is used in translating. All pipelines can use a sound SWI-Prolog solver, where the LLM-Pipeline can also use Clingo, which is a sound solver for ASP. The LLM that was used in this project was Gemini-3.1-Pro-Preview. The results for the CFG-Pipeline testing showed that the built system struggled with Adjuncts, which are optional modifiers that can be removed without breaking a sentence. Out of the 20 sentences tested for the CFG-Pipeline, 15 got parsed. For the EG-Pipeline, 15 sentences were tested, where Individual Extension produced better results than Batch Extension. The LLM-Pipeline was tested on 5 puzzles; SWI-Prolog did as well as or outperformed ASP on all puzzles. The puzzles were also tested with the LLM-Method (LLM solves the puzzles directly), which outscored the LLM-Pipeline for ASP but not for SWI-Prolog. Where the LLM-Pipeline shines over the LLM-Method is traceability and verifiability. This is the case because the reasoning step is never wrong with the LLM-Pipeline, with regards to the translation, which can not be ensured for the LLM-Method.
Abstract [sv]
"Large Language Models" hallucinerar, vilket är ett känt fenomen. Även om hallucinationer inte är något som kan tas bort helt, kan en neurosymbolisk metod minimera hallucinationsbaserade problem genom att kombinera "formal paradigms" med "Large Language Models". Denna kombination leder till enklare identifiering av fel som kan uppstå, samt att LLM-hallucinationer blir mindre benägna att orsaka "silent issues". Arbetet utforskar idén att översätta naturligt språk till "formal paradigms", så att översättningen sedan kan användas av en "sound solver". Denna metod gör att de tidigare nämnda LLM-baserade problemen endast kan finnas i översättningssteget, vilket gör att resonemangssteget alltid är korrekt med avseende på översättningen. För den ovannämnda översättningen skapades en front-end/back-end-prototyp, där tre pipelines implementerades. De pipelines som implementerades var: CFG-Pipeline, EG-Pipeline och LLM-Pipeline. CFG-Pipeline använder "feature-context-free grammar" för parsning. EG-Pipeline använder också "feature-context-free grammar" för parsning men den kan utökas genom att använda en LLM för att generera grammatikkod. LLM-Pipeline översätter språket direkt, där ingen grammatik används vid översättning. Alla pipelines kan använda en "sound SWI-Prolog solver", medan LLM-Pipeline också kan använda Clingo, vilket är en "sound solver" för ASP. LLM:en som användes i detta projekt var Gemini-3.1-Pro-Preview. Resultaten för CFG-Pipeline-testningen visade att det byggda systemet hade problem med Adjuncts, vilka är valfria modifierare som kan tas bort utan att en mening bryts. Av de 20 meningarna som testades för CFG-Pipeline parsades 15. För EG-Pipeline testades 15 meningar, där Individual Extension gav bättre resultat. LLM-Pipeline testades på 5 pussel; SWI-Prolog gav lika bra eller bättre resultat än ASP för alla pussel. Pusslen testades också med LLM-metoden (LLM löser pusslen direkt), vilket gav bättre resultat än LLM-Pipeline för ASP men inte för SWI-Prolog. Spårbarhet och verifierbarhet är vart LLM-Pipeline har sina styrkor över LLM-Metoden. Detta är fallet eftersom resonemangssteget aldrig kan vara fel med hänsyn till översätningen, vilket inte kan vara säkerställt med LLM-Metoden.
Place, publisher, year, edition, pages
2026. , p. 51
Keywords [en]
Answer Set Programming (ASP), SWI-Prolog, LLM, Neuro-Symbolic, AI, Language, Formal Paradigm
Keywords [sv]
Answer Set Programming (ASP), SWI-Prolog, LLM, Neuro-Symbolisk, AI, Språk, Formal Paradigm
National Category
Other Engineering and Technologies
Identifiers
URN: urn:nbn:se:liu:diva-228046ISRN: LiU-ITN-TEK-A--26/062--SEOAI: oai:DiVA.org:liu-228046DiVA, id: diva2:2105134
Subject / course
Computer Engineering
Supervisors
Examiners
2026-09-252026-09-252026-09-25Bibliographically approved