Question Answering with LLMs and Learning from Answer Sets

Manuel Borroto, Katie Gallagher, Antonio Ielo, Irfan Kareem, Francesco Ricca, Alessandra Russo

TL;DR

LLM2LAS is a novel neuro-symbolic framework that eliminates the need for human experts to manually write logic rules for story-based question answering. By pairing the natural language parsing of Large Language Models (LLMs) with the inductive logic power of ILASP, the system automatically learns interpretable commonsense rules from data and solves reasoning tasks using Answer Set Programming (ASP).

What Problem Does This Paper Address?

While Large Language Models (LLMs) excel at understanding and parsing natural language, they notoriously struggle with explicit, multi-step commonsense reasoning, often relying on shallow statistical patterns or generating hallucinations.

To solve this, neuro-symbolic AI combines LLMs with formal symbolic reasoning engines. However, a major bottleneck remains: these hybrid systems typically rely on human experts to manually hand-craft the symbolic rules and background knowledge for every new task. This process is time-consuming, expensive, and limits scalability. The authors of this paper ask a fundamental question: Can we automatically learn these symbolic reasoning rules from examples instead of relying on human engineering?

Methods

The authors introduce LLM2LAS, a hybrid framework that automates the rule-generation process through a three-step pipeline:

  1. Semantic Parsing: The system uses an open-source LLM (Llama-3.3 70B) with few-shot prompting to translate natural language stories into structured logic facts (fluents). Crucially, the LLM also generates "mode biases"—syntactic constraints that define what kinds of logic rules the system is allowed to consider.
  2. Inductive Learning: These parsed facts and constraints are fed into ILASP (Inductive Learning of Answer Set Programs). By looking at examples of stories paired with correct and incorrect answers, ILASP automatically induces generalizable, human-readable logic rules based on Simplified Discrete Event Calculus (SDEC).
  3. Symbolic Reasoning: Finally, the learned rules and story facts are passed to an ASP solver (clingo), which performs precise, deterministic reasoning to output the correct answer.

The way the system models state tracking and actions over time using these induced rules is illustrated below:

Fig. 2. Fluents carry/2 evolving over time, according to SDEC axioms. Narrative’s observations—in terms of got/2, drop/2 fluents—trigger the carry/2 start/stop (blue arrows), which triggers carry/2 definitions (green arrows), that dictate truth value over time due to inertia law (“something is true once it initiates and up to the point it terminates”). We can see that John carries with himself the football up to t = 6 when he drops it; the fluent drop(john,football) disables the (default) inertia rule.

Datasets

The framework was evaluated on Facebook's bAbI Question Answering dataset, a widely recognized benchmark consisting of 20 distinct tasks. Each task is designed to test a specific type of text understanding and reasoning capability, such as deduction, induction, time reasoning, and coreference resolution. The authors evaluated their approach using 1,000 training examples per task.

Key Insights and Ideas

  • Bootstrapping the Symbolic Layer: The core "aha" moment is demonstrating that the symbolic layer of a neuro-symbolic system doesn't have to be static or human-written. An LLM can provide the structural scaffolding (facts and constraints), allowing an inductive logic engine to learn the actual reasoning rules from data.
  • Fully Auditable AI: Unlike pure LLM prompting methods (like Chain-of-Thought), which remain black boxes, the rules induced by LLM2LAS are explicit, transparent logic formulas. If the system makes a mistake, a human can inspect the exact rule that caused the error.
  • Efficiency via Caching: Inductive logic programming can be computationally heavy. To make the system viable, the authors implemented a strategy that caches the hypothesis space across multiple examples in an incremental learning setup, reducing rule-induction times to mere seconds per task.

Key Results

  • High Accuracy: LLM2LAS successfully mastered 17 out of the 20 tasks in the bAbI dataset.
  • Perfect Performance on Core Tasks: For 16 of those tasks, the system achieved 100% accuracy, matching the performance of state-of-the-art systems that rely on human-engineered rules.
  • Positional Reasoning Success: For Task 17 (positional reasoning), the system achieved 97.8% accuracy by automatically finding a non-recursive rule formulation to bypass grounding bottlenecks.
  • Handling Math: For Task 7 (counting), the system achieved 100% accuracy after the authors injected a basic counting rule into the background knowledge, compensating for ILASP's native inability to learn mathematical aggregates.

Limitations and Future Work

Despite its success, LLM2LAS hit a wall on 3 of the 20 bAbI tasks (Tasks 2, 3, and 5):

  • Hypothesis Space Explosion: Task 5 requires tracking complex interactions using ternary fluents (e.g., tracking who gave what object to whom). Combining these complex relations with temporal tracking caused the search space of possible rules to explode, making it too massive for ILASP to process in a reasonable timeframe.
  • Implicit Knowledge Gaps: Tasks 2 and 3 require understanding multiple unmentioned commonsense concepts simultaneously (e.g., realizing that moving to a location implies you are now "in" that location, or receiving an object implies "ownership").

Future Work: The authors propose exploring tighter LLM-ILASP integration, specifically leveraging the implicit world knowledge already inside LLMs to automatically pre-populate background knowledge bases, alongside developing smarter hypothesis space pruning techniques to handle highly complex tasks.

Summary updated

BibTeX
@inproceedings{borroto2025question,
  author = {Manuel Borroto and Katie Gallagher and Antonio Ielo and Irfan Kareem and Francesco Ricca and Alessandra Russo},
  title = {{Question Answering with LLMs and Learning from Answer Sets}},
  booktitle = {Theory},
  year = {2025},
  doi = {10.1017/s1471068425100343},
}
Figure