Integrating Expert Knowledge into Logical Programs via LLMs

Franciszek Górski, Oskar Wysocki, Marco Valentino, Andre Freitas
2/17/2025
cs.AIcs.CLcs.MA

No official code found. Best implementation: Franek18/ExKLoP (4 stars, last commit 2025-09-02).

Abstract

This paper introduces ExKLoP, a novel framework designed to evaluate how effectively Large Language Models (LLMs) integrate expert knowledge into logical reasoning systems. This capability is especially valuable in engineering, where expert knowledge-such as manufacturer-recommended operational ranges-can be directly embedded into automated monitoring systems. By mirroring expert verification steps, tasks like range checking and constraint validation help ensure system safety and reliability. Our approach systematically evaluates LLM-generated logical rules, assessing both syntactic fluency and logical correctness in these critical validation tasks. We also explore the models' capacity for self-correction via an iterative feedback loop based on code execution outcomes. ExKLoP presents an extensible dataset comprising 130 engineering premises, 950 prompts, and corresponding validation points. It enables comprehensive benchmarking while allowing control over task complexity and scalability of experiments. We leverage the synthetic data creation methodology to conduct extensive empirical evaluation on a diverse set of LLMs including Llama3, Gemma3, Codestral and QwenCoder. The results reveal that most models generate nearly perfect syntactically correct code and exhibit strong performance in translating expert knowledge into correct code. At the same time, while most LLMs produce nearly flawless syntactic output, their ability to correctly implement logical rules varies, as does their capacity for self-improvement. Overall, ExKLoP serves as a robust evaluation platform that streamlines the selection of effective models for self-correcting systems while clearly delineating the types of errors encountered.

View on arXivView PDF

Code Implementations(1)

Franek18/ExKLoPCommunity100%
42PythonJan 29, 20251 years ago

Similar Papers

Cite this paper

@article{grski2025integrating,
  title  = {Integrating Expert Knowledge into Logical Programs via LLMs},
  author = {Franciszek Górski and Oskar Wysocki and Marco Valentino and Andre Freitas},
  year   = {2025},
  eprint = {2502.12275},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.12275v2}
}

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/2502.12275.svg)](https://codeofpaper.com/paper/2502.12275)

Discussion