Introduction
Traditional Artificial Intelligence has long been divided between symbolic reasoning—which uses formal logic to achieve precise results—and modern Large Language Models (LLMs), which excel at statistical pattern matching but often lack "symbolic grounding." This lack of grounding can lead to logical hallucinations where models fail to follow rigid rules. This paper investigates whether LLMs can bridge this gap by performing Inductive Logic Programming (ILP): the process of deriving general logical rules (theories) from specific facts and examples.
By combining LLMs with a formal Prolog interpreter in a feedback loop, the researchers explored how these models scale as logical complexity increases and how they handle "noisy" or contradictory data compared to state-of-the-art symbolic solvers like Popper.
The Iterative Theory Refinement Framework
The core of the proposed approach is a closed-loop system designed to improve the logical accuracy of LLM-generated theories through formal feedback.
As shown in the framework above, the process involves four key steps:
- Prompt Generation: A generator sends background facts and example instances (positive and negative) to an LLM.
- Theory Induction: The LLM generates a candidate theory written in Prolog code.
- Formal Evaluation: A logic program interpreter executes the code against evaluation instances, calculating metrics like Accuracy, Precision, Recall, and F1 score.
- Iterative Refinement: The interpreter identifies specific examples the theory failed on. This feedback is fed back into the prompt generator, allowing the LLM to refine its theory over multiple iterations (typically up to four).
Experimental Setup and Datasets
To rigorously test the limits of LLMs, the authors used the RuDaS tool to generate 105 synthetic datasets. These datasets were categorized by their structural "expressivity" or complexity:
- CHAIN: Linear dependencies (e.g., A implies B, B implies C).
- RDG/DRDG: Rooted Directed Graphs, including disjunctions (OR conditions).
- REC: Recursive versions of the above structures.
- MIXED: A combination of all logical structures.
Furthermore, the researchers systematically introduced noise levels (ranging from 0.1 to 0.3) to simulate real-world data messiness, where some facts might be incorrect or contradictory.
Results and Analysis
The study revealed several critical insights into the capabilities of LLMs versus traditional symbolic solvers.
Performance and Noise Resilience
Top-tier models, specifically GPT-4o, demonstrated competitive performance with the Popper baseline. Notably, LLMs showed superior resilience to noise. While symbolic solvers like Popper are often "brittle"—where a single noisy fact can significantly degrade performance—LLMs use their statistical nature to identify the "most probable" rule, effectively filtering out contradictions.
As illustrated in the performance charts, GPT-4o's F1 score was nearly double that of GPT-3.5-Turbo at low noise (0.1) and remained significantly more effective as noise increased to 0.3.
The "Chain" Paradox and Syntactic Accuracy
Surprisingly, the simplest logical category—CHAIN—proved to be one of the most difficult for LLMs. While traditional solvers handle long linear dependencies easily, LLMs struggled to track long relationship chains of independent predicates.
There was also a massive divide in syntactic capability. GPT-4o and GPT-3.5 achieved 0% syntactic error rates, consistently producing valid Prolog code. In contrast, smaller models like Llama3-8B failed to produce valid syntax nearly half the time, and Gemma-7B failed entirely, highlighting a steep "capability cliff" for smaller models in formal reasoning tasks.
Speed vs. Exhaustive Search
LLMs operated roughly three orders of magnitude faster than symbolic solvers. While symbolic systems perform exhaustive serial searches to find a perfect theory, the parallel nature of transformer-based LLMs allows for near-instantaneous theory generation, albeit without the same formal guarantees of completeness.
Conclusion
This research demonstrates that high-end LLMs can effectively perform inductive reasoning when paired with formal feedback loops. While they struggle with specific structures like long chains, their resilience to noise and extreme speed make them powerful tools for theory induction. Future work may involve "hybrid" systems where LLMs generate initial theory drafts that are then formally verified and refined by symbolic solvers, combining the statistical flexibility of neural networks with the rigid precision of logic.
Summary updated