Generating Justifications in a Spatial Question-Answering Dialogue System for a Blocks World (2021)

Abstract: As AI reaches wider adoption, designing systems that are explainable and interpretable becomes a critical necessity. In particular, when it comes to dialogue systems, their reasoning must be transparent and must comply with human intuitions in order for them to be integrated seamlessly into day-to-day collaborative human-machine activities. Here, we describe our ongoing work on a (general purpose) dialogue system equipped with a spatial specialist with explanatory capabilities. We applied this system to a particular task of characterizing spatial configurations of blocks in a simple physical Blocks World (BW) domain using natural locative expressions, as well as generating justifications for the proposed spatial descriptions by indicating the factors that the system used to arrive at a particular conclusion.

## introduction while black box models like @xcite demonstrate impressive performance on a variety of isolated benchmarks, they are still subject to significant drawbacks @xcite . in particular, as ai systems reach wider adoption, explainability and interpretability become critical features. it is our belief that, instead of focusing exclusively on bigger datasets and models, or cross-modal learning, a somewhat different approach is required, viz., replacement of "tabula rasa" black boxes with architectures that utilize structured representations based around general reasoning, while in a form still amenable to deep learning techniques. below, we describe our ongoing work on a system composed of a general-purpose dialogue manager and a spatial specialist module, capable of generating spatial descriptions of configurations in the physical blocks world domain and supplying justifications of its spatial descriptions. the domain contains several uniquely named blocks placed on a table, where a user can ask questions about relative block locations (e.g., "is the a block to the right of the b block?") and request clarifications on why particular relations hold. models for spatial prepositions used by the spatial specialist are probabilistic predicates computed hierarchically, in a tree-like fashion, as a combination of more primitive relations. these primitive relations in the tree hierarchy can be retrieved to provide an explanation for system's outputs. for example, assume that when asked about the location of the block a, the system generates a response of the form "the block a is next to the block b". if queried as to why the system arrived at that particular judgment, the spatial specialist retrieves the underlying component relations from which "next to" is composed (proximity and similar elevation) and returns the relevant relations to the dialogue manager that generates a human-readable response. ## related work recent years have seen a push towards explainable ai @xcite . while classical symbolic ai systems are typically both explainable and interpretable by design, with regard to explainability in a pure neural network setting, many recent efforts have been concentrated around modular neural network architectures @xcite @xcite and architectures that directly generate the explanations for their own operation @xcite . the former is concerned, in general, with building a network out of specified blocks (modules) trained to perform particular operation (e.g., finding, filtering, counting, etc.) on the input or process a certain aspect of the task (e.g., recognizing a category vs. recognizing a property such as color, etc.) explanations of the model's outputs then are derived from clear-cut understanding of the purpose of each module and their interconnections. the latter uses various additional blocks to generate explanations, e.g., in the form of plain english text, based directly on the model's inner state. our approach to spatial preposition modeling is inspired by the criteria that have been discussed in linguistically oriented studies @xcite @xcite . studies of human judgements of spatial relations show that overly formal qualitative models with sharp boundaries generally cannot do justice to the usage of locative expressions in natural settings. our models are implemented along the same general lines as those in @xcite and @xcite . these studies model prepositions as constructed from more basic physico-geometrical primitives. modern neural work on spatial relation-learning in the bw domain is exemplified by @xcite . ## blocks world system and eta dialogue manager fig. 1a , 1b depict our physical blocks world (consisting of a square table with several cubical blocks, two kinect sensors and a display) and the system's software architecture. the blocks are color-coded as green, red, or blue, and marked with corporate logos which serve as unique identifiers. the system uses audio-visual i/o: the block tracking module periodically updates the block positioning information by reading from the kinect cameras and an interactive avatar, david, is used for communication. the block arrangement is modeled as a 3d scene in blender, which acts as system's "mental image" of the state of the world, and all the spatial predicates are computed based on this 3d scene. the eta dialogue manager (dm) is responsible for semantic parsing and dialogue control. eta is designed to follow a modifiable dialogue schema, the contents of which are formulas in episodic logic @xcite with open variables describing successive steps (events) expected in the course of the interaction. these are either realized directly as instantiated actions, or expanded into sub-schemas. 1 in order to instantiate schema steps and interpret user inputs, the dm uses hierarchical pattern 1 intended actions obviated by earlier events may be deleted. transduction, similarly to the mechanism used by the lissa system @xcite to extract context-independent gist clauses given the prior utterance. transduction hierarchies specify patterns at their nodes to be matched to input, with terminal nodes providing result templates, or specifying a subschema. the pattern templates look for particular words or word features (including "wildcards" matching any word sequence of some length). eta uses gist clause extraction for tidying-up the user's utterance, and then derives an unscoped logical form (ulf) (kim and schubert, 2019) (a preliminary form of the episodic logic syntax of the dialogue schema) from the tidied-up input. ulf differs from similar semantic representations, e.g., amr, in that it is close to the surface form of english, type-consistent, and covers a rich set of phenomena. to derive ulfs, we introduced semantic composition into the transduction trees. the resulting parser is quite efficient and accurate for the domain at hand. the input is recursively broken into constituents, such as a vp segment, until a lexical subroutine supplies ulfs for individual words, which are propagated back up and composed into larger expressions by the "calling" node. the efficiency and accuracy of the approach lies in the fact that hierarchical pattern matching can segment utterances into meaningful parts, so that backtracking is rarely necessary. an example of a transduction tree being used for parsing a historical question into ulf is shown and described in figure 2 . as can be seen from this example, the resulting ulf retains much of the surface structure, but uses semantic typing and adds operators to indicate tense, inversion, and other linguistic phenomena. eta also has a limited coreference module utilizing syntactic constraints, recency, and other heuristics. figure 2 : an example ulf parse, with the input shown in red, a ulf parse tree shown in green, and the final query ulf shown in blue. the subclauses of a ulf formula are composed by hierarchical patterntransduction trees (each consisting of a number of patterns to match to a section of the input, together with a composition node), with the help of a lexical subroutine to handle leaf nodes. edges in the parse tree are labelled with the pattern-transduction tree that handles the corresponding subclause (typically responsible for a particular syntactic category). once the final ulf formula is obtained, the dialogue manager queries the spatial specialist module with the formula, and receives a list of relevant preposition factors (in ulf form). the dialogue manager uses a natural language generation (nlg) module to substitute these prepositions into the query ulf before using general linguistic rules to convert this to an answer ulf, which is then mapped to english to produce a verbal explanation. ## the spatial specialist the spatial specialist contains a family of models for spatial prepositions. each such model is imple-mented as a probabilistic predicate, computed hierarchically as a combination of more primitive relations that we call factors. these factors typically encode more basic relations that affect whether a particular spatial preposition holds. they are usually either different senses of the same preposition or they co-occur with the preposition in most/all configurations that license the usage of that preposition. the set of factors covers various geometric and structural properties, including distances between objects, direction from one object to another, support relations, physical contact, part structure, etc. the factors are combined according to one of several rules, such as multiplying two or more factors, finding the maximum, or taking a linear combination, in order to produce the final value for the preposition. some range of sense ambiguity is taken into account by considering different coordinate frames. in particular, for projective relations, such as to the right/left of, one can consider deictic, extrinsic and intrinsic senses. the deictic sense is computed based on the viewer's coordinate frame. here, one object is considered to be in the given relation to another, if its projection onto the viewer's visual plane is in that relation (e.g., to the right of) to the projection of the latter object. the extrinsic sense is based on the global coordinate system imposed by the world, i.e., front-right axes of the table. the intrinsic sense is determined based on the intrinsic coordinate system of the ground object, i.e., a is intrinsically to the right of b if it is on the right side of b. note that this sense is absent in the blocks world setting since blocks do not have intrinsic orientations, but it is added to support generality of the spatial models. for objects that do not have intrinsic orientations, the factor for the intrinsic sense of the relation is set to 0. when dealing with multiple senses, the model selects the one with the maximal value as an output. ## factor extraction for justification of model's judgments the tree-of-factors implementation of spatial models allows backwards-generated justifications spatial judgments. since factors represent higher-level semantic concepts, they can readily be translated into natural language. the tree of factors computed during the forward computation phase is preserved and is traversed in the backward direction starting from the root that represents the value of the preposition. the mechanism for factor retrieval is as follows. if the combination rule for the current node is a product, then if the node value is greater than 0.5, return all the child nodes; otherwise, return the child node with the smallest value. if the combination rule for the children is a weighted linear combination of factor values, then if the current node value is greater than 0.5, return the highest contributing factor node or nodes (total contribution includes their value and weight); otherwise, return the value of the node with the largest weight. finally, if the combination rule is the max operation, then if the current node value is greater than 0.5, return the child node with maximum value; otherwise return all the child nodes. as an example of the operation of the explanation procedure, consider the simplified factor network for to the right of in fig. 3 . the numbers in the nodes are the respective values of the factors that the node computes. assume that the system is being asked whether a is to the right of b. assume further that the final output value is right @xmath0.72, which corresponds to "yes". now, if the user inquires why the system arrived at that conclusion, the following process unfolds. the node for the final score for to the right of takes the maximum over three values: deictic right of deic , intrinsic right of intr and extrinsic right of extr . since the maximum is taken, one of those nodes must be equal to the final value. hence, the explanatory routine returns the corresponding node and its value (right of intr , 0.72). the corresponding interpretation will be (after the dialogue manager generates a response) "a is to the right of b because a is located on the right side of b, according to b's orientation". if asked further as to why the intrinsic relation holds, the system will analyze the intrinsic score's contributing factors, namely f dir (directional factor that defines the "right-side" region for an object) and f dd (distance decay, measuring how far apart the objects are). since the combination rule used is multiplication and the value of the current node (intrinsic right) is 0.72 (i.e., relation holds), it follows that both factors must hold as well. the system will return the list of the nodes and their values, i.e., [(f dir , 0.9), (f dd , 0.8)] as a result. the straightforward interpretation of the latter would be "a is on the right side of b, because it is located in the general rightward direction w.r.t. to b and it is close enough". this process can continue until leaf nodes are reached, which do not admit further decomposition and are treated as primitives. alternatively, let f @xmath1.4 (a is too far from b). this low value will propagate downstream and affect the right of intr and the final right of scores. the system then will supply a negative answer to the original question. if queried, it will return the list of all senses [(right of deic , 0.48), ...] which has a straightforward interpretation of "a is not to the right of b because none of the senses apply". if queried why, say, the intrinsic sense does not apply, the system returns the lowest-value node contributing to the intrinsic sense node, i.e., [(f dd , 0.4)], which translates into "a is too far from b to be on its right side". ## conclusion we described our work in progress concerning a dialogue system incorporating a spatial specialist with spatial semantic models that are based on clear and intuitively-grounded criteria, capable of generating justifications of spatial judgements produced by the system. the spatial subsystem incorporates hierarchical representations of spatial prepositions, constructed using so-called factors -intermediate simpler relations correlating with the occurrences of the prepositions. the explanation system scans the tree of these factors and retrieves the most relevant ones for the given situation. the configuration is inherently interpretable due to factors corresponding to intuitive criteria that seem to underlie the natural usage of prepositions.