<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <issn pub-type="ppub">1613-0073</issn>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Models as a Source of Com mon-Sense Knowledge for Robots</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Felix Ocker</string-name>
          <email>felix.ocker@honda-ri.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jörg Deigmöller</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Julian Eggert</string-name>
          <email>julian.eggert@honda-ri.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="editor">
          <string-name>Knowledge Extraction, Large Language Models, Common-Sense Knowledge, Robotics</string-name>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Honda Research Institute Europe</institution>
          ,
          <addr-line>Carl-Legien-Str. 30, 63073 Ofenbach am Main</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Service robots need common-sense knowledge to help humans in everyday situations as it enables them to understand the context of their actions. However, approaches that use ontologies face a challenge because common-sense knowledge is often implicit, i.e., it is obvious to humans but not explicitly stated. This paper investigates if Large Language Models (LLMs) can fill this gap. Our experiments reveal limited efectiveness in the selective extraction of contextual action knowledge, suggesting that LLMs may not be suficient on their own. However, the large-scale extraction of general, actionable knowledge shows potential, indicating that LLMs can be a suitable tool for eficiently creating ontologies for robots. This paper shows that the technique used for knowledge extraction can be applied to populate a minimalist ontology, showcasing the potential of LLMs in synergy with formal knowledge representation.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>CEUR
ceur-ws.org</p>
    </sec>
    <sec id="sec-2">
      <title>1. Introduction</title>
      <p>
        To assist humans efectively in everyday life, service robots need a sound foundation of
commonsense knowledge to guide their actions. While there has been significant research on
KnowledgeBased Systems (KBSs) for robotics [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], creating the underlying knowledge bases remains a
considerable challenge [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. This is due to the fact that common-sense knowledge is inherently
implicit, i.e., it is naturally understood by humans but remains mostly unexpressed. However,
the recent advances in LLMs have opened up a potential source of such knowledge. This
paper explores state-of-the-art LLMs as a source of common-sense knowledge for robots, and
investigates if they could even replace KBSs.
      </p>
    </sec>
    <sec id="sec-3">
      <title>2. Related</title>
    </sec>
    <sec id="sec-4">
      <title>Work</title>
      <p>
        Common-sense knowledge for robots involves actions necessary to reach a desired state, defined
by an action verb, an actor, an object, and a tool, forming an action pattern [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. Existing
community eforts, e.g., ConceptNet [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], ofer valuable information but face scalability challenges
and heterogeneity due to the variety of contributors. LLMs such as OpenAI’s ChatGPT and
CEUR
Workshop
Proceedings
BigScience’s BLOOMZ seem like a promising alternative due to the large amounts of
commonsense knowledge they incorporate. As the usability of LLMs increases, knowledge extraction
methods have evolved from demasking [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] to zero-shot prompts [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
      </p>
      <p>
        The application of LLMs to robotics leads to the emergence of embodied Artificial Intelligence
(AI). However, success rates of such systems are still limited, for instance, up to 85 % for tidying
up [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] and 48 % for task planning [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], posing challenges for robotics applications. Until the
performance of LLMs improves further, a synergistic use with KBSs seems reasonable.
      </p>
    </sec>
    <sec id="sec-5">
      <title>3. Extracting Action Patterns from Large Language Models</title>
      <sec id="sec-5-1">
        <title>3.1. Formalizing Action Patterns</title>
        <p>This work focuses on common-sense knowledge in the form of action patterns. An action
pattern  is represented by an action  , which is executed by a set of Agents  using a set of
Tools  to modify a set of Objects  , cp. Equation (1). These patterns capture various scenarios
a robot might encounter and how it can act to change these situations. This knowledge allows
the robot to infer appropriate actions to fulfill its goals, such as serving bread. Note that
the knowledge should be grounded in real-world settings and continuously tested, possibly
resulting in the robot confirming, discarding, or refining its knowledge. Note that the states
of all elements before and after the action can be described via a set of attributes    and
   , respectively. In addition, the spatial relations ℛ between the elements involved
may change.</p>
        <p>= (,  ,  ,  , 
 
,   
,  
)</p>
        <p>The set   comprises all valid action patterns in the sense that they are meaningful in
real-world applications. For instance, when tasked with baking bread, a robot has to identify
suitable tools, as illustrated by the incomplete action pattern in Equation (2).
 
= (, { }, { }, {</p>
        <p>$tool}, {}, {ℎ}, {})</p>
        <p>Action patterns can be expressed using Web Ontology Language (OWL) 2 Description Logic
(DL), a subset of predicate logic. Here, Actions are defined by their relations to the notions
Object, State, Location, and Time, forming action patterns. These notions, rooted in previous
work, cp. Section 2, can be aligned with top-level ontologies such as Basic Formal Ontology. An
Object can also take the role of an Agent or a Tool, and spatial relations can be expressed using
existing ontologies. Equation (3) shows the DL representation of the notions Action and Object.
 ⊑ ∃ ⩾ 1.ℎ</p>
        <p>_. ⊓ ∃ ⩾ 1.ℎ
∃ = 1.ℎ _. ⊓ ∃ = 1.ℎ
 ⊑ ∃ ⩾ 1.ℎ
_.
_. ⊓ ∃ ⩾ 0.ℎ
_. 
_. ⊓
(1)
(2)
(3)</p>
      </sec>
      <sec id="sec-5-2">
        <title>3.2. Extracting Parts of Action Patterns</title>
        <p>In order to replace KBSs, LLMs would need to be capable of consistently answering queries such
as “Which tool can I use to bake bread?”. This task can be posed generically using Prompt 1.
Note that specifying candidates corresponds to a simple grounding in reality. Further, we
modified Prompt 1 to extract the state of an object before and after a given action has been
applied to it. The prompt can also be adapted to extract details about the spatial relationships
between the object and the tool used.</p>
        <p>Prompt 1. In the following, I will ask you a question. In your response, I want you to answer with
nothing but a list of suitable comma-separated words sorted by relevance. Which tool can I use to
$action $object? Choose only from the following candidates: $candidates.</p>
        <p>Example: ... Which tool can I use to bake bread? Choose only from the following candidates:
bowl, oven, knife, ...</p>
      </sec>
      <sec id="sec-5-3">
        <title>3.3. Extracting Entire Action Patterns</title>
        <p>The large-scale extraction of action patterns to incorporate into a knowledge base can be
achieved using Prompt 2. Compared to Prompt 1, this prompt specifies the domain of interest
and permits constraints within the action pattern, ofering additional flexibility. The information
extracted by Prompt 2 may not be directly applicable, but it is well-suited for populating an
ontology with broad common-sense knowledge on a large scale.</p>
        <p>Prompt 2. Please respond with nothing but lists of the form ’(action, agent, object, tool)’. An
action pattern is defined by an action, i.e., a verb, an agent who executes the action, an object,
which is modified, and optionally a tool. Generate $number action patterns for the domain of
interest ’$domain_of_interest’.</p>
        <p>Example: ... Generate 100 action patterns for the domain of interest ’kitchen’.</p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>4. Experiments</title>
      <p>To evaluate the LLMs’ suitability as a source of common-sense knowledge, we used a ground
truth consisting of 97 action patterns. The data set was created in a study with 20 participants,
who completed the action patterns by determining the states of each object before and after the
action, identifying the tools used, and outlining the spatial relationships between the objects
and tools. An excerpt of this ground truth for the action “cut bread” is shown in Listing 1.</p>
      <p>Listing 1: Excerpt from the ground truth for action patterns.</p>
      <sec id="sec-6-1">
        <title>4.1. Architecture and Models</title>
        <p>We conducted preliminary experiments for choosing suitable LLMs, including ones with Vicuña’s
7B and 13B models and OpenAssistant. Despite performing well in chat-like scenarios, these
models had dificulty returning structured results. OpenAI’s models appeared particularly
promising, so we included them along with BLOOMZ as an open-source alternative and BERT
as a baseline. For BERT, we rephrased the prompts as demasking tasks. We accessed
gpt-3.5turbo and gpt-4 via the OpenAI API and BLOOMZ via the Hugging Face API, and deployed
BERT locally using a Hugging Face transformers pipeline. While we experimented with various
temperatures, we ended up using a temperature of 0 to ensure reproducability. Providing
candidates leads to significantly better results when comparing the responses to the ground
truth. However, it is valid to assume that candidates are available, as this corresponds to a
grounding in the robot’s environment, which can be achieved using an appropriate perception
module. The architecture we developed for the evaluation is shown in Figure 1. We also adapted
this architecture to populate an ontology revolving around the notions described in Section 3.1
with the action patterns extracted to demonstrate the use of the information extracted, see
Figure 1 bottom right.</p>
        <p>Ground truth: action
patterns</p>
        <p>Prompt generation
Ontology population process</p>
        <p>Evaluation process</p>
        <p>LLM Wrapper
+ fill_mask()
+ conversation()</p>
        <p>BERT
BLOOMZ
ChatGPT</p>
        <p>Evaluation
Ontology population</p>
        <p>Plots
Ontology</p>
      </sec>
      <sec id="sec-6-2">
        <title>4.2. Results</title>
      </sec>
    </sec>
    <sec id="sec-7">
      <title>5. Conclusion and Outlook</title>
      <p>
        Our experiments indicate that LLMs are a scalable source for general common-sense knowledge
in the form of action patterns, which is a valuable basis for an ontology usable by robots.
However, LLMs are still insuficiently reliable for providing actionable knowledge for robotics
applications by themselves. Thus, we suggest pursuing the combination of LLMs and knowledge
graphs for robotics, especially in the form of an integrated pipeline for ontology population
from LLMs, and validation and reasoning using symbolic AI. Future work should also address
the validation of newly extracted information using the existing knowledge graph in the spirit
of Pan et al. [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], and the continuous evolution of the knowledge base using all sources available,
ranging from databases created in community eforts to LLMs.
      </p>
      <p>Supplementary Material: The ground truth dataset, the prompts, and a Python script for
creating an OWL ontology from the action patterns extracted are available via GitHub1.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>A.</given-names>
            <surname>Olivares-Alarcos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Beßler</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Khamis</surname>
          </string-name>
          , et al.,
          <article-title>A review and comparison of ontology-based approaches to robot autonomy</article-title>
          ,
          <source>The Knowledge Engineering Review</source>
          <volume>34</volume>
          (
          <year>2019</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>R.</given-names>
            <surname>Gupta</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. J.</given-names>
            <surname>Kochenderfer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Mcguinness</surname>
          </string-name>
          ,
          <string-name>
            <surname>G.</surname>
          </string-name>
          <article-title>Ferguson, Common sense data acquisition for indoor mobile robots</article-title>
          ,
          <source>in: AAAI</source>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>J.</given-names>
            <surname>Eggert</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Deigmöller</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Fischer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Richter</surname>
          </string-name>
          ,
          <article-title>Action representation for intelligent agents using Memory Nets</article-title>
          , in: IC3K,
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>R.</given-names>
            <surname>Speer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Chin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Havasi</surname>
          </string-name>
          ,
          <article-title>Conceptnet 5.5: An open multilingual graph of general knowledge</article-title>
          ,
          <source>in: AAAI</source>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>V.</given-names>
            <surname>Losing</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Fischer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Deigmöller</surname>
          </string-name>
          ,
          <article-title>Extraction of common-sense relations from procedural task instructions using BERT</article-title>
          , in: Global WordNet Conference,
          <year>2021</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>J. H.</given-names>
            <surname>Caufield</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Hegde</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Emonet</surname>
          </string-name>
          , et al.,
          <article-title>Structured prompt interrogation and recursive extraction of semantics (SPIRES): A method for populating knowledge bases using zero-shot learning</article-title>
          ,
          <source>arXiv preprint arXiv:2304.02711</source>
          (
          <year>2023</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>J.</given-names>
            <surname>Wu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Antonova</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Kan</surname>
          </string-name>
          , et al.,
          <article-title>Tidybot: Personalized robot assistance with large language models</article-title>
          ,
          <source>arXiv preprint arXiv:2305.05658</source>
          (
          <year>2023</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>I.</given-names>
            <surname>Singh</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Blukis</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Mousavian</surname>
          </string-name>
          , et al.,
          <article-title>Progprompt: Generating situated robot task plans using large language models</article-title>
          ,
          <source>in: ICRA</source>
          ,
          <year>2023</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>S.</given-names>
            <surname>Pan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Luo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Chen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Wu</surname>
          </string-name>
          ,
          <article-title>Unifying large language models and knowledge graphs: A roadmap</article-title>
          ,
          <source>arXiv preprint arXiv:2306.08302</source>
          (
          <year>2023</year>
          ).
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>