Use Defines Possibilities: Reasoning about Object Function to Interpret and Execute Robot Instructions (2023)

Abstract: Language models have shown great promise in common-sense related tasks. However, it remains unseen how they would perform in the context of physically situated human-robot interactions, particularly in disaster-relief sce- narios. In this paper, we develop a language model evaluation dataset with more than 800 cloze sentences, written to probe for the func- tion of over 200 objects. The sentences are divided into two tasks: an “easy” task where the language model has to choose between vo- cabulary with different functions (Task 1), and a “challenge” where it has to choose between vocabulary with the same function, yet only one vocabulary item is appropriate given real world constraints on functionality (Task 2). Dis- tilBERT performs with about 80% accuracy for both tasks. To investigate how annotator variability affected those results, we developed a follow-on experiment where we compared our original results with wrong answers chosen based on embedding vector distances. Those results showed increased precision across docu- ments but a 15% decrease in accuracy. We con- clude that language models do have a strong knowledge basis for object reasoning, but will require creative fine-tuning strategies in order to be successfully deployed.

## introduction when it comes to using robots in disaster-relief scenarios such as search-and-rescue, it is essential that a robot can interpret and execute an instruction based on its current understanding of the objects detected in its environment. for example, in order to enter the building, the robot should know to search for entrance points, such as doors and windows. similarly, to scan the second floor, the robot must be able to find appropriate ways to get to the second floor, such as stairs. finally, to use the outlet to check for power, the robot must know how outlets are used. essentially, the robots need to know an object's function(s) in order to complete envisioned interactions. envisioned interactions are a multi-modal approach to responding to natural language instructions. for this paper, we assume that various sensors and computational systems, such as lidar, motion, or camera sensors, have taken care of identifying the objects in a scene. this information is passed to a language based world model, which deduces which, if any, of the objects perceived are relevant to the instruction based on the objects capabilities. this information would then be passed on to a lower-level policy-planning tool. an envisioned interaction that this research supports is depicted in figure 1 . to understand the possibilities for executing a natural language instruction within the current environment, the robot requires apriori, commonsense knowledge of the objects in the environment. in particular, knowledge of object function is critical for interpreting natural language instructions in physically situated disaster-relief tasks. given that such tasks are dynamic and dangerous, a robot should be able to accept unconstrained natural language (as opposed to placing a cognitive burden on the rescue worker to use a robot's controlled language). we hypothesize that a large language model (lm) would be uniquely equipped to handle this challenging task of supporting commonsense reasoning about an object's function for situated natural language understanding (nlu), due to the lm's latent world knowledge @xcite . the contributions of this paper include: we will make our object function dataset and clozesentence evaluation set available upon request. ## object function background and dataset propbank @xcite is a semantic role labeling framework that provides a lexicon of event "rolesets," where each corresponds to a particular sense of a verb, eventive noun, or relational adjective. each sense is described in terms of its set of participant roles, captured as argument numbers "arg" 0-5, or as "arg-m" modifier or adjunct arguments. in addition to the lexicon, propbank provides a large corpus of annotated data where each relation is marked up with its sense in the lexicon and the arguments are marked for their semantic role with respect to that sense roleset. this lexicon is also used in the annotated corpus of abstract meaning representation (amr) @xcite . the standard roles are arg0, which corresponds to dowty's prototypical agent, and arg1, which corresponds to the prototypical patient @xcite . the corresponding semantic roles of the other, higher-numbered args 2-5 are verb specific. arg-ms, which can theoretically modify or accompany any verb, include roles such as instrument and path. by leveraging the propbank lexicon and corpus to establish that ladders and stairs fulfill the same role semantically (as the arg1 for climb.01), we are able to derive a set of objects that have the same functionality (ways to climb between floors of a building). 1 essentially, using propbank is a pre-existing method of establishing commonalities between objects' functions. for example, propbank allows us to group barrels, boxes, crates, and cabinets together because they all are arg0 of the propbank sense contain.01 while alternative resources that encode object functionality do exist, such as the suggested upper merged ontology (sumo) @xcite , which includes axioms and object definitions indicating function, we found that propbank provided a data-driven approach for us to develop a ground truth of each object's functionality as well as an elegant way of encoding and representing that function, for example as arg1 of climb-01. this semantic representation of function thus fits with broader nlu that leverages the propbank and abstract meaning representation (amr) @xcite for a distillation of unconstrained natural language instructions into action primitives and their parameters, executable by a robot. object function is therefore encoded in the same way as the natural language instructions that might reference the object or desired functionality. for example in figure 1 , the instruction would be parsed into amr, abstracting the target object which would be a thing that is an arg0-of contain.01. then, the objects currently detected, localized, and labeled in the environment using the robot's sensors would be evaluated for which object had the matching function of arg0-of contain.01. we created a vocabulary of about 280 objects mentioned in a human-robot dialogue corpus @xcite . these dialogues were previously collected via wizard-of-oz experimental interactions between people and remotely located robots in a search and exploration task, which is similar to our target domain of robotic exploration for disaster relief. informed by existing propbank and amr corpora, an annotator then decided the best role for each vocabulary item given an appropriate propbank sense. for instance, the word crate was assigned the propbank arg0 role of the contain.01 sense-indicating it is the container holding some kind of contents. after one annotator made initial judgements, two other annotators familiar with propbank and amr reviewed the annotation to validate or offer alternative labels for vocabulary whose propbank annotations were more difficult to surmise. ## lm evaluation dataset with the objects labelled with the appropriate propbank sense-role pairing to signify their functionalities, we needed to develop a method of zero-shot testing a language model. for this methodology, it was important that we develop an understanding both of the language model's capabilities and how a small group of expert human annotators could be skewing the results beyond their particular writing styles. this led to two rounds of evaluation data generation: one with a manually developed answer set, and one with an answer set based on distances within lm vector space. ## experimental setup we used huggingface's pipeline class with the fillmask task and the distilbert uncased model. we chose distilbert because it is lightweight while having very similar accuracy to the full base bert model @xcite . this allows the model, theoretically, to be loaded directly onto the robot platform, keeping its space to a minimum without sacrificing too much accuracy. to calculate the vector embedding's cosine distances, we followed in bert-as-a-service's footsteps: we took the second to last layer of distilbert to represent each vocabulary term (mccormick and ryan, 2019). we used sci-kit learn's implementation of a kd-tree to store the resulting vectors @xcite . all experiments were run with pytorch and all scores were put into log space @xcite . multi-token vocabulary terms one challenge we faced was how to fairly compare the scores of single-token vocabulary terms as opposed to multi-token vocabulary terms, since the wordpiece tokenizer used by distilbert can potentially break words into subwords. to solve this problem, we adapt the sentence level scoring scheme of pseudolog likelihood from salazar et al. (2020) when vocabulary items have multiple tokens. specifically, for tokens t 1 . . . t n that make up word w with t j tokens before the mask and t k tokens afterwards, where j and k are both natural numbers, we calculate the probability as shown: we found that normalizing the scores by the number of tokens improved accuracy results. we hypothesize that this normalization reduced the lm's bias towards single token answers, but more experimentation is required to fully understand the effects of normalizing scores by token length. the accuracies for task 1 and task 2 were nearly identical, as shown in we also obtained distilbert's accuracy across each function. some trends are immediately visible. first, regardless of the role the vocabulary term played in the sentence, the more sentences written for a specific function, the worse accuracy got. this can be seen in 3. since so much expert knowledge was used when assigning the propbank sense and role while deciding function, we do not believe this is because of labelling error. rather, functions with fewer sentences tended to be more common, specific, and explicit than functions with many sentences. for instance, some functions that had only one or two sentences that scored well were dig.01 arg2 (which corresponded with shovel), rotate.01 arg1 (which corresponded with wheel), and buttress.01 arg0 (which corresponded with column). all of these items are strongly correlated with the functions. larger categories that struggled more included contain.01 arg0, whose vocabulary items ranged from cabinet to can, and occupy.01, whose terms ranged from car to barn. since the annotators were writing sentences that worked with all vocabulary of the same function, the sentences with "larger" functions had to be more general and likely had fewer semantic clues for distilbert to utilize. this suggests that lms have room to improve on more general cases for objects for our use case, including handling a wider variation in object function use. even though the results for task 1 were strong, within the task there was a wide range in accuracy over each document, with 2 documents in the same task differing in accuracy by as much as 22%. we attributed this wide range to annotator bias (as mentioned in section 3.2). while annotator bias is a given in a dataset with few sentence creators, we wanted to minimize as much bias as possible to ensure the lm was a sufficient basis for our ultimate use case of collaborative, disaster-relief communication. one clear place to eliminate bias was in the selection of wrong answers, motivating the development of task 1e. ## related work we were inspired in our own research by @xcite , who also test an lm's zero-shot knowledge with respect to physically situated settings. the authors' goal is to use lms to help robots determine the type of room it is in for a given 3d scene. to test if lms could be effective at this task, they automatically generate sentences from the template "the r often contains o", where r is a type of room and o is an object often found in that room. the authors ran their sentences through the masked lm bert with the room masked to see how well bert could predict the room based on the objects. the authors found that rooms with very specific items (bathrooms, bedrooms, kitchens) were easier to identify than rooms which had furniture that can be in many rooms (dining rooms, living rooms). this showed us the effects reporting bias can have on physical commonsense lms and prompted us to research this for our own use case. the ultimate goal of our research is to use lms for robot policy planning with a strong understanding of the lm's decision-making process and embeddings, since high stakes situations demand accountability. dipta et al. (2022) approach this task by creating linguistically informed embeddings within a custom encoder-compressor-decoder network. the network was trained to recognize the hierarchical nature of events by using frames from framenet @xcite only partially describing said event. by injecting linguistically informed knowledge, while not requiring specific vocabulary to indicate that an event is occurring, dipta et al. (2022) had strong performance with a reasonable explanation of what each part of the neural network is doing. in terms of planning with lms, there are multiple interesting approaches. @xcite trained an lm, called palm-e to also accept image and continuous sensor data, as well as text. by encoding the non-text data into vectors that are the same size as a text vector, the model can complete a variety of tasks straight out of the box while also allowing for downstream fine-tuning. notably, it can output plain text that can be interpreted as a robotic policy, though palm-e has to interpret on its own what a particular robot's capabilities are. more testing needs to be done to see if the robot can behave consistently, and the authors caution that it is not meant for long-term tasks. another model made by @xcite utilizes an upper level lm, in their case gpt, with some few-shot training for high-level policy planning. they separately designed a lower level model that handles the execution of movement and other low-level tasks. importantly, if the lower level model can't execute a task, it can query the higher level model with the information it perceived about the environment for an updated policy. this enables it to handle long term, complex tasks. however, both of these models lack the explainable nature of @xcite with its basis in linguistic theory. ## future work and conclusion given the overall success of these experiments, we have several avenues of future work. first, we want to test how different lms perform on our dataset. while distilbert satisfied our theoretical computational constraints, there's a strong chance that newer and larger masked lms will perform even better on our dataset. testing on other lms will also further solidify our dataset as a useful analysis tool for object-related common sense. we also want to do a more in-depth statistical analysis of how distilbert performed by function, perhaps grouping functions to get coarser granularity to understand which functions need the most finetuning for a lm to succeed. with the recent advent of multi-modal lms like palm-e and gpt-4 (openai, 2023), our research interests are quickly shifting towards utilizing these models for grounded common-sense understanding. it is possible these may be more aware of physical limitations due to images (and in palm-e's case, robotic policy) in the training data. while these models do have some ability to explain their de-cision making process, there is much to discover in terms of the models' full capabilities. we are also interested in examining few-shot fine-tuning with syntactic and semantic information to improve both common-sense performance and the model's ability to explain itself. our hope is that combining new multi-modal models with linguistic insight will make a more trust-worthy model that can be successfully deployed in disaster-relief missions. we set out to discover if lms can provide the type of apriori, commonsense knowledge of the functions of various objects, especially those deemed important to robot-based, disaster relief missions. this is important because this technology could lead to replacing humans with robots in dangerous scenarios that have little room for error. we systematically identified the function each object plays in our domain, then created two tasks to test the granularity of a lm's ability to differentiate between these functions. distilbert performed quite strongly on our tasks, validating our proof of concept. even when removing the bias of humangenerated wrong answers, we still obtained strong results indicating that distilbert has significant knowledge about our domain. we are finding new avenues to expand our research into using more advanced lms in tandem with resources encoding linguistic knowledge to improve collaborative, physically situated human-robot dialogue.