Causal Reasoning of Entities and Events in Procedural Texts (2023)

Abstract: Entities and events are crucial to natural language reasoning and common in procedural texts. Existing work has focused either exclusively on entity state tracking (e.g., whether a pan is hot) or on event reasoning (e.g., whether one would burn themselves by touching the pan), while these two tasks are often causally related. We propose CREPE, the first benchmark on causal reasoning of event plausibility and entity states. We show that most language models, including GPT-3, perform close to chance at .35 F1, lagging far behind human at .87 F1. We boost model performance to .59 F1 by creatively representing events as programming languages while prompting language models pretrained on code. By injecting the causal relations between entities and events as intermediate reasoning steps in our representation, we further boost the performance to .67 F1. Our findings indicate not only the challenge that CREPE brings for language models, but also the efficacy of code-like prompting combined with chain-of-thought prompting for multihop event reasoning.

## introduction event-centric natural language processing @xcite is one of the leading paradigms in machine understanding of texts. this line of work focuses on first extracting entities and events from texts @xcite and then making inferences about them @xcite . even with the recent advances of large language models (llms), reasoning about events remains challenging as it requires highly contextual information and ample common-sense knowledge. for example, the event "adding water to a pan containing hot oil" causes the event "there is a sizzling sound" to happen, while "heat up an empty pan" does not. any model that can draw the correct conclusion given these contexts is expected to have access to some implicit knowledge about these entities and events. one type of text which demonstrates these challenges is procedural text, namely sequences of events, such as how-to instructions, recipes, natural processes, scientific protocols, etc. procedural texts describe an environment that changes dynamically through a sequence of steps. therefore, the exact environment configuration is often implicit. in the previous cooking example, whether "there is a sizzling sound" depends on what steps have taken place. with these interesting challenges coupled with the added benefit of application to robotics @xcite and household smart assistants such as alexa @xcite , reasoning about procedures attracts great attention from the nlp community @xcite . most work on reasoning about procedural texts has focused solely on either predicting the proper-ties of events (e.g., which event is more likely to happen) @xcite @xcite or tracking entity states (e.g., what is some property of an entity after some step) @xcite , while the causal relation between events and entities is largely underexplored -for example, whether "there is a sizzling sound" is determined by the state of "water" and "oil." therefore, we claim that many event prediction tasks are multihop reasoning tasks that require the knowledge of intermediate entity states. causal reasoning about events and entities differs from existing multihop reasoning tasks, such as @xcite ; @xcite whose reasoning process is explicitly formulated by a direct question (e.g., how old is the previous us president); @xcite whose supporting evidence is factual and static. in contrast, causal reasoning in procedures requires models to first figure out the relevant entity attributes, then infer their states based on the current context, and finally predict the event. to this end, we propose the task of causal reasoning of entities and events in procedural texts (crepe), with an overview in figure 1 . given a procedure consisting of a goal ("stir fry vegetables") and some steps ("rinse vegetable"...), a model is to predict the likelihood of some unobserved events ("there is a sizzling sound") after the execution of each step. we provide a handcrafted, high-quality benchmark containing 183 procedures, 1219 steps, and 324 changes in the likelihood of events along with the corresponding underlying entity state changes. in an in-context learning setting, we show that most llms including gpt-3 @xcite perform no better (.350 f1) than chance (.297 f1), greatly underperforming the human performance of .868 f1, on the development set. providing ground-truth entity state changes to the prompt of gpt-3 shows no performance gain, indicating that it cannot leverage this causal signal. instead, we draw inspiration from @xcite who represented texts as programming languages as the prompt to code language model codex @xcite to perform event reasoning. we propose a novel python code representation of procedures that achieves .585 f1. furthermore, our code-like representation allows us to effectively encode and leverage predicted or labeled entity state changes by generating them as an intermediate reasoning step (namely, chain-of-thought), boosting the performance to .667 using predicted entity state changes and .715 f1 using labeled entity state changes. our contributions are summarized as follows: • we propose a novel task, a dataset, and several strong baselines for causal reasoning about events and entities in procedural texts. ## task and hypothesis a procedure p of length n consists of a goal g and some steps s 1 . . . s @xmath0, each represented as a short sentence. each procedure is associated with a set of hypothetical events e 1 . . . e @xmath1. the task is to predict the change of likelihood of a hypothetical event e j from step s i-1 (the previous step) to step s i (the current step): the likelihood change δ i is positive if the label is "more likely", negative if "less likely", or zero if "equally likely". predicting the likelihood of hypothetical events, also known as counterfactual reasoning, is extremely important for machine reasoning @xcite (see more in section 7). in our work, we hypothesize that the causal relation between entity changes and events can be leveraged by llms to better perform counterfactual reasoning. in other words, any change of the likelihood of a hypothetical event is given rise to by changes of some entity attributes a 1 . . . a @xmath2. ## dataset our crepe benchmark dataset has two portions. the first is handcrafted and cross-validated by six authors of this paper. the annotation happens in 3 phases: (1) we first write down or acquire a procedure from the web; (2) we then annotate some hypothetical events whose likelihood of happening changes throughout the procedure, and how their likelihood change after each step; (3) for each event, we annotate a tuple of entity, attribute, and change that causes the event likelihood change. to obtain interesting and challenging data, we require annotators to write procedures covering a diverse range of topics and to prioritize events that undergo multiple likelihood changes, and those that involve information implicit from the steps. in our work, we strictly use this portion as the development set to inform all our experimental designs. the second portion, designed to be drawn from a different distribution to minimize bias, was annotated by students in an artificial intelligence class at the university of pennsylvania who participated in an extra-credit assignment. the students were given an overview of the project and some guidelines to annotate data with the aforementioned criteria. we carefully validated all resulting annotations by discarding or editing erroneous and inappropriate examples. in our work, we strictly use this portion as the test set to evaluate the generalization ability of our final models. the complete dataset and annotation instructions can be found in our public repository containing no personally identifiable information of any annotator. the statistics of crepe are in ## event likelihood prediction the task of crepe is essentially ternary classification, where the likelihood change of each event after each step is labeled as one of "more likely", "less likely", or "equally likely". in this section, all models have no access to the annotated entity state changes until later sections. ## causal reasoning with entities when a human tries to predict whether the event "one would get burnt by touching a pan" is likely, their reasoning process would first focus on some entities in the question (e.g., "the pan"), then attend to some attributes and states of that entity (e.g., the temperature of the pan is hot), and finally draw a logical conclusion (e.g., "the pan being hot means one would get burnt by touching it.") crepe is constructed precisely with this thought process in mind. an entity-attribute-change tuple is annotated along with each event likelihood change. in this section, we study how to explicitly leverage the intermediate information to assist the prediction of event likelihood prediction. ## performance analysis in this section, we analyze potential factors that play a role in our codex model's performance. we investigate three factors: (1) the number of steps in a procedure; (2) explicit mentions of event-related entity-of-interest (eoi) in a given step; and (3) the logical relation (entailment or contradiction) between the event likelihood change and its related entity state change. to study factor (1), we dichotomize procedures from the development set by the average length of the procedure. to investigate factors (2) and (3), we manually labeled the ground truth eoi mentioning and logical relation for the development dataset. intuitively, estimating event likelihood in lengthy procedures and in steps where eoi is not explicitly mentioned would be difficult. rather surprisingly, codex shows no significant performance discrepancy under factors (2) and ( 3 ), and only a slight performance difference in factor (1) (see appendix c). further, the task of crepe can be divided into two sub-tasks, first to identify whether an event likelihood change occurred at all, and then to classify the change as either more or less likely. we observe that cot codex outperforms codex on both sub-tasks. for the classification task, in particular, cot codex obtained a .149 increase in macro f1 score from .805 to .954. this shows not only that cot codex is effective, but also that its bottleneck is identifying event likelihood change. ## related work event & entity extraction and representation event-centric nlp has been a dominant strand of approaches to machine reasoning. myriad work has focused on extracting events from the news or web data @xcite @xcite . the effort of structurally representing scripts, groups of events in certain scenarios including procedures, started decades ago @xcite and is receiving revived attention in present years @xcite . while this line of work mostly focuses on the representation as relations (e.g., temporal, hierarchical) among events, we recognize entities as a cause of event relations and thus propose a more granular representation. furthermore, structured representations of events typically cannot take advantage of the power of textual llms for challenging downstream tasks. in contrast, we advance towards the best of two worlds by working with code language models. besides, existing work on jointly extracting and representing events and entities @xcite @xcite neglects the causal relation therein and treats entities and events simply as two related tasks to be tackled simultaneously. we causally bridge the two. entity state tracking prior work on entity state tracking spans various disciplines of ai. for instance, object tracking, a sub-task of entity state tracking, has led to much work in both robotics @xcite and computer vision @xcite . in nlp, early efforts focus on synthetic, closed-domain data @xcite and more recent ones shift attention to real-world procedures @xcite @xcite @xcite with a closed set of entities and attributes or an open-ended set @xcite . in all prior work, entity state track is treated as an end-task, whereas we treat it as a critical intermediate step for event reasoning, a more practical application. counterfactual reasoning in this work, we hope to provide evidence that signals of entities effectively help models reason about events. we specifically focus on hypothetical event reasoning because it is a high-level cognitive ability beyond pattern recognition and a manifestation of complex reasoning ability @xcite . counterfactual reasoning has a long history with formal methods @xcite . less modern work exists in commonsense @xcite , procedural texts @xcite , and even computer vision @xcite . multihop reasoning prior studies on multihop reasoning mainly focus on question answering from a passage @xcite @xcite @xcite and representing and utilizing multihop information in the form of structured data @xcite @xcite @xcite @xcite @xcite . there are also efforts such as decomprc, strat-egyqa, and cgde-fgin that attempt to conduct multihop reasoning by decomposing the original task to a series of logically related sub-tasks @xcite @xcite . such an approach has recently seen great success with the chain-of-thought (cot) prompting of gpt-3, which significantly improves numerous multihop reasoning tasks @xcite @xcite . following cot prompting, self-ask further elicits cot by demanding gpt-3 to explicitly generate the reasoning questions raised during its chain-of-thought process @xcite . ## conclusion and future work we present crepe, a benchmark for causal reasoning about events and entities in procedural texts. we show that mainstream llms such as gpt-3 perform close to chance on crepe, while using code-like event representation as a prompt to code language model codex greatly improves the performance. further, we experiment with various ways to encode entity information into this representation and find that eliciting chain-of-thought reasoning from codex further improves performance while existing cot approaches with gpt-3 are ineffective. we clearly show that llms benefit from lower-level entity information when making predictions about higher-level events. future work should explore related tasks such as next-event prediction, event temporal ordering, etc., by injecting relevant information about entities into our representation. our code-representation of events allows more powerful expressions than simply entailment and negation considered in this work. future work may explore other forms of code chain-of-thought such as first-order logic. these expressions generated by llms can be computed objectively, thus ameliorating llms' hallucinations and improving the interpretability and faithfulness of predictions.