Exploring the Capacity of Pretrained Language Models for Reasoning about Actions and Change (2023)

Abstract: Reasoning about actions and change (RAC) is essential to understand and interact with the ever-changing environment. Previous AI research has shown the importance of fundamental and indispensable knowledge of actions, i.e., preconditions and effects. However, traditional methods rely on logical formalization which hinders practical applications. With recent transformer-based language models (LMs), reasoning over text is desirable and seemingly feasible, leading to the question of whether LMs can effectively and efficiently learn to solve RAC problems. We propose four essential RAC tasks as a comprehensive textual benchmark and generate problems in a way that minimizes the influence of other linguistic requirements (e.g., grounding) to focus on RAC. The resulting benchmark, TRAC, encompassing problems of various complexities, facilitates a more granular evaluation of LMs, precisely targeting the structural generalization ability much needed for RAC. Experiments with three high-performing transformers indicate that additional efforts are needed to tackle challenges raised by TRAC.

## introduction reasoning about actions and change (rac) has been a central issue since the early days in ai @xcite and received much attention from the nlp community @xcite @xcite . classical ai has long recognized the importance of actions and characterized the fundamental knowledge about actions: preconditions and effects @xcite . preconditions are the conditions that must be satisfied when actions are executed, while effects define the result. consider the example where an agent is moving containers in a dock: suppose a red container is on top of a green one, and the agent is given an instruction to "move the green container to another * corresponding author platform". to achieve such a goal, it needs to know the preconditions of moving a container (there is not any other container on top of it) and the effect of such actions. while traditional approaches provide sound and effective reasoning by capturing preconditions and effects, they rely on expensive and difficult formalization. consequently, inducing knowledge from text and reasoning directly is becoming more preferable. as transformers have shown their promising potential in many linguistic tasks @xcite , we set out to probe whether pretrained language models can master the ability of reasoning about actions and changes. previous approaches involving actions in nlp are more application-centric and usually contain specific tasks (e.g. instruction following, prediction) @xcite without considering both preconditions and effects. in general these tasks are not verified logically. on the other hand, there exist some template-based datasets, such as the one in @xcite , which are logically sound and generated from several simple rules. unfortunately, they pay more attention to general deduction in a static perspective, while rac problems require repeated changes. we propose textual reasoning about actions and change (trac), a comprehensive suite of four fundamental and granular rac reasoning tasks, inspired by traditional reasoning problems @xcite . recognizing the utmost importance of preconditions and effects, we include the two fundamental tasks, projection and executability, which directly target the essential knowledge of rac. we also provide two composite tasks, plan-verification and goal-recognition for more comprehensive problem settings. together, the four aspects of trac enable a more granular evaluation. we position trac as a diagnostic benchmark that is a more direct and precise embodiment of rac abilities: we employ two principles in dataset construction. firstly, we minimize the impact of other important abilities (e.g. grounding and language variance) for a "clean-room" evaluation that solely focuses on rac. secondly, we desire reasoning problems with controlled complexities for testing structural generalization. we design a framework that takes the action domain knowledge and the textual template as input, generates symbolic problems, and synthesizes the textual problems. in this paper, we select the blocks world @xcite , a typical action domain for a proof-of-concept. however, the framework is domain-agnostic and is thus extensible to other action domains. we design generalization tests based on the observation that once the classical ai systems are endowed with knowledge of actions, they can effectively solve structurally more complex problems. therefore, we lay out four aspects of generalization experiments: 1) with more objects; 2) with longer action sequences; 3) with unseen names of objects; 4) with unseen conjunctive conditions. we train neural language models (lms) of three highperforming transformer architectures, testing their efficiency and effectiveness on the trac datasets. the result shows that while transformers are able to induce and utilize knowledge from a large number of training examples, it remains a great challenge to efficiently generalize to structurally more complex problems on trac. ## related work recent nlp tasks are embracing reasoning. while machine reading tasks such as squad @xcite require inference to some extent, our work is the first one as we know to systematically study textual rac. reasoning about dynamic worlds is also needed in commonsense tasks such as the winograd schema challenge @xcite . but environments in such tasks did not model well-defined actions and change. compared to these tasks, our concern is formal reasoning that supports sound conclusions. our work is distinct from previous attempts of formal reasoning in natural language. natural logic studies valid inference over natural language @xcite , but its recent developments focus on reasoning about semantic relations between lexical terms @xcite . meanwhile, transformers have achieved promising results on textual deduction tasks @xcite . while they target general deduction such as "round people are nice; bob is round; thus bob is nice", we dedicate our work to rac and requires systems to learn the knowledge from examples. previous work has been exploring nlp tasks involving actions, especially with instruction following, action outcome prediction and procedural text generation tasks. trac is unique in its focus on fundamentals, broad coverage of reasoning tasks, and the granularity. linguistic requirements (e.g. the ability of grounding and handling languge variance), though important, are foreign to rac and are thus avoided. compared to application-centric tasks, our work provides a more abstract view of tasks that embody the fundamental requirements of rac. moreover, this paper proposes a suite of generalization tests that target structural complexities in rac, which enables more fine-grained tests. instruction following (if): agents are given textual directives to execute actions in an environment. in @xcite , agents receive visual features or spatial coordinates as input. more importantly, if does not target directly preconditions and effects as we do. prediction: projection and prediction both concern the effect of actions. in @xcite , symbolic attributes represent the world instead of language. questions in babi @xcite and propara @xcite ask about change of objects. however, they neglect the equally important preconditions. procedure generation: predicting the next instruction @xcite or next step @xcite might relate to the executability of actions, but they only cover partial rac illustrated in this paper. while understanding the preconditions is needed, it could also implicate other extraneous factors such as the preferences of the instructor. generalization has always been a desirable trait. in @xcite , the authors attacked if systems with adversarial examples (e.g. with slight perturbations). long-horizon problems are shown to be non-trivial for neural planners @xcite . our evaluation with transformers further corroborate the observation. additionally, trac imposes more structural generalization requirements in a more granular way. ## trac in this section, we first introduce the theoretical background before we lay out the four tasks and discuss dataset generation. the dataset is available at https://github.com/sysulic/trac . ## discussion although we are optimistic about the future of transformers, their performances in the generalization tests indicate that transformers alone are not enough for rac: firstly, the reasoning problems in this proof-of-concept evaluation involve few actions objects that would be quite effortless for humans. secondly, the scale of generalization is rather minor (from three actions to four or five actions; from five objects to ten objects). yet we could observe the struggle of transformers with such minute structurally complex problems. as illustrated in @xcite , transformers capture meaning in texts to some extent, which indicates that they have potential in modeling actions and change. such potentials can also be seen in our experiments when transformers are given more than abundant training examples. meanwhile, @xcite showed that dedicated neural components other than transformers could help model state changes and predictions. these lead us to the conjecture that additional mechanisms that model the preconditions and effects could be the next objectives towards solving trac problems. ## limitations more complex domains. we choose the bw for its intuitive and simplistic nature (with one kind of object, three types of actions, and three predicates). although the generalization experiments suffice currently to challenge transformers, realworld situations are more complicated. with the improvement of the algorithms, the need for a better arrangement of actions domains is emerging. in time, it could be beneficial to include several domains with various levels of complexities. balance between rigor and natural. for now, the synthesized english sentences are generated using a fixed template. whilst being accurate without ambiguity, the resulting text is still quite formal. it would be valuable to add variety in the expressions without losing precision. better solvers. as our demonstrations suggest, current lms still fall short on the generalization tests. we hope that our work will pique interests in the community towards reasoning about actions and change, and challenge approaches to undertake the fundamental reasoning tasks. ## conclusion in a time where language models excel at many natural language tasks, including deductive ones, we revisit the key reasoning abilities for dynamic worlds with actions and change. while preserving the essence of traditional formal reasoning, we set out to investigate how well transformers can reason rigorously over textual input, which avoids the need for a complete formalization of each specific problem. using the semantics of strips, we characterize four essential reasoning tasks about actions and change to form the trac benchmark. we devise a framework to generate symbolic problems and transform them into text, resulting in a suite of datasets of various complexities. we also design four further experiments that target different aspects of structural generalization. built upon the high-performing transformers, the baselines are put to the test under different settings. although they show promising results on in-distribution problems provided with more-than-abundant training examples, it is the out-of-distribution generalization tests that cause troubles. we argue that trac tasks could be used to 1) expand our understanding of the limitations of transformers and, 2) serve as a challenge for generalization in rac over text. in the future, we expect to see more interesting work based on trac, such as better solvers with mechanisms to learn both preconditions and effects, and novel generalization tests that call for more specific reasoning abilities.