Log In Sign Up

WT5?! Training Text-to-Text Models to Explain their Predictions

by   Sharan Narang, et al.

Neural networks have recently achieved human-level performance on various challenging natural language processing (NLP) tasks, but it is notoriously difficult to understand why a neural network produced a particular prediction. In this paper, we leverage the text-to-text framework proposed by Raffel et al.(2019) to train language models to output a natural text explanation alongside their prediction. Crucially, this requires no modifications to the loss function or training and decoding procedures – we simply train the model to output the explanation after generating the (natural text) prediction. We show that this approach not only obtains state-of-the-art results on explainability benchmarks, but also permits learning from a limited set of labeled explanations and transferring rationalization abilities across datasets. To facilitate reproducibility and future work, we release our code use to train the models.


page 1

page 2

page 3

page 4


You Can Do Better! If You Elaborate the Reason When Making Prediction

Neural predictive models have achieved groundbreaking performance improv...

How May I Help You? Using Neural Text Simplification to Improve Downstream NLP Tasks

The general goal of text simplification (TS) is to reduce text complexit...

Improving Neural Model Performance through Natural Language Feedback on Their Explanations

A class of explainable NLP models for reasoning tasks support their deci...

Explaining Natural Language Processing Classifiers with Occlusion and Language Modeling

Deep neural networks are powerful statistical learners. However, their p...

Contextual Text Denoising with Masked Language Models

Recently, with the help of deep learning models, significant advances ha...

MatchZoo: A Learning, Practicing, and Developing System for Neural Text Matching

Text matching is the core problem in many natural language processing (N...

The Irrationality of Neural Rationale Models

Neural rationale models are popular for interpretable predictions of NLP...

1 Introduction

Neural networks excel in a wide variety of practical settings, from computer vision to speech recognition to natural language processing (NLP) and beyond. In particular, over the past few years it has been shown that large language models pre-trained on an unlabeled text corpus can be subsequently fine-tuned to achieve superhuman performance on NLP tasks that had previously been considered difficult for machines

(Devlin et al., 2018; Peters et al., 2018; Howard and Ruder, 2018; Lan et al., 2019; Raffel et al., 2019). It has further recently been shown that all NLP tasks of interest can be cast as a “text-to-text” problem (Raffel et al., 2019)

, where the model is fed some text as input and is trained to produce target text as output. For example, sentiment analysis of a movie review might involve analyzing the input text “I went to see this movie with my husband, and we both thought the acting was terrible!” and producing the word “negative” to denote a negative sentiment. This simple and (arguably) universal framework was shown to obtain state-of-the-art results across a variety of NLP tasks.

Figure 1:

Illustration of our perspective on the accuracy and interpretability of different models. Neural networks (blue) can attain superhuman performance, but are notoriously hard to interpret. A rule-based system (yellow) is easy to interpret but rarely performs well on difficult tasks. Humans (red) are reasonably accurate and provide some degree of interpretability by being able to verbally explain their predictions. In this work, our model (green) is trained both to be highly accurate (in some cases, more accurate than a human) and provide explanations for its predictions as humans do.

Figure 2: Diagram of our method for training a text-to-text model to explain its predictions. We train the model to generate an explanation when the text “explain” is prepended to the input. The model can still be trained for classification (without an explanation) simply by omitting the “explain” keyword. This approach is readily applicable to sentiment analysis, natural language inference (NLI), and other text tasks.

In spite of their empirical and practical successes, it is notoriously difficult to determine why a neural network has produced a given prediction. This has led to a substantial body of research that endeavors to make neural networks more “interpretable”, e.g. by attributing its prediction to a given part of its input (Baehrens et al., 2010; Sundararajan et al., 2017; Smilkov et al., 2017) or by designing architectures that are easier to analyze (Foerster et al., 2017; Jacobsen et al., 2018; Bahdanau et al., 2014; Raffel et al., 2017). However, the reliability of some of these methods has been questioned (Kindermans et al., 2019; Hooker et al., 2018; Jain and Wallace, 2019; Serrano and Smith, 2019; Pruthi et al., 2019), limiting their practical utility. To motivate the perspective we take in this work, note that we humans (who tend to be rather good at NLP tasks) are also “black boxes” in the sense that we cannot obtain a full and transparent view of our own decision-making process. Instead, we rely on humans to explain their judgements. In contrast, consider a system comprising a list of hard-coded rules (for example, “if the review contains the word ‘terrible’, the review is negative”). In this case, it would be simple to understand the behavior and decision-making process of the system, but it’s unlikely that such a system would be very accurate (for example, the review “This movie was anything but terrible!” suggests a positive sentiment).

Given that humans and neural networks are both highly accurate and hard to interpret, we argue that neural networks should also be given the ability to explain their predictions using natural text. This idea has already motivated the development of various “explainability” datasets in the NLP literature (Zaidan and Eisner, 2008; Camburu et al., 2018; Rajani et al., 2019; DeYoung et al., 2019). Our main contribution is to show that the text-to-text framework makes it straightforward to train a model to produce an explanation. Specifically, instead of training the model to simply predict a label (e.g. “negative”), we train it to predict a label and explanation (e.g. “negative explanation: the acting was terrible”).

In addition to producing state-of-the-art results on explainability datasets, this approach also allows for both “semi-supervised” training (where explanations are only provided on a subset of the dataset) and for various forms of cross-domain transfer. For example, we train a model to generate explanations for data from one domain and show that it can generate plausible explanations for out-of-domain data. From a broad view, we argue that a text-to-text model has an inherent ability to “communicate” given its input and output format, and our work mainly involves training these models to communicate better. We provide a pictorial summary of our perspective on model interpretability in fig. 1.

In the following section, we review the text-to-text framework and corresponding pre-trained model we use and describe our approach in more detail. Section 3 provides an overview of related work on interpretability, particularly for NLP models. Then, in section 4, we introduce the various datasets and evaluation procedures we use for benchmarking before presenting experimental results. Finally, we conclude with an outlook on the connection between interpretability and training models to communicate with natural language.

2 Approach

Before presenting our basic methods, we first review the text-to-text framework we use. This framework underlies the pre-trained model that we used, which is called the “Text-to-Text Transfer Transformer” (T5). Then, we describe the details of how we fine-tune T5 to produce explanations for its predictions. We call the resulting model (and our general approach) “WT5” as shorthand for “Why, T5?”.

2.1 Text-to-Text Framework

A text-to-text model follows the sequence-to-sequence framework (Sutskever et al., 2014; Kalchbrenner et al., 2014) – it is fed a sequence of discrete tokens as input and produces a new sequence of tokens as output. Specifically, the model is provided with an input sequence and is trained to produce an output sequence by maximizing . At test time, the tokens are sampled from the model’s predicted output distribution () one at a time and fed back into the model autoregressively until a special end-of-sequence token is generated, at which point the model has produced its complete prediction. For text problems, the individual sequence elements or are often characters, words, or (in our case), subword token IDs (Sennrich et al., 2015) produced by a tokenizer like SentencePiece (Kudo, 2018; Kudo and Richardson, 2018). Notably, Raffel et al. (2019) propose converting all

text problems to the sequence-to-sequence format. For example, in a classification task, instead of training a classification layer to assign a high probability to some class ID, the model is trained to produce the actual text corresponding to the class label. Concretely, to train the model to perform sentiment analysis on our running movie review example, the model would be fed the sequence “sentiment: I went to see this movie with my husband, and we both thought the acting was terrible!” and would be trained to produce the literal text “negative”. The “sentiment:” prefix tells the model what task it should perform, which is useful in multi-task models

(Caruana, 1997; Ruder, 2017).

In Raffel et al. (2019), this framework was used to pre-train Transformer (Vaswani et al., 2017) models on a large collection of unlabeled text drawn from the Common Crawl web scrape. We use the resulting pre-trained models (referred to as T5 for “Text-to-Text Transfer Transformer”) in our experiments. Pre-trained models of various sizes are available; we experiment with the “Base” model with about million parameters and the “11B” model with around billion parameters. Further details on these models and the pre-training procedure are available in (Raffel et al., 2019).

2.2 Generating Explanations

The text-to-text framework provides a straightforward means of training models to output an explanation alongside their prediction. We experimented with various ways of modifying the input and output text to include an explanation, and settled on the following recipe: When we want the model to generate an explanation, we simply prepend the word “explain” to the input text and then append “explanation:” followed by the explanation to the target text. In our running movie review example, this produces the input “explain sentiment: I went to see this movie with my husband, and we both thought the acting was terrible!” with target “negative explanation: the acting was terrible.” Crucially, the model can be simultaneously trained on examples with explanations (which have “explain” prepended to their input and “explanation: …” appended to their output) as well as examples with only labels (by omitting “explain” from the input and “explanation: …” from the target so that the desired output is only the label text). This allows us to explore a “semi-supervised” setting where we have a dataset that is fully labeled but only a limited number of examples have explanations. A diagram of this basic approach, with examples for sentiment analysis and natural language inference (NLI) (Dagan et al., 2005; Bowman et al., 2015), is shown in fig. 2.

2.3 Extractive Explanations

So far, we have assumed that explanations will be arbitrary text generated by our model. An alternative way of producing explanations is to train a model to identify spans of text in the input which support its prediction. This “extractive” version is the setting considered by the recent ERASER benchmark (DeYoung et al., 2019), which combines various datasets that have been annotated with extractive explanations. The use of spans makes it possible to use non-generative span-prediction models like BERT (Devlin et al., 2018). It also makes evaluation potentially simpler by computing the overlap between the predicted and annotated spans. In our running movie review example, the explanation text “the acting was terrible” appears as a span of text in the input, so this particular example is compatible with the extractive approach.

Note that forcing explanations to be extracted spans is strictly less general. Consider the task of producing explanations for the Winograd Schema Challenge (WSC) (Levesque et al., 2012), where the goal is to disambiguate an ambiguous pronoun. For example, in the text “the city government denied the protesters a permit because they feared violence” the pronoun “they” refers to “the city government” because governments sometimes fear violence from protesters and not vice-versa. This explanation for why “they” refers to “the city government” does not appear anywhere in the text, suggesting that this task (and likely many others) is largely incompatible with extractive explanations.

We include some extractive explanation datasets in our experiments mainly to demonstrate the flexibility of our approach. To train our model to generate extractive explanations, we include the spans of the input which have been annotated as an explanation with the text “explanation:” in the targets and train the model to generate them sequentially. Then, when the model outputs a prediction and corresponding sequence of explanations, we match each predicted explanation to a span of text in the input, thereby allowing straightforward evaluation using span overlap-based metrics. A potential issue arises if our model generates an explanation which does not appear in the input text. We ignore such spurious explanations, though we found this rarely happened in practice.

3 Related Work

Measuring and improving the interpretability of neural networks is a heavily-studied area of research; a comprehensive overview is outside of the scope of this work. Instead, we refer the interested reader to the surveys provided by (Doshi-Velez and Kim, 2017; Molnar, 2019; Guidotti et al., 2018). Most work on interpretability methods focuses on models for computer vision applications (e.g. Xu et al. (2015); Zhang and Zhu (2018)), whereas the interpretability of NLP models is apparently less studied. A notable exception is the fact that attention-based neural networks (Bahdanau et al., 2014) provide some means of interpretability “for free” by examining the weight assigned by the neural network to different regions in the input (Graves, 2013; Raffel et al., 2017; Huang et al., 2018), but this introspection method has been shown to be unreliable (Jain and Wallace, 2019; Serrano and Smith, 2019; Pruthi et al., 2019). There has separately been significant work on better understanding the behavior NLP models, for example by crafting inputs that cause a misclassification (Jia and Liang, 2017; Nie et al., 2019) or diagnosing why they sometimes generate nonsensical text (Lee et al., 2018; Belinkov and Bisk, 2017).

An early investigation into explanations for NLP datasets was performed by Zaidan and Eisner (2008), who introduced the idea of annotating spans of the input which support the label. This produced the “Movie Reviews” dataset that we consider in our experiments. The general approach of extractive explanation was recently surveyed and advocated for by DeYoung et al. (2019), who proposed the ERASER benchmark comprising various datasets. As discussed in section 2.3, our approach is strictly more general in that it also allows us to consider generating abstractive explanations.

Camburu et al. (2018) have the most philosophically similar perspective to ours. They consider the generation of abstractive explanations by creating the e-SNLI dataset, which we consider in our experiments. e-SNLI is a variant of the Stanford Natural Language Inference (SNLI) dataset (Bowman et al., 2015) that adds human-annotated explanations for all examples in the training, validation, and test sets. To generate explanations, Camburu et al. (2018) propose model architectures that generally consist of separate components for classification and explanation. They consider various tasks, including conditioning the prediction on the explanation and vice versa, as well as producing sentence embeddings. Most related to this work, they also consider the task of learning to explain with e-SNLI but generating explanations for out-of-domain examples from other natural language inference tasks. The primary differences between Camburu et al. (2018) and this work are that our approach requires no special model architecture and that we take advantage of a pre-trained model that is already quite capable of generating natural text. These differences not only make our method simpler but also produce substantially better performance on the e-SNLI task.

Rajani et al. (2019)

also consider abstractive explanations. They introduce the CoS-E dataset, which comprises examples from the Commonsense Question Answering (CQA) dataset that have been annotated with abstractive explanations. However, their focus is mainly on using explanations to improve a model’s predictions, and as such they propose first training a model to generate explanations and then training a classifier to produce a prediction based on the original example and the generated explanation. Interestingly, this provided a substantial performance boost on the CQA dataset. They include minimal analysis or evaluation of the generated explanations, though they do show (through a few non-cherrypicked examples) that their model can generate explanations for datasets it was not trained on. The primary focus of our work is on generating useful explanations, so we do not experiment with feeding explanations into a model to improve its predictions.

4 Experiments

Having introduced our straightforward approach for generating explanations alongside predictions using the text-to-text framework, we now evaluate this idea on the various benchmark datasets described in the following subsection. In our experiments, we will frequently use human judgements for evaluation because free-form text is notoriously difficult to automatically evaluate and some of the datasets we consider do not have ground-truth explanations. We describe both the automatic metrics for evaluation used as well as our framework for obtaining human judgements in section 4.2. The remainder of this section is devoted to our experimental results.

4.1 Datasets

In our experiments, we evaluate on the following datasets: e-SNLI was proposed by Camburu et al. (2018), who annotated every example in the Stanford Natural Language Inference (SNLI) dataset with free-form explanations of the labels. The natural language inference task involves determining whether a premise entails (implies), contradicts, or has no relationship to a hypothesis. CoS-E was introduced in (Rajani et al., 2019) and augments the Commonsense Question-Answering (CQA) with free-form explanations. The CQA task involves answering multiple-choice questions that ostensibly rely on commonsense reasoning or “world knowledge”. Note that CoS-E also includes extractive explanations, which we do not use in this paper. Movie Reviews (Zaidan and Eisner, 2008) is a sentiment analysis dataset where the goal is to predict whether a movie review has a positive or negative sentiment. Each review is annotated with spans that support the positive/negative label. MultiRC (Khashabi et al., 2018b) is a reading comprehension dataset that similarly includes spans of the input document supporting the answer to a given question. Specifically, in MultiRC a model is fed not only a question about a given document but also a candidate answer that the model must then classify as correct or incorrect. We use the variants of Movie Reviews and MultiRC distributed with the ERASER benchmark (DeYoung et al., 2019).

4.2 Evaluation

4.2.1 Quantitative

All of the datasets we use involve producing a class label based on some input text – entailment, neutral, or contradiction for e-SNLI, the correct answer from a list of choices for CoS-E, positive or negative for Movie Reviews, and True or False for MultiRC. As such, for all datasets we report the classification accuracy of our model in order to evaluate the quality of its predictions.

For abstractive explanations, Camburu et al. (2018) propose using the BLEU score (Papineni et al., 2002) to compare a predicted explanation against the ground-truth explanation from e-SNLI. Since Rajani et al. (2019) mainly consider the setting where explanations are fed as input into a classification model, they do not propose any particular metric for evaluating the quality of generated explanations on CoS-E. As such, we use the BLEU score both for e-SNLI and CoS-E. We use SacreBLEU v1.3.0 (Post, 2018) with “exp” smoothing and “intl” tokenization. Notably, many of the ground-truth explanations for CoS-E are low quality and/or nonsensical (for example, the question “Little sarah didn’t think that anyone should be kissing boys. She thought that boys had what?” with answer “cooties” was annotated with the explanation “american horror comedy film directed”; or the question “What do you fill with ink to print?” with answer “printer” was annotated with the explanation “health complications”, etc.), suggesting that BLEU scores on CoS-E should be taken with a grain of salt. We discuss this issue further in section 4.4

The ERASER benchmark (DeYoung et al., 2019) suggests various metrics for measuring whether extracted explanation spans match the ground-truth. The simplest and most general computes an F1 score based on which entries of the input are labeled as an explanation by the prediction and ground-truth. Specifically, DeYoung et al. (2019) first tokenize the input text using the tokenizer,222 and then compute true/false positives/negatives on a token-by-token basis. We use spacy’s “en_core_web_sm” model for tokenization to compute the F1 score.

4.2.2 Qualitative

The BLEU and F1 scores mentioned above can only loosely measure the quality of an explanation. We argue that the most reliable way of determining whether an explanation supports a prediction is using human judgement. The number and scale of our experiments necessitates the use of crowd computing, so we use the Mechanical Turk (MTurk) platform to obtain ratings of model explanations.

Since many of our raters are not language experts, we devised a simple and straightforward set of questions for evaluating a given explanation. Specifically, we present a rater with the input, predicted label, and explanation and ask whether the explanation supports the label. We apply this procedure to both abstractive (e-SNLI, CoS-E) and extractive (Movie Reviews, MultiRC) explanations. For extractive explanations, we present a single answer span at a time alongside the input and predicted label. Note that this will only allow us to evaluate whether a span is a true or false positive and does not provide a way of evaluating false negatives, but nevertheless provides a helpful perspective on the model’s explanation quality. We provide screenshots of our evaluation forms in appendix B.

For every dataset we study, we evaluate 100 examples using MTurk with 5 independent ratings for each example. To ensure quality ratings, we split the 100 examples into batches of 10 and include an attention check (question for which we know the answer) in each group. If the attention check was failed or not every question was answered, we remove that batch of 10 examples from our analysis and re-rate the batch so that all examples are rated by 5 different raters. We treat an explanation as correct if the majority of the 5 raters label it as a good explanation.

4.3 Training Details

We use the “Base” and “11B” configurations of T5 in our experiments. For fine-tuning, we follow the same procedure used for the downstream tasks in (Raffel et al., 2019): As a brief summary, models are fine-tuned trained using the AdaFactor optimizer (Shazeer and Stern, 2018) with a constant learning rate of . We use a batch size of tokens for the Base model and for 11B. We use a maximum input sequence length of for e-SNLI, for CoS-E, for MultiRC and for Movie Reviews. We apply dropout with a rate of

throughout fine-tuning. To obtain model predictions, we perform “greedy” decoding by choosing the token ID corresponding to the largest output logit. For each task, we fine-tune until overfitting is observed on a held-out validation set and choose the checkpoint corresponding to the highest accuracy on the validation set.

4.4 Results on standard benchmarks

e-SNLI CoS-E Movie Reviews MultiRC
Previous SoTA
WT5-Base 32.7
WT5-11B 92.3 33.7 5.17 99.0 76.9
Table 1: Results attained by WT5 and various baselines on the datasets we study. Acc is short for accuracy, HE for Human Evaluation, and TF1 for Token F1. F1a is the F1 score over all answers used in the MultiRC dataset (Khashabi et al., 2018a). See section 4.4 for a description of baselines. Note that for the Human row, Acc and TF1 are measured on our hand-labeled examples while HE is measured on the ground-truth explanations from the dataset. We were not able to run human evaluation for past SoTA models since we do not have access to the explanations produced by those models. As far as we are aware, the only work which reports accuracy on the Movie Reviews dataset is (Zaidan and Eisner, 2008); (DeYoung et al., 2019) reports an F1 score of . Since the Movies Rationale dataset is reasonably class-balanced and models are performing near-perfectly, this F1 score is somewhat comparable to the accuracy scores we report. Superscripts denote results from past work: Liu et al. (2019), Camburu et al. (2018), Lan et al. (2019), Zaidan and Eisner (2008), DeYoung et al. (2019), Raffel et al. (2019), Bowman et al. (2015).
e-SNLI Premise: A person in a blue shirt and tan shorts getting ready to roll a bowling ball down the alley.
Hypothesis: A person is napping on the couch.
Predicted label: contradiction
Explanation: A person cannot be napping and getting ready to roll a bowling ball at the same time.
CoS-E Question: What can you use to store a book while traveling?
Choices: library of congress, pocket, backpack, suitcase, synagogue
Predicted answer: backpack
Explanation: books are often found in backpacks
Movie Reviews Review: sylvester stallone has made some crap films in his lifetime , but this has got to be one of the worst . a totally dull story that thinks it can use various explosions to make it interesting , ” the specialist ” is about as exciting as an episode of ” dragnet , ” and about as well acted . even some attempts at film noir mood are destroyed by a sappy script , stupid and unlikable characters , and just plain nothingness
Predicted label: negative
MultiRC Passage: Imagine you are standing in a farm field in central Illinois . The land is so flat you can see for miles and miles . On a clear day , you might see a grain silo 20 miles away . You might think to yourself , it sure is flat around here …
Query: In what part of Illinois might you be able to see a grain silo that is 20 miles away ?
Candidate answer: Northern Illinois
Predicted label: False
Table 2: Non cherry-picked predictions and explanations produced by WT5-11B on the validation set of each dataset. For extractive explanation, we boldface the spans chosen by our model. We display a truncated review and passage for the examples from Movie Reviews and MultiRC (respectively) for clarity and space reasons.

We present WT5-Base and WT5-11B’s performance on the standard datasets we consider in table 1. All reported results are on the test set except for CoS-E – human-annotated explanations are not available for the CQA test set, so we report validation set scores instead. Additionally, the test set for MultiRC provided in the Eraser benchmark (DeYoung et al., 2019) is the validation set from SuperGLUE (Wang et al., 2019). Therefore, the results in this paper do not match the ones reported on the SuperGLUE leader board333 To contextualize these results, we also include the following baselines:


Previous State-of-the-art (SoTA)

We report the best score previously achieved on each dataset.


We estimated human performance on each dataset by hand-labeling examples from the validation set and measuring our accuracy and the corresponding explanation quality score (BLEU or Token F1). We also fed ground-truth labels from each dataset into our human evaluation procedure to get an idea of the quality of explanations in each dataset. For e-SNLI, we use the human agreement scores reported in

(Camburu et al., 2018) and (Bowman et al., 2015).

In general, we find that WT5-11B attains the highest scores for its explanations on most of the datasets we studied. On all datasets, WT5-11B’s explanation score is better than the score for the examples we hand-labeled. This likely does not mean that WT5-11B’s explanations are “better”, but rather that it has learned to model some of the spurious characteristics of ground-truth explanations on a given dataset. This is borne out in the human evaluation of WT5-11B’s explanations, which produced similar scores to the ground-truth explanations on all datasets except for e-SNLI where WT5-11B achieved a higher score. Separately, WT5-11B attained state-of-the-art accuracy on the e-SNLI and Movie Reviews datasets. For CoS-E and MultiRC, WT5-11B is very close to state-of-the-art accuracy to the T5-11B model which doesn’t generate explanations. To summarize, our results suggest that WT5-11B is at a human or super-human level at both classifying and explaining examples from the datasets we considered. We provide some example predictions and explanations produced by WT5-11B in table 2.

Figure 3: Accuracy and explanation quality as a function of the number of explanations retained in the training set. Dashed lines show the performance attained by using explanations for every example in the training set. All scores are reported on the validation set.
MNLI Premise: He passed these instructions to the pilots that launched at 10:42 and afterward.
Hypothesis: Instructions on how to engage were given to the pilot going up.
Predicted label: neutral
Explanation: The instructions could be about anything, not necessarily how to engage.
IMDb Review: ”Lassie Come Home,” ”National Velvet,” and ”The Courage of Lassie,” Elizabeth Taylor was eleven years old. Nevertheless, her charm and beauty were extraordinary, and what she lacked in talent and experience was well hidden in a fine production that was nominated for five Academy Awards
Predicted label: positive
Amazon Review: Great TV After having researched the LCD 1080P marketplace extensively, I decided on the Samsung and have not been disappointed. My initial experience, as well as my prior experience with a number of Samsung products makes me confident this will prove to be an excellent choice.
Predicted label: positive
Table 3: Non cherry-picked predictions and explanations for MNLI, IMDb, and Amazon Reviews based on training WT5-11B. The MNLI explanations are generated using the e-SNLI dataset. The IMDb and Amazon Reviews explanations are generated using Movie Reviews. For IMDb and Amazon Reviews, we boldface the explanatory spans chosen by our model. We display only the beginning of the review for IMDb.

In general, WT5-Base had worse accuracy and explanation quality scores than WT5-11B, but the Base model nevertheless frequently outperformed the previous state-of-the-art and, in some cases, human annotations. Surprisingly, our hand-annotated explanations achieved a very low BLEU score on CoS-E when evaluated against ground-truth explanations distributed with the dataset. Upon inspection, we found that this was largely due to the aforementioned noisy and low-quality explanations that are distributed with CoS-E. This also likely explains why our model’s generated explanations were rated correct at a higher rate by MTurk workers than the ground truth explanations provided with CoS-E.

4.5 Learning from limited explanations

Our framework facilitates a natural way of learning to generate explanations when only a limited number of examples have been annotated with a ground-truth explanation. Specifically, if a training example has an annotated explanation, we prepend “explain” to the input and append the explanation to the target. If no explanation has been annotated, we simply train the model to generate the label alone and do not prepend “explain” to the input. These two cases can be seen in the top two examples in fig. 2. At test time, we ask our model to generate explanations for all of its inputs by prepending “explain” to every example. Hopefully, this approach will produce a model that can generate plausible explanations without requiring much (potentially expensive) hand annotating.

To test this approach, we trained WT5-11B on variants of each dataset after artificially removing most of the annotated explanations (but retaining all labels) and then measured the resulting accuracy and explanation scores on the validation set. The results for e-SNLI, CoS-E, and Movie Reviews can be seen in fig. 3. For e-SNLI, the accuracy stayed roughly constant but the BLEU score gradually tapered off as the number of explanations decreased. Nevertheless, with only explanations, WT5-11B attains a better BLEU score than the previous state-of-the-art (Camburu et al., 2018). On CoS-E, the accuracy and BLEU scores both stayed constant (with a mild amount of random fluctuation) even as the number of explanations approached . We manually inspected the explanations generated by WT5-11B after it had been trained on 100 ground-truth explanations and found that they were indeed of similar quality to those generated by the model trained on all explanations.

In contrast with the results for abstractive explanation, we found that the explanation quality quickly degraded as the number of annotated explanations decreased for both Movie Reviews and MultiRC. The Movie Reviews dataset comprises only training examples; with explanations the generated explanation score is reasonable but performance degrades to near-zero as the number of explanations approaches . On MultiRC, we were able to achieve reasonable results with annotated explanations (compared to about for the full dataset) but the Token F1 score was when fewer explanations were used. This suggests that training the WT5 to generate many extractive explanation spans may require more supervision than training it to generate a single abstractive explanation (as is the case in e-SNLI and CoS-E).

4.6 Transferring across datasets

Another way to avoid having to annotate a given dataset with explanations would be to leverage a related dataset for which explanations are already available. For example, we might use the e-SNLI dataset to train our model to generate explanations and then have the model produce explanations for a different natural language inference dataset. This also can test whether the model has learned domain-agnostic explanation skills by evaluating performance on a dataset from a different domain.

We evaluated whether WT5-11B could successfully carry out this kind of transfer in two settings. We transferred from e-SNLI to the MNLI dataset (Williams et al., 2017) which measures natural language inference in a much wider variety of domains than SNLI. Secondly, we transferred from Movie Reviews to IMDb (Maas et al., 2011) which consists of a large collection of movie reviews from the website IMDb. In both cases, we combined all examples from the explanation-annotated and explanation-free datasets and sampled examples randomly from the combined dataset. For training, we proceeded in a similar fashion as the previous experiment, where we prepended explanation-annotated examples with the word “explain” and simply trained the model to predict the label for explanation-free examples. Since the transfer datasets do not contain ground-truth explanations, our only option for assessing quality was to perform a human study.

In both cases, we found that WT5-11B produced plausible explanations for examples in the dataset which did not have explanations annotated. Human raters considered of explanations generated from the validation set to be correct for examples from MNLI and for IMDb. WT5-11B also managed to attain reasonable classification accuracy on each dataset ( on MNLI and on IMDb). We present an example model output for both MNLI and IMDb in table 3.

To further test if our model has learnt domain agnostic explanations skills, we evaluated whether WT5-11B could successfully generate explanations for any other kinds of reviews, in addition to movie reviews. To test this transfer, we used the Amazon Reviews dataset (He and McAuley, 2016; McAuley et al., 2015) which contains reviews for a wide variety of products across diverse categories. The Amazon datasets consists of 5 star ratings as labels. We converted the labels to binary by considering reviews with 1 or 2 stars as positive and those with 4 or 5 stars as negative. The training setup is similar to the one described above for IMDb. The only difference is that we also included examples from Movie Reviews without any explanations. We included Movie Reviews both with and without explanations, so that the model could learn the semantics of the “explain“ prefix on Movie Reviews and apply it generate explanations for Amazon Reviews. After training, the WT5-11B model produced explanations for almost all examples in the Amazon Reviews dataset, averaging explanations per example. We share some explanations from the Amazon Reviews dataset in table 3 and examples from more product categories in appendix A. Additionally, the WT5-11B model achieves a classification accuracy of on the Amazon Reviews dataset. This suggests that this form of transfer presents another plausible way of learning to generate explanations on a dataset where they have not yet been annotated, even when the dataset is from another domain.

4.7 Transferring across tasks

To push the idea of transferring explanation abilities further, we tested whether WT5-11B could successfully transfer across tasks. Specifically, we evaluated whether WT5-11B could be trained to generate explanations on e-SNLI and then produce plausible explanations for the CoS-E dataset.

Note that e-SNLI and CoS-E are quite different tasks: For e-SNLI, the model receives a premise and hypothesis and must produce an NLI label from three fixed classes; for CoS-E, it is fed a question and must answer given five example-specific choices. Given these differences, we modified the task processing to better align the formatting. In CoS-E, we modified the tokens “cos_e” and “question:” to “nli” and “premise:” respectively. We also modified the e-SNLI inputs to contain three fixed choices: “entailment”, “neutral”, and “contradiction”. We ablated these changes and found that both were necessary for our models to learn to generate explanations for CoS-E. Additionally, we found that decoding with beam-search improved the reliability of generating explanations.

Similar to the procedure for Movie Reviews to Amazon Reviews transfer, we fine-tuned WT5-11B on a mixture of the full e-SNLI dataset with explanations, the full e-SNLI dataset without explanations, and the CoS-E dataset without explanations. We applied this model to generate “zero-shot” explanations for CoS-E. After training, our model produced an explanation for most examples from the CoS-E validation set. We share some cherry-picked CoS-E explanations generated by our model in table 4. While our model did not 100% reliably transfer explanation abilities across tasks, this result establishes that zero-shot explanation transfer across tasks is indeed possible and motivates future work on task-agnostic explanation abilities.

Question: When going to sleep what happens to your body?
Predicted answer: relaxation
Explanation: When going to sleep, your body goes into a state of relaxation.
Question: What rubber toy filled with helium will make a child happy?
Predicted answer: balloon
Explanation: balloon is a toy filled with helium.
Question: James’s nice asked him about her grandfather. She was interested in learning about what?
Predicted answer: family tree
Explanation: A family tree is a way of tracing a family’s lineage.
Question: Where can one obtain a bass fiddle?
Predicted answer: music store
Explanation: A bass fiddle is an instrument.
Table 4: Cherry-picked predictions and explanations produced by WT5-11B when transferring from e-SNLI to CoS-E. Multiple-choice answers omitted for brevity. The word “nice” in the third example is a typo that appears in the dataset.

5 Conclusion

In this paper, we demonstrated how the text-to-text framework can be straightforwardly used to train a model to generate explanations for its predictions. The resulting model, called WT5-11B, achieved state-of-the-art results on a diverse collection of benchmark datasets and in many cases matched human abilities in both classification performance and explanation abilities. We also showed how this approach facilitates learning from limited labeled explanations and transferring explanatory capabilities across domains and tasks.

At a high level, our results can be seen as a small step towards improving our models’ abilities to communicate. For example, sentiment analysis on the Movie Reviews dataset is loosely equivalent to asking the model “what is the sentiment of this movie review?” and our work allows us to further ask the model “why?”. While we are broadly interested in making models communicate more naturally, we also recognize that this approach provides only a surface-level improvement of interpretability: Much like humans, our approach does not guarantee that the produced explanation actually explains the specific reasons why a model generated its prediction. In other words, the model could potentially just make up a reasonable-sounding explanation instead of providing a truly accurate description of its causal decision-making process. Nevertheless, we are excited to see the field progress more towards more human-like text models.


  • D. Baehrens, T. Schroeter, S. Harmeling, M. Kawanabe, K. Hansen, and K. MÞller (2010) How to explain individual classification decisions.

    Journal of Machine Learning Research

    11 (June).
    Cited by: §1.
  • D. Bahdanau, K. Cho, and Y. Bengio (2014) Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473. Cited by: §1, §3.
  • Y. Belinkov and Y. Bisk (2017) Synthetic and natural noise both break neural machine translation. arXiv preprint arXiv:1711.02173. Cited by: §3.
  • S. R. Bowman, G. Angeli, C. Potts, and C. D. Manning (2015) A large annotated corpus for learning natural language inference. arXiv preprint arXiv:1508.05326. Cited by: §2.2, §3, item Human, Table 1.
  • O. Camburu, T. Rocktäschel, T. Lukasiewicz, and P. Blunsom (2018) E-snli: natural language inference with natural language explanations. In Advances in Neural Information Processing Systems, Cited by: §1, §3, item Human, §4.1, §4.2.1, §4.5, Table 1.
  • R. Caruana (1997) Multitask learning. Machine learning 28 (1). Cited by: §2.1.
  • I. Dagan, O. Glickman, and B. Magnini (2005) The pascal recognising textual entailment challenge. In Machine Learning Challenges Workshop, pp. 177–190. Cited by: §2.2.
  • J. Devlin, M. Chang, K. Lee, and K. Toutanova (2018) BERT: pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805. Cited by: §1, §2.3.
  • J. DeYoung, S. Jain, N. F. Rajani, E. Lehman, C. Xiong, R. Socher, and B. C. Wallace (2019) ERASER: a benchmark to evaluate rationalized nlp models. arXiv preprint arXiv:1911.03429. Cited by: §1, §2.3, §3, §4.1, §4.2.1, §4.4, Table 1.
  • F. Doshi-Velez and B. Kim (2017) Towards a rigorous science of interpretable machine learning. arXiv preprint arXiv:1702.08608. Cited by: §3.
  • J. N. Foerster, J. Gilmer, J. Sohl-Dickstein, J. Chorowski, and D. Sussillo (2017) Input switched affine networks: an rnn architecture designed for interpretability. In Proceedings of the 34th International Conference on Machine Learning, Cited by: §1.
  • A. Graves (2013)

    Generating sequences with recurrent neural networks

    arXiv preprint arXiv:1308.0850. Cited by: §3.
  • R. Guidotti, A. Monreale, S. Ruggieri, F. Turini, F. Giannotti, and D. Pedreschi (2018) A survey of methods for explaining black box models. ACM computing surveys (CSUR) 51 (5). Cited by: §3.
  • R. He and J. McAuley (2016) Ups and downs: modeling the visual evolution of fashion trends with one-class collaborative filtering. In proceedings of the 25th international conference on world wide web, pp. 507–517. Cited by: §4.6.
  • S. Hooker, D. Erhan, P. Kindermans, and B. Kim (2018) Evaluating feature importance estimates. arXiv preprint arXiv:1806.10758. Cited by: §1.
  • J. Howard and S. Ruder (2018) Universal language model fine-tuning for text classification. arXiv preprint arXiv:1801.06146. Cited by: §1.
  • C. A. Huang, A. Vaswani, J. Uszkoreit, N. Shazeer, C. Hawthorne, A. M. Dai, M. D. Hoffman, and D. Eck (2018) Music transformer: generating music with long-term structure. arXiv preprint arXiv:1809.04281. Cited by: §3.
  • J. Jacobsen, A. Smeulders, and E. Oyallon (2018) I-revnet: deep invertible networks. arXiv preprint arXiv:1802.07088. Cited by: §1.
  • S. Jain and B. C. Wallace (2019) Attention is not explanation. arXiv preprint arXiv:1902.10186. Cited by: §1, §3.
  • R. Jia and P. Liang (2017) Adversarial examples for evaluating reading comprehension systems. arXiv preprint arXiv:1707.07328. Cited by: §3.
  • N. Kalchbrenner, E. Grefenstette, and P. Blunsom (2014)

    A convolutional neural network for modelling sentences

    arXiv preprint arXiv:1404.2188. Cited by: §2.1.
  • D. Khashabi, S. Chaturvedi, M. Roth, S. Upadhyay, and D. Roth (2018a) Looking Beyond the Surface: A Challenge Set for Reading Comprehension over Multiple Sentences. In Proc. of the Annual Conference of the North American Chapter of the Association for Computational Linguistics (NAACL), External Links: Link Cited by: Table 1.
  • D. Khashabi, S. Chaturvedi, M. Roth, S. Upadhyay, and D. Roth (2018b) Looking beyond the surface: a challenge set for reading comprehension over multiple sentences. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics, Cited by: §4.1.
  • P. Kindermans, S. Hooker, J. Adebayo, M. Alber, K. T. Schütt, S. Dähne, D. Erhan, and B. Kim (2019) The (un) reliability of saliency methods. In

    Explainable AI: Interpreting, Explaining and Visualizing Deep Learning

    Cited by: §1.
  • T. Kudo and J. Richardson (2018) Sentencepiece: a simple and language independent subword tokenizer and detokenizer for neural text processing. arXiv preprint arXiv:1808.06226. Cited by: §2.1.
  • T. Kudo (2018) Subword regularization: improving neural network translation models with multiple subword candidates. arXiv preprint arXiv:1804.10959. Cited by: §2.1.
  • Z. Lan, M. Chen, S. Goodman, K. Gimpel, P. Sharma, and R. Soricut (2019)

    ALBERT: a lite bert for self-supervised learning of language representations

    arXiv preprint arXiv:1909.11942. Cited by: §1, Table 1.
  • K. Lee, O. Firat, A. Agarwal, C. Fannjiang, and D. Sussillo (2018) Hallucinations in neural machine translation. In NeurIPS Workshop on Interpretability and Robustness in Audio, Speech, and Language, Cited by: §3.
  • H. Levesque, E. Davis, and L. Morgenstern (2012) The winograd schema challenge. In Thirteenth International Conference on the Principles of Knowledge Representation and Reasoning, Cited by: §2.3.
  • X. Liu, P. He, W. Chen, and J. Gao (2019) Multi-task deep neural networks for natural language understanding. arXiv preprint arXiv:1901.11504. Cited by: Table 1.
  • A. L. Maas, R. E. Daly, P. T. Pham, D. Huang, A. Y. Ng, and C. Potts (2011)

    Learning word vectors for sentiment analysis

    In Proceedings of the 49th annual meeting of the association for computational linguistics, Cited by: §4.6.
  • J. McAuley, C. Targett, Q. Shi, and A. Van Den Hengel (2015) Image-based recommendations on styles and substitutes. In Proceedings of the 38th International ACM SIGIR Conference on Research and Development in Information Retrieval, pp. 43–52. Cited by: §4.6.
  • C. Molnar (2019) Interpretable machine learning. Cited by: §3.
  • Y. Nie, A. Williams, E. Dinan, M. Bansal, J. Weston, and D. Kiela (2019) Adversarial nli: a new benchmark for natural language understanding. arXiv preprint arXiv:1910.14599. Cited by: §3.
  • K. Papineni, S. Roukos, T. Ward, and W. Zhu (2002) BLEU: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting on association for computational linguistics, Cited by: §4.2.1.
  • M. E. Peters, M. Neumann, M. Iyyer, M. Gardner, C. Clark, K. Lee, and L. Zettlemoyer (2018) Deep contextualized word representations. arXiv preprint arXiv:1802.05365. Cited by: §1.
  • M. Post (2018) A call for clarity in reporting bleu scores. arXiv preprint arXiv:1804.08771. Cited by: §4.2.1.
  • D. Pruthi, M. Gupta, B. Dhingra, G. Neubig, and Z. C. Lipton (2019) Learning to deceive with attention-based explanations. arXiv preprint arXiv:1909.07913. Cited by: §1, §3.
  • C. Raffel, M. Luong, P. J. Liu, R. J. Weiss, and D. Eck (2017) Online and linear-time attention by enforcing monotonic alignments. In Proceedings of the 34th International Conference on Machine Learning, Cited by: §1, §3.
  • C. Raffel, N. Shazeer, A. Roberts, K. Lee, S. Narang, M. Matena, Y. Zhou, W. Li, and P. J. Liu (2019)

    Exploring the limits of transfer learning with a unified text-to-text transformer

    arXiv preprint arXiv:1910.10683. Cited by:   WT5?! Training Text-to-Text Models to Explain their Predictions  , §1, §2.1, §2.1, §4.3, Table 1.
  • N. F. Rajani, B. McCann, C. Xiong, and R. Socher (2019) Explain yourself! leveraging language models for commonsense reasoning. arXiv preprint arXiv:1906.02361. Cited by: §1, §3, §4.1, §4.2.1.
  • S. Ruder (2017) An overview of multi-task learning in deep neural networks. arXiv preprint arXiv:1706.05098. Cited by: §2.1.
  • R. Sennrich, B. Haddow, and A. Birch (2015) Neural machine translation of rare words with subword units. arXiv preprint arXiv:1508.07909. Cited by: §2.1.
  • S. Serrano and N. A. Smith (2019) Is attention interpretable?. arXiv preprint arXiv:1906.03731. Cited by: §1, §3.
  • N. Shazeer and M. Stern (2018) Adafactor: adaptive learning rates with sublinear memory cost. arXiv preprint arXiv:1804.04235. Cited by: §4.3.
  • D. Smilkov, N. Thorat, B. Kim, F. Viégas, and M. Wattenberg (2017) Smoothgrad: removing noise by adding noise. arXiv preprint arXiv:1706.03825. Cited by: §1.
  • M. Sundararajan, A. Taly, and Q. Yan (2017) Axiomatic attribution for deep networks. In Proceedings of the 34th International Conference on Machine Learning, Cited by: §1.
  • I. Sutskever, O. Vinyals, and Q. V. Le (2014) Sequence to sequence learning with neural networks. In Advances in neural information processing systems, Cited by: §2.1.
  • A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polosukhin (2017) Attention is all you need. In Advances in neural information processing systems, Cited by: §2.1.
  • A. Wang, Y. Pruksachatkun, N. Nangia, A. Singh, J. Michael, F. Hill, O. Levy, and S. Bowman (2019) SuperGLUE: a stickier benchmark for general-purpose language understanding systems. In Advances in Neural Information Processing Systems 32, H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett (Eds.), pp. 3266–3280. External Links: Link Cited by: §4.4.
  • A. Williams, N. Nangia, and S. R. Bowman (2017) A broad-coverage challenge corpus for sentence understanding through inference. arXiv preprint arXiv:1704.05426. Cited by: §4.6.
  • K. Xu, J. Ba, R. Kiros, K. Cho, A. Courville, R. Salakhudinov, R. Zemel, and Y. Bengio (2015) Show, attend and tell: neural image caption generation with visual attention. In International conference on machine learning, Cited by: §3.
  • O. Zaidan and J. Eisner (2008) Modeling annotators: a generative approach to learning from annotator rationales. In Proceedings of the 2008 conference on Empirical methods in natural language processing, pp. 31–40. Cited by: §1, §3, §4.1, Table 1.
  • Q. Zhang and S. Zhu (2018) Visual interpretability for deep learning: a survey. Frontiers of Information Technology and Electronic Engineering 19, pp. . External Links: Document Cited by: §3.

Appendix A Amazon Reviews explanations

Product Category Review
Apparel Lovely vest Fits beautifully (or rather it did before my husband lost 70 pounds), true to size. He wore this a lot, so it went through the washer several times, and still looks great. Very soft material, has not pilled or faded.
Predicted label: positive
Books a must if you wanna create comics/manga this teaches you everything you need to know, from paneling, to creating believeable characters, to perspictive, and covers everything pretty much
Predicted label: positive
Luggage pretty good So far I’ve only used this bag a couple of times but it has served it’s purpose. It fits in a standard overhead storage bin, I love the bright royal blue color, and it appears to be well-made. My only complaint is that the extension handle got stuck after only using it a couple of times. Otherwise, this is a great piece of luggage.
Predicted label: positive
Musical instruments Worked for about 2 weeks! This product is very poorly made. My kids, ages 2.5 and 4, got the item for Christmas and were able to enjoy it for approximately 2 weeks before the microphone completely stopped working. They were not hard on the product at all - I watched them play with it every time. There is absolutely no reason it should have stopped working. It is basically now trash. I definitely do not recommend this product if you want a functioning microphone!!
Predicted label: negative
Office products Stay away! I guess you get what you pay for. Basically, I installed the 3 colors, and the small black. The yellow didn’t work. I tried cleaning the contacts and the yellow worked sometimes, never well. Then the magenta stopped working. Total junk!
Predicted label: negative
Outdoors Highly recommended Awesomeswitch is a little confusing at first … Hope they hold up … have not yet tossed them in the service truck .. purchase primarily because of the lifetime warranty. light it bright
Predicted label: positive
Shoes Beware. Replicas. Not genuine. The gold mirror coating rubbed off while cleaning the lenses – while using the enclosed cloth. (See photo with spot on lens and paint on cloth.) After doing a bit of research I’ve come to the conclusion that these are fakes.
Predicted label: negative
Toys Beautiful float, but deflates rapidly… Float looks as advertised; however, it takes considerable time to pump up, and then deflates within a few days… Sigh*
Predicted label: negative
Table 5: Non cherry-picked predictions and explanations for Amazon Reviews based on training WT5-11B for different product categories. We boldface the explanatory spans chosen by our model.

Appendix B Human Study GUIs

Figures 4 through 7 show the GUIs we posted to MTurk to evaluate different datasets. When the dataset includes a human-generated explanation for the label, we perform human evaluation on both the provided explanation and generated explanation. Several datasets share the same MTurk setup as noted in the captions.

Figure 4: GUI for MNLI (and also e-SNLI). The explanation provided is a generated by WT5-11B.
Figure 5: GUI for CoS-E. The explanation is from the validation set of the dataset.
Figure 6: GUI for Movie Reviews (also IMDB). The explanation is from the validation set of the dataset.
Figure 7: GUI for MultiRC. The explanation is from the validation set of the dataset.