Leveraging Large Language Models to Generate Answer Set Programs

Adam Ishay, Zhun Yang, Joohyung Lee
7/15/2023
cs.AIcs.CLcs.SC

No official code found. Best implementation: azreasoners/gpt-asp-rules (11 stars, MIT, last commit 2023-10-21). 1 more below.

Abstract

Large language models (LLMs), such as GPT-3 and GPT-4, have demonstrated exceptional performance in various natural language processing tasks and have shown the ability to solve certain reasoning problems. However, their reasoning capabilities are limited and relatively shallow, despite the application of various prompting techniques. In contrast, formal logic is adept at handling complex reasoning, but translating natural language descriptions into formal logic is a challenging task that non-experts struggle with. This paper proposes a neuro-symbolic method that combines the strengths of large language models and answer set programming. Specifically, we employ an LLM to transform natural language descriptions of logic puzzles into answer set programs. We carefully design prompts for an LLM to convert natural language descriptions into answer set programs in a step by step manner. Surprisingly, with just a few in-context learning examples, LLMs can generate reasonably complex answer set programs. The majority of errors made are relatively simple and can be easily corrected by humans, thus enabling LLMs to effectively assist in the creation of answer set programs.

View on arXivView PDF

Code Implementations(2)

MIT
113PythonMar 13, 20233 years agoMIT
MIT

Extending the research of Ishay, Yang, and Lee on generating Answer Set Programs (ASP) with LLMs (arxiv.org/abs/2307.07699).

00Shell, PythonMar 6, 20266 months agoMIT

Similar Papers

Cite this paper

@article{ishay2023leveraging,
  title  = {Leveraging Large Language Models to Generate Answer Set Programs},
  author = {Adam Ishay and Zhun Yang and Joohyung Lee},
  year   = {2023},
  eprint = {2307.07699},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2307.07699v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2307.07699.svg)](https://codeofpaper.com/paper/2307.07699)

Discussion