Table of Contents
Fetching ...

Bridging Natural Language and ASP: A Hybrid Approach Using LLMs and AMR Parsing

Connar Hite, Sean Saud, Raef Taha, Nayim Rahman, Tanvir Atahary, Scott Douglass, Tarek Taha

TL;DR

Problem: translating unconstrained English into ASP for logic puzzles. Approach: a hybrid LLM-AMR pipeline that uses LLMs for initial language processing and AMR graphs to derive ASP constraints, producing a complete ASP encoding (facts, rules, constraints). Contributions: first explicit combination of LLMs and AMR for ASP code generation in logic puzzles, with a decomposed, explainable pipeline that reduces reliance on LLMs and improves predictability. Findings: the system can generate correct ASP programs that solve given puzzles, with rare AMR errors corrected manually. Significance: lowers the barrier to creating ASP solutions from natural language and enhances traceability of the reasoning steps.

Abstract

Answer Set Programming (ASP) is a declarative programming paradigm based on logic programming and non-monotonic reasoning. It is a tremendously powerful tool for describing and solving combinatorial problems. Like any other language, ASP requires users to learn how it works and the syntax involved. It is becoming increasingly required for those unfamiliar with programming languages to interact with code. This paper proposes a novel method of translating unconstrained English into ASP programs for logic puzzles using an LLM and Abstract Meaning Representation (AMR) graphs. Everything from ASP rules, facts, and constraints is generated to fully represent and solve the desired problem. Example logic puzzles are used to demonstrate the capabilities of the system. While most current methods rely entirely on an LLM, our system minimizes the role of the LLM only to complete straightforward tasks. The LLM is used to simplify natural language sentences, identify keywords, and generate simple facts. The AMR graphs are then parsed from simplified language and used to generate ASP constraints systematically. The system successfully creates an entire ASP program that solves a combinatorial logic problem. This approach is a significant first step in creating a lighter-weight, explainable system that converts natural language to solve complex logic problems.

Bridging Natural Language and ASP: A Hybrid Approach Using LLMs and AMR Parsing

TL;DR

Problem: translating unconstrained English into ASP for logic puzzles. Approach: a hybrid LLM-AMR pipeline that uses LLMs for initial language processing and AMR graphs to derive ASP constraints, producing a complete ASP encoding (facts, rules, constraints). Contributions: first explicit combination of LLMs and AMR for ASP code generation in logic puzzles, with a decomposed, explainable pipeline that reduces reliance on LLMs and improves predictability. Findings: the system can generate correct ASP programs that solve given puzzles, with rare AMR errors corrected manually. Significance: lowers the barrier to creating ASP solutions from natural language and enhances traceability of the reasoning steps.

Abstract

Answer Set Programming (ASP) is a declarative programming paradigm based on logic programming and non-monotonic reasoning. It is a tremendously powerful tool for describing and solving combinatorial problems. Like any other language, ASP requires users to learn how it works and the syntax involved. It is becoming increasingly required for those unfamiliar with programming languages to interact with code. This paper proposes a novel method of translating unconstrained English into ASP programs for logic puzzles using an LLM and Abstract Meaning Representation (AMR) graphs. Everything from ASP rules, facts, and constraints is generated to fully represent and solve the desired problem. Example logic puzzles are used to demonstrate the capabilities of the system. While most current methods rely entirely on an LLM, our system minimizes the role of the LLM only to complete straightforward tasks. The LLM is used to simplify natural language sentences, identify keywords, and generate simple facts. The AMR graphs are then parsed from simplified language and used to generate ASP constraints systematically. The system successfully creates an entire ASP program that solves a combinatorial logic problem. This approach is a significant first step in creating a lighter-weight, explainable system that converts natural language to solve complex logic problems.

Paper Structure

This paper contains 12 sections, 3 equations, 2 figures.

Figures (2)

  • Figure 1: Example AMR Graph
  • Figure 2: System Architecture