LOA : Logical Optimal Actions for Text-based Interaction Games (2021)

Abstract: We present Logical Optimal Actions (LOA), an action decision architecture of reinforcement learning applications with a neuro-symbolic framework which is a combination of neural network and symbolic knowledge acquisition approach for natural language interaction games. The demonstration for LOA experiments consists of a web-based interactive platform for text-based games and visualization for acquired knowledge for improving interpretability for trained rules. This demonstration also provides a comparison module with other neuro-symbolic approaches as well as non-symbolic state-of-the-art agent models on the same text-based games. Our LOA also provides open-sourced implementation in Python for the reinforcement learning environment to facilitate an experiment for studying neuro-symbolic agents. Demo site: https://ibm.biz/acl21-loa , Code: https://github.com/ibm/loa

## introduction neuro-symbolic (ns) hybrid approaches have been proposed for overcoming the weakness of deep reinforcement learning @xcite @xcite , including less training data with generalization, external knowledge utilization, and direct explainability of what is learned. study of reinforcement learning (rl) in non-symbolic environments, such as those with natural language and visionary observations, would be an important step towards the real-world application of the approaches beyond classic and symbolic environments. under certain controls necessary for studying rl, text-based games provide complex, interactive, and a variety of simulated environments where the environmental game state observation a recent neuro-symbolic framework called the logical neural networks (lnn) @xcite simultaneously provides key properties of both neural networks (learning) and symbolic logic (reasoning). the lnn can train the constraints and rules with logical functions in the neural networks, and since every neuron in the network has a component for a formula of weighted realvalued logics, it can calculate the probability and contradiction loss for each of the propositions. at the same time, trained lnn follow symbolic rules, which means they yield a highly interpretable disentangled representation. using this benefit of lnn, we proposed a neuro-symbolic rl method that uses pre-defined external knowledge in logical networks, and the method successfully plays on the text-based games @xcite . in this demonstration (demo site: https://ibm.biz/acl21-loa ), we present a logical optimal actions (loa) architecture for neuro-symbolic rl applications with lnn @xcite ) for text-based interaction games. while natural language-based interactive agents are the ambitious but attractive target as real-world applications of neuro-symbolic, it is not easy to provide an environment for the agent. the proposed demonstration uses text-based games learning environment, called textworld @xcite , as a miniature of a natural languagebased interactive environment. the demonstration provides a web-based user interface for visualizing the game interaction, which is including displaying the natural text observation from the environment, typing the action sentence, and showing the reward value from the taken action. the loa in this demonstration also visualizes trained and pre-defined logical rules in lnn via the same interface, and this will help the human user understand the benefits of introducing the logical rules via neuro-symbolic frameworks. we also supply an open-sourced implementation for demo environment and some rl methods. this implementation contains our logical approaches and other state-of-the-art agents. ## logical optimal action our proposing loa is an rl framework which is combining logical reasoning and neural network training. these training and reasoning are provided from functionalities of lnn @xcite that is simultaneously providing key properties of both neural networks and symbolic logic. figure 1 shows the overview architecture for loa. the loa model receives the logical state value as logical fact from the language understanding component which receives raw natural language state value from the environment. the model forwards into lnn for the input to get the optimal action for it, the action goes into the environment to execute the action command, then reward is input to loa agent. the loa will be trained the action decision network in lnn by using the acquired reward value and chosen action from the network. ## loa demo the proposing web-based loa demonstration supports two functionalities: 1) play the text-based game by human interactions, 2) visualize the trained and pre-defined lnn to increase interpretability for acquired rules. for playing the games by web interface, fig. 2 shows an initial view for the loa demonstration. on the left-hand side, we can choose the game from some existing text-based interaction games foot_0 , such as textworld coin-collector game @xcite , textworld cooking game @xcite , textworld commonsense cleanup game (keerthiram murugesan and campbell, 2021), and jericho game @xcite . figure 3 shows the view for playing the textworld game, and fig. 4 shows the view for another game (cleanup task). the human player can input any action by natural language then the demonstration system displays the raw observation output from the environment. for visualizing the trained and pre-defined neurosymbolic network in lnn, fig. 5 and fig. 6 show the example of the lnn output. in these figures, the lnn contains simple rules for the textworld coin-collector game; for example, the rule is the agent takes 'go east' action, when the agent finds the east room ("found west" → "go west"). the round box explains the proposition from the given observation inputs, the circle with a logical function means a logical function node of lnn, and the rectangle box explains an action candidate for the agent. the highlighted nodes (red node) have 'true' value, and nonhighlighted nodes (white node) have 'false' value. in fig. 5 , the agent found the north exit from the given observation ("observation (@xmath0, then the going north room action ("go north") are activated. in fig. 6 , if the user clicks the selectable box, the loa recommends only one action which is 'go north'. in this demonstration, we show the benefit of introducing the lnn into an rl agent, we don't prepare to automatically choose the action by loa framework. however, if we execute the rl with loa framework, the rl agent can converge faster than other non-symbolic and neuro-symbolic methods. after selecting "go north" action at @xmath1, next observation sentence and lnn output for next step are shown in fig 7 . in this step, the agent found two doors, which are east and south; however, the south door is connected to the previous room because the agent took going north action at the previous step. since this lnn is simple lnn, the "go south" action is also recommended in fig 7 . figure 8 shows the output of the complicated lnn which has functionality for avoiding revisiting the visited room. by using such the lnn, loa can output only "go east" action by having contradiction loss in lnn. this is a benefit of introducing the neuro-symbolic framework, and the human user can easily understand the reason for the taken action by the agent with this interpretability by loa. ## conclusion we propose a novel demonstration (url: https://ibm.biz/acl21-loa ) which provides to play the text-based games on the web interface and visualize the benefit of the neuro-symbolic algorithm. this application helps the human user understand the trained network and the reason for taken action by the agent. we also extend more complicated lnn for other difficult games on the demo site. at the same time, we open the source code for the demonstration (url: https://github.com/ibm/loa ).