LLM-MatLogic: Executable Exchange Contracts for Knowledge-Graph Query Answering with Scoped Negation
Abstract
Lay Summary
LLM-KG question-answering systems use large language models (LLMs) to understand a user’s question and knowledge graph (KG) to search over connected factual data. However, these systems often struggle with questions that contain negation. The difficulty is that the negation may not apply to the whole answer, but only to a specific entity, condition, or reasoning branch. If the system applies the negation too late, or applies it to the wrong part of the graph search, it may remove valid answers or keep answers that should have been excluded. This paper introduces a clear instruction layer, called EEC, between the LLM and the executor. The LLM uses its natural-language understanding to identify what is negated and where the negation should apply. The executor then follows a unified procedure that works across different query structures, applying the negation during graph reasoning before supporting evidence is lost or different reasoning branches are mixed together. This makes LLM-KG question answering more reliable for questions involving negation.