LEXPLAIN : Improving Model Explanations via Lexicon Supervision (2023)

Abstract: Model explanations that shed light on the model’s predictions are becoming a desired additional output of NLP models, alongside their predictions. Challenges in creating these explanations include making them trustworthy and faithful to the model’s predictions. In this work, we propose a novel framework for guiding model explanations by supervising them explicitly. To this end, our method, LEXplain, uses task-related lexicons to directly supervise model explanations. This approach consistently improves the model’s explanations without sacrificing performance on the task, as we demonstrate on sentiment analysis and toxicity detection. Our analyses show that our method also demotes spurious correlations (i.e., with respect to African American English dialect) when performing the task, improving fairness.

## introduction extensive recent work has sought to advance nlp models so that they offer explanations for their predictions @xcite @xcite . here we focus on methods that extract features from the input text to explain a classifier's prediction, known variously as "feature attribution" or "rationales" @xcite . beyond high accuracy on unseen data, classifiers that offer explanations are expected to provide explanations that are faithful to the workings of the model and also intuitive to human users, goals that might be contradicting. we begin with an approach designed for faithfulness @xcite and introduce supervision that guides its explanations toward lexical clues already established to be associated with the classification task. ancillary goals are to improve model accuracy through the construction of explanations, and to remove reliance on spurious features that can bias a classifier's output in unwanted ways. our method, lexplain ( §3), encourages the model to be "confused" in the absence of words from a task-specific lexicon, i.e., to assign a uniform probability distribution across labels, and promotes model explanations that contain task-specific lexemes. we apply lexplain to sentiment analysis and toxicity detection tasks, and our controlled experiments ( §5, §6) comparing lexplain to selfexplain (which does not use supervision for explanations) show that: we believe these results are encouraging, as they suggest that type-level (lexicon) supervision is a viable alternative to methods that require costly annotation of explanations @xcite ). foot_0 2 background: selfexplain our goal is to improve model explanations in supervised text classification tasks. by supervising explanations, we incorporate inductive biases into models, making them robust to spurious artifacts. our base model is selfexplain @xcite , a framework that explains a text classifier's predictions with phrase attribution. we describe selfexplain (omitting the global interpretable layer, as we focus on local explanations) and in section 3 present our proposed method, lexplain. starting with a neural classifier, let u s be the masked lm's @xcite final layer representation of the "[cls]" token for one instance. u s is passed through relu, affine, and softmax layers to yield a probability distribution over outputs; the loss is the negative log probability, summed over training instances i: a set of phrases is extracted from the data with a phrase-structure parser @xcite . let u j be the average of the mlm representations of tokens in phrase j. the output distribution without phrase j is modeled by transforming the difference @xcite between u s and u j . vector s j is a probability distribution over labels, with phrase j absent: the closer s j is to ℓ (eq. 1), the less important phrase j is. a secondary log loss l lil is formed from the probability assigned to the correct label without phrase j, taking a learned weighted sum over all of instance i's phrases, and interpolating with the original log loss (eq. 2) with a hyperparameter α 1 to weight the secondary loss: the relevance of each phrase j can be defined as the change in probability of the correct label when j is included vs. excluded: ## supervising explanations on inspecting explanations retrieved from self-explain, in many cases they do not align intuitively with the predictions. our modeling innovation is to supervise the explanations encoded in the lil, rather than letting them emerge from the secondary loss function (l lil in equation 4 ). we incorporate a task lexicon as a source of supervision during training via a third loss component to encourage the model to prefer phrases that contain words in our lexicon as explanations. our proposed method, named lexplain, assumes that good explanations within the input are crucial for predictions, thus we encourage the model to be "confused" in the absence of lexicon entries, which we expect to be good explanations. formally, we minimize the kl divergence between the predicted label distribution s j , which stands for the distribution in the absence of phrase j (as described in section 2) and the uniform distribution s unif , for every phrase j: this objective is used for only lexicon phrases. lexplain interpolates the third loss, weighted by hyperparameter α 2 , with the other two: for sentiment analysis, we use the sst-2 dataset @xcite , where the task is to predict the sentiment of movie reviews. for toxicity detection we use dwmw17 @xcite and fdcl18 @xcite ; both twitter datasets annotated for toxicity and dialect: african predicted labels are toxic for dwmw17 and fdcl18. first and second sst2 examples are positive and negative, respectively. explanations of lexplain align better with the model prediction and contain more task-related terms. american english (aae) and white american english. the aae annotations are obtained from a demographically aligned ensemble model that learns a posterior distribution of topics corresponding to african american tweets @xcite . our task lexicons and full experiment details are described in appendix section a. training we use selfexplain as our baseline. when training both the baseline and lexplain, we keep the same hyperparameters and weights from the pretraining of the xlnet encoder and finetune the model for 5 epochs. in lexplain we do not use the gil, since initial experiments showed no difference between adding and removing the gil. for lexplain, we perform hyperparameter tuning for α 1 ∈ {0.01, 0.05, 0.1} and α 2 ∈ {0.8, 1.5.2.0} on the development set. we report results on the best configuration on the test sets. we extract phrases from sentences, by parsing each sentence with a constituency parser @xcite and extracting all non-terminals with a token length of up to 5 words in the parse tree. ## evaluating explanations the goal of lexplain is to train models to produce plausible explanations that align with their predictions. we start with an intrinsic evaluation, verifying that lexplain indeed promotes lexicon entries as explanations. we then analyze the sufficiency of the explanations and conduct human evaluation to show that explanations from lexplain are more plausible and preferred by humans. intrinsic evaluation: are lexicon entries ranked higher as explanations of the model? the lil outputs explanations as a rank of all input phrases. following lexicon supervision, we expect to see that phrases ranked higher contain more lexicon entries, indicating that supervision was effective. to quantify this, we compute in across all datasets, lexplain ranks lexicon entries higher than the baseline on average, showing the effectiveness of our supervision in providing explanations included in the task lexicon. we note that high-rank phrases should be the focus, thus in appendix 2 we plot the raw counts of lexicon entries that appear in each rank, across sentences in each dataset. clearly, lexplain puts more lexicon entries higher in the rank, this is especially noticeable in the highest ranked explanations (rank 1). do explanations sufficiently reflect model predictions? sufficiency measures how indicative explanations alone are of the model's predicted label @xcite . sufficient explanations are expected to reflect the prediction of the predicted label on their own. to measure that, we use the fresh pipeline @xcite : we train a bert-based classifier to perform the task with only the explanations as input, and with the originally predicted labels as output. higher accuracy on this task indicates that the explanations are more reflective of the model predictions. we train the sufficiency models with the top ranking explanations of each sentence as input. following @xcite , we measure this with a bert classifier trained with top ranked phrases as input and predicted label as output. higher accuracy indicates more sufficient explanations. ## downstream performance analysis to test our hypothesis that supervising explanations not only leads to plausible explanations, but robust models overfitting less to spurious confounds, we evaluate downstream classification performance. ## related work different works have approached interpreting models trained for various downstream tasks using post hoc @xcite @xcite and intrinsic @xcite ) methods. in this work we focus on intrinsic methods that highlight rationales @xcite @xcite -where parts of the input influential for prediction are extracted. some works leveraged interpretability methods to improve model performance @xcite . @xcite teach models to do commonsense tasks by providing step-by-step instructions. for classification tasks, @xcite use free-form explanation generation and hayati et al. (2022); @xcite ; @xcite use human rationales as model feedback. these methods require expensive annotation to elicit good explanations. we instead aim to supervise rationales using task lexicons, and show it yields improved explanations. ## conclusion we propose lexplain, a method to improve model explanations by directly supervising them using task lexicons as the source of supervision. we show that our method is indeed able to promote dictionary entries as explanations, resulting in explanations that align well with the model's predicted label without sacrificing accuracy, and that the explanations are more plausible according to human evaluation. we also show that lexplain is able to generalize well to features that are not present in the supervising lexicon. finally, we show that by promoting task related lexicon entries, we are able to demote spurious correlations with aae annotations on toxicity datasets.