Hostname: page-component-89b8bd64d-j4x9h Total loading time: 0 Render date: 2026-05-11T08:29:36.591Z Has data issue: false hasContentIssue false

A Reliable Common-Sense Reasoning Socialbot Built Using LLMs and Goal-Directed ASP

Published online by Cambridge University Press:  15 January 2025

YANKAI ZENG
Affiliation:
University of Texas at Dallas, Richardson, USA (e-mails: yankai.zeng@utdallas.edu, abhiramon.rajasekharan@utdallas.edu)
ABHIRAMON RAJASEKHARAN
Affiliation:
University of Texas at Dallas, Richardson, USA (e-mails: yankai.zeng@utdallas.edu, abhiramon.rajasekharan@utdallas.edu)
KINJAL BASU
Affiliation:
IBM Research, Yorktown Heights, USA (e-mail: kinjal.basu@ibm.com)
HUADUO WANG
Affiliation:
University of Texas at Dallas, Richardson, USA (e-mail: huaduo.wang@utdallas.edu)
JOAQUÍN ARIAS
Affiliation:
Universidad Ray Juan Carlos, Madrid, Spain (e-mail: joaquin.arias@urjc.es)
GOPAL GUPTA
Affiliation:
University of Texas at Dallas, Richardson, USA (e-mail: gupta@utdallas.edu)
Rights & Permissions [Opens in a new window]

Abstract

The development of large language models (LLMs), such as GPT, has enabled the construction of several socialbots, like ChatGPT, that are receiving a lot of attention for their ability to simulate a human conversation. However, the conversation is not guided by a goal and is hard to control. In addition, because LLMs rely more on pattern recognition than deductive reasoning, they can give confusing answers and have difficulty integrating multiple topics into a cohesive response. These limitations often lead the LLM to deviate from the main topic to keep the conversation interesting. We propose AutoCompanion, a socialbot that uses an LLM model to translate natural language into predicates (and vice versa) and employs commonsense reasoning based on answer set programming (ASP) to hold a social conversation with a human. In particular, we rely on s(CASP), a goal-directed implementation of ASP as the backend. This paper presents the framework design and how an LLM is used to parse user messages and generate a response from the s(CASP) engine output. To validate our proposal, we describe (real) conversations in which the chatbot’s goal is to keep the user entertained by talking about movies and books, and s(CASP) ensures (i) correctness of answers, (ii) coherence (and precision) during the conversation—which it dynamically regulates to achieve its specific purpose—and (iii) no deviation from the main topic.

Information

Type
Original Article
Creative Commons
Creative Common License - CCCreative Common License - BYCreative Common License - NCCreative Common License - ND
This is an Open Access article, distributed under the terms of the Creative Commons Attribution-NonCommercial-NoDerivatives licence (http://creativecommons.org/licenses/by-nc-nd/4.0/), which permits non-commercial re-use, distribution, and reproduction in any medium, provided that no alterations are made and the original article is properly cited. The written permission of Cambridge University Press must be obtained prior to any commercial use and/or adaptation of the article.
Copyright
© The Author(s), 2025. Published by Cambridge University Press
Figure 0

Fig 1. AutoCompanion architecture. The yellow-colored boxes are handled by GPT-4 in Python, and the green-colored by s(CASP). The two parts interact using Python subprocess calls.

Figure 1

Table 1. Output of GPT-4 of the similar plot to Titanic’s sacrifice

Figure 2

Table 2. Time cost for s(CASP) reasoning call and total response generation

Figure 3

Table 3. We compared autoCompanion with ChatGPT-3.5 on creativity, topic concentration, and conversation depth by employing an LLM-as-a-judge system. The result shows that autoCompanion outperforms ChatGPT-3.5 in creativity and has better control of the topic