Coupling Large Language Models with Logic Programming for Robust and General Reasoning from Text

Zhun Yang, Adam Ishay, Joohyung LeeACL 2023

Introduction

Large Language Models (LLMs) like GPT-3 excel at "System 1" thinking—fast, intuitive pattern matching and fluent text generation. However, they frequently falter in "System 2" tasks that require slow, deliberate logical reasoning, such as multi-hop deduction or maintaining long-term consistency. Conversely, symbolic logic systems are mathematically sound and robust for reasoning but struggle with the inherent ambiguity of natural language. This paper introduces [LLM]+ASP, a neuro-symbolic framework that bridges this gap by using LLMs as semantic parsers to feed a rigorous Answer Set Programming (ASP) logic engine.

Methodology: The [LLM]+ASP Pipeline

The authors propose a dual-system architecture that separates linguistic processing from logical inference:

  1. Semantic Parsing (System 1): Instead of fine-tuning, the framework leverages GPT-3 as a few-shot semantic parser. By providing a few examples in the prompt, the LLM translates natural language sentences into atomic logical facts (e.g., "Mary went to the kitchen" becomes go(Mary, kitchen)).
  2. Symbolic Reasoning (System 2): These facts are processed by CLINGO, an ASP solver. ASP is a declarative language suited for complex search and optimization problems.
  3. Knowledge Modules: To ensure generalizability, the system utilizes reusable ASP modules for specific domains like spatial relations (location), actions and time (DEC), and kinship (family). These modules define the "rules of the world" used by the solver to derive answers.
Extracted figure from page 4 of Coupling Large Language Models with Logic Programming for Robust and General Reasoning from Text

Evaluation and Datasets

The framework was evaluated across several challenging benchmarks designed to test different reasoning capabilities:

  • bAbI: 20 tasks covering deduction, counting, and path-finding.
  • StepGame: A benchmark for complex multi-hop spatial reasoning.
  • CLUTRR: Kinship relation inference from narrative stories.
  • gSCAN: Grounded navigation in a grid world requiring complex instruction following.
  • Pick&Place: A robot action planning task requiring sequences of actions to reach a goal state.

Results and Key Insights

The [LLM]+ASP approach achieved state-of-the-art (SOTA) performance across all evaluated benchmarks. Notably, on the bAbI tasks, the model reached an average accuracy of 99.99%, significantly outperforming specialized neural architectures.

Extracted table from page 6 of Coupling Large Language Models with Logic Programming for Robust and General Reasoning from Text

Beyond raw metrics, the study revealed several critical insights:

  • LLMs as Normalizers: LLMs effectively map diverse linguistic expressions (e.g., "north of" vs. "above at 12 o'clock") to canonical logical forms, simplifying the reasoning task for the symbolic engine.
  • Interpretability: The modular design allows for clear error attribution—one can easily determine if a failure stemmed from a parsing error or a missing logic rule.
  • Dataset Validation: The high precision of the system helped identify ground-truth errors in approximately 10.7% of the StepGame labels, explaining why previous models failed to reach ceiling performance.
  • Zero-Shot Planning: In the Pick&Place task, while GPT-3 alone failed completely (0% success), the [LLM]+ASP framework achieved 100% accuracy by treating planning as a logic satisfaction problem.

Conclusion

While the framework currently requires human-authored logic modules and is susceptible to occasional parsing errors (such as argument swapping), it demonstrates the power of neuro-symbolic AI. By delegating perception to neural networks and reasoning to symbolic logic, [LLM]+ASP provides a path toward AI systems that are both linguistically fluent and logically rigorous. Future work will explore automating the generation of ASP rules using LLMs to reduce manual engineering requirements.

Summary updated

BibTeX
@inproceedings{yang2023coupling,
  author = {Zhun Yang and Adam Ishay and Joohyung Lee},
  title = {{Coupling Large Language Models with Logic Programming for Robust and General Reasoning from Text}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.findings-acl.321},
}
Figure