Causal Inference in Natural Language Processing: Estimation, Prediction, Interpretation and Beyond (2022)

Abstract: A fundamental goal of scientific research is to learn about causal relationships. However, despite its critical role in the life and social sciences, causality has not had the same importance in Natural Language Processing (NLP), which has traditionally placed more emphasis on predictive tasks. This distinction is beginning to fade, with an emerging area of interdisciplinary research at the convergence of causal inference and language processing. Still, research on causality in NLP remains scattered across domains without unified definitions, benchmark datasets and clear articulations of the challenges and opportunities in the application of causal inference to the textual domain, with its unique properties. In this survey, we consolidate research across academic areas and situate it in the broader NLP landscape. We introduce the statistical challenge of estimating causal effects with text, encompassing settings where text is used as an outcome, treatment, or to address confounding. In addition, we explore potential uses of causal inference to improve the robustness, fairness, and interpretability of NLP models. We thus provide a unified overview of causal inference for the NLP community.1

## introduction the increasing effectiveness of nlp has created exciting new opportunities for interdisciplinary collaborations, bringing nlp techniques to a wide range of external research disciplines (e.g., @xcite @xcite and incorporating new data and tasks into mainstream nlp (e.g., @xcite . in such interdisciplinary collaborations, many of the most important research questions relate to the inference of causal relationships. for example, before recommending a new drug therapy, clinicians want to know the causal effect of the drug on disease progression. causal inference involves a question about a counterfactual world created by taking an intervention: what would a patient's disease progression have been if we had given them the drug? as we explain below, with observational data, the causal effect is not equivalent to the correlation between whether the drug is taken and the observed disease progression. there is now a vast literature on techniques for making valid inferences using traditional (non-text) datasets (e.g., @xcite , but the application of these techniques to natural language data raises new fundamental challenges. conversely, in many classical nlp applications, the main goal is to make accurate predictions: any statistical correlation is admissible, regardless of the underlying causal relationship. however, as nlp systems are increasingly deployed in challenging and high-stakes scenarios, we cannot rely on the usual assumption that training and test data are identically distributed, and we may not be satisfied with uninterpretable black-box predictors. for both of these problems, causality offers a promising path forward: domain knowledge of the causal structure of the data generating process can suggest inductive biases that lead to more robust predictors, and a causal view of the predictor itself can offer new insights on its inner workings. the core claim of this survey paper is that deepening the connection between causality and nlp has the potential to advance the goals of both social science and nlp researchers. we divide the intersection of causality and nlp into two areas: estimating causal effects from text, and using causal formalisms to make nlp methods more reliable. we next illustrate this distinction. example 1. an online forum has allowed its users to indicate their preferred gender in their profiles with a female or male icon. they notice that users who label themselves with the female icon tend to receive fewer ''likes'' on their posts. to better evaluate their policy of allowing gender information in profiles, they ask: does using the female icon cause a decrease in popularity for a post? ex. 1 addresses the causal effect of signaling female gender (treatment) on the likes a post receives (outcome) (see discussion on signaling at @xcite . the counterfactual question is: if we could manipulate the gender icon of a post, how many likes would the post have received? the observed correlation between the gender icons and the number of ''likes'' generally does not coincide with the causal effect: it might instead be a spurious correlation, induced by other variables, known as confounders, which are correlated with both the treatment and the outcome (see @xcite , for an early discus-sion of spurious correlation in nlp). one possible confounder is the topic of each post: posts written by users who have selected the female icon may be about certain topics (e.g., child birth or menstruation) more often, and those topics may not receive as many likes from the audience of the broader online platform. as we will see in § 2, due to confounding, estimating a causal effect requires assumptions. example 1 highlights the setting where the text encodes the relevant confounders of a causal effect. the text as a confounder setting is one of many causal inferences we can make with text data. the text data can also encode outcomes or treatments of interest. for example, we may wonder about how gender signal affects the sentiment of the reply that a post receives (text as outcome), or about how a writing style affects the ''likes'' a post receives (text as treatment). nlp helps causal inference. causal inference with text data involves several challenges that are distinct from typical causal inference settings: text is high-dimensional, needs sophisticated modeling to measure semantically meaningful factors like topic, and demands careful thought to formalize the intervention that a causal question corresponds to. the developments in nlp around modeling language, from topic models @xcite to contextual embeddings (e.g., @xcite , offer promising ways to extract the information we need from text to estimate causal effects. however, we need new assumptions to ensure that the use of nlp methods leads to valid causal inferences. we discuss existing research on estimating causal effects from text and emphasize these challenges and opportunities in § 3. ## background both focal problems of this survey (causal effect estimation and causal formalisms for robust and explainable prediction) involve causal inference. the key ingredient to causal inference is defining counterfactuals based on an intervention of interest. we will illustrate this idea with the motivating examples from §1. example 1 involves online forum posts and the number of likes y that they receive. we use a binary variable t to indicate whether a post uses a ''female icon'' (@xmath0. we view the post icon t as the ''treatment'' in this example, but do not assume that the treatment is randomly assigned (it may be selected by the posts' authors). the counterfactual outcome y (1) represents the number of likes a post would have received had it used a female icon. the counterfactual outcome y (0) is defined analogously. the fundamental problem of causal inference @xcite ) is that we can never observe y (0) and y (1) simultaneously for any unit of analysis, the smallest unit about which one wants to make counterfactual inquiries (e.g., a post in ex. 1). this problem is what makes causal inference harder than statistical inference and impossible without identification assumptions (see § 2.2). example 2 involves a trained classifier f (x) that takes a textual clinical narrative x as input and outputs a diagnosis prediction. the text x is written based on the physician's diagnosis y , and is also influenced by the writing style used at the hospital z. we want to intervene upon the hospital z while holding the label y fixed. the counterfactual narrative x(z) is the text we would have observed had we set the hospital to the value z while holding the diagnosis fixed. the counterfactual prediction f (x(z)) is the output the trained classifier would have produced had we given the counterfactual review x(z) as input. ## estimating causal effects with text in §2, we described assumptions for causal inference when the treatment, outcome, and confounders were directly measured. in this section, we contribute a novel discussion about how causal assumptions are complicated when variables necessary for a causal analysis are extracted automatically from text. addressing these open challenges will require collaborations between the nlp and causal estimation communities to understand what are the requisite assumptions to draw valid causal conclusions. we highlight prior approaches and future challenges in settings where the text is a confounder, the outcome, or the treatment -but this discussion applies broadly to many text-based causal problems. to make these challenges clear, we will expand upon example 1 by supposing that a hypothetical online forum wants to understand and reduce harassment on its platform. many such questions are causal: do gendered icons influence the harassment users receive? do longer suspensions make users less likely to harass others? how can a post be rewritten to avoid offending others? in each case, using nlp to measure aspects of language is integral to any causal analysis. ## robust and explainable predictions from causality thus far we have focused on using nlp tools for estimating causal effects in the presence of text data. in this section, we consider using causal reasoning to help solve traditional nlp tasks such as understanding, manipulating, and generating natural language. at a first glance, nlp may appear to have little need for causal ideas. the field has achieved remarkable progress from the use of increasingly high-capacity neural architectures to extract correlations from large-scale datasets @xcite @xcite . these architectures make no distinction between causes, effects, and confounders, and they make no attempt to identify causal relationships: a feature may be a powerful predictor even if it has no direct causal relationship with the desired output. yet correlational predictive models can be untrustworthy @xcite : they may latch onto spurious correlations (''shortcuts''), leading to errors in out-of-distribution (ood) settings (e.g., @xcite ; they may exhibit unacceptable performance differences across groups of users (e.g., @xcite ; and their behavior may be too inscrutable to incorporate into high-stakes decisions @xcite . each of these shortcomings can potentially be addressed by the causal perspective: knowledge of the causal relationship between observations and labels can be used to formalize spurious correlations and mitigate their impact ( § 4.1); causality also provides a language for specifying and reasoning about fairness conditions ( § 4.2); and the task of explaining predictions may be naturally formulated in terms of counterfactuals ( § 4.3). the application of causality to these problems is still an active area of research, which we attempt to facilitate by highlighting previously implicit connections among a diverse body of prior work. ## conclusion our main goal in this survey was to collect the various touchpoints of causality and nlp into one space, which we then subdivided into the problems of estimating the magnitude of causal effects. and more traditional nlp tasks. these branches of scientific inquiry share common goals, intuitions, and are beginning to show methodological synergies. in § 3 we showed how recent advances in nlp modeling can help researchers make causal conclusions with text data and the challenges of this process. in § 4, we showed how ideas from causal inference can be used to make nlp models more robust, trustworthy, and transparent. we also gather approaches that are implicitly causal and explicitly show their relationship to causal inference. both of these spaces, especially the use of causal ideas for robust and explainable predictions, remain nascent with a large number of open challenges which we have detailed throughout this paper. a particular advantage of causal methodology is that it forces practitioners to explicate their assumptions. to improve scientific standards, we believe that the nlp community should be clearer about these assumptions and analyze their data using causal reasoning. this could lead to a better understanding of language and the models we build to process it.