The Art of Abstention: Selective Prediction and Error Regularization for Natural Language Processing (2021)

Abstract: In selective prediction, a classifier is allowed to abstain from making predictions on low-confidence examples. Though this setting is interesting and important, selective prediction has rarely been examined in natural language processing (NLP) tasks. To fill this void in the literature, we study in this paper selective prediction for NLP, comparing different models and confidence estimators. We further propose a simple error regularization trick that improves confidence estimation without substantially increasing the computation budget. We show that recent pre-trained transformer models simultaneously improve both model accuracy and confidence estimation effectiveness. We also find that our proposed regularization improves confidence estimation and can be applied to other relevant scenarios, such as using classifier cascades for accuracy–efficiency trade-offs. Source code for this paper can be found at https://github.com/castorini/transformers-selective .

## introduction recent advances in deep learning models have pushed the frontier of natural language processing (nlp). pre-trained language models based on the transformer architecture @xcite have improved the state-of-the-art results on many nlp applications. naturally, these models are deployed in various real-world applications. however, one may wonder whether they are always reliable, as pointed out by @xcite that modern neural networks, while having better accuracy, tend to be overconfident compared to simple networks from 20 years ago. in this paper, we study the problem of selective prediction @xcite in nlp. under the setting of selective prediction, a model is allowed to abstain from making predictions on uncertain examples (figure 1 ) and thereby reduce the error rate. this is a practical setting in a lot of realistic scenarios, such as making entailment judgments for breaking news articles in search engines @xcite and making critical predictions in medical and legal documents @xcite . in these cases, it is totally acceptable, if not desirable, for the models to admit their uncertainty and call for help from humans or better (but more costly) models. under the selective prediction setting, we construct a selective classifier by pairing a standard classifier with a confidence estimator. the confidence estimator measures how confident the model is for a certain example, and instructs the classifier to abstain on uncertain ones. naturally, a good confidence estimator should have higher confidence for correctly classified examples than incorrect ones. we consider two choices of confidence estimators, softmax response (sr; @xcite , and monte-carlo dropout (mc-dropout; @xcite . sr interprets the output of the final softmax layer as a probability distribution and the highest probability as confidence. mc-dropout repeats the inference process multiple times, each time with a different dropout mask, and treats the negative variance of maximum probability as confidence. confidence estimation is critical to selective prediction, and therefore studying this problem also helps relevant tasks such as active learning @xcite and early exiting @xcite @xcite . in this paper, we compare selective prediction performance of different nlp models and confidence estimators. we also propose a simple trick, error regularization, which can be applied to any of these models and confidence estimators, and improve their selective prediction performance. we further study the application of selective prediction on a variety of interesting applications, such as classification with no valid labels (no-answer problem) and using classifier cascades for accuracyefficiency trade-offs. experiments show that recent powerful nlp models such as bert @xcite and albert @xcite improve not only accuracy but also selective prediction performance; they also demonstrate the effectiveness of the proposed error regularization by producing better confidence estimators which reduce the area under the risk-coverage curve by 10%. ## related work selective prediction has been studied by the machine learning community for a long time @xcite . more recently, @xcite study selective prediction for modern deep learning models, though with a focus on computer vision tasks. selective prediction is closely related to confidence estimation, as well as out-of-domain (ood) detection @xcite and prediction error detection @xcite , albeit more remotely. there have been many different methods for confidence estimation. bayesian methods such as markov chain monte carlo @xcite and variational inference @xcite assume a prior distribution over model parameters and obtain confidence estimates through the posterior. ensemble-based methods @xcite @xcite estimate confidence based on statistics of the ensemble model's output. these methods, however, are computationally practical for small models only. current large-scale pre-trained nlp models, such as bert @xcite and roberta @xcite , are too expensive to run multiple times of inference, and therefore require lightweight confidence estimation. previously, selective prediction and confidence estimation have been studied in limited nlp scenarios. @xcite train a separate confidence scoring model to explicitly estimate confidence in semantic parsing. @xcite introduce selective prediction for ood question answering, where abstention is allowed for ood and difficult questions. however, selective prediction for broader nlp applications has yet to be explored, and we hope to draw the attention of the nlp community to this problem. there are two notable related topics, confidence calibration and unanswerable questions, but the difference between them and selective prediction is still nontrivial. calibration @xcite @xcite @xcite focuses on adjusting the overall confidence level of a model, while selective prediction is based on relative confidence among the examples. for example, the most widely used calibration technique, temperature scaling @xcite , globally increases or decreases the model's confidence on all examples, but the ranking of all examples' confidence is unchanged. unanswerable questions are considered in previous datasets, e.g., squad2.0 @xcite . the unanswerable questions are impossible to answer even for humans, while abstention in selective prediction is due to model uncertainty rather than modelagnostic data uncertainty. ## background we introduce relevant concepts about selective prediction and confidence estimators, using multiclass classification as an example. ## experiments we conduct experiments of selective prediction on nlp tasks. since the formulation of selective prediction is model agnostic, we choose the in this section, we compare the performance of selective prediction of these models, demonstrate the effectiveness of the proposed error regularization, and show the application of selective prediction in two interesting scenarios-the no-answer problem and the classifier cascades. ## conclusion in this paper, we introduce the problem of selective prediction for nlp. we provide theoretical background and evaluation metrics for the problem, and also propose a simple error regularization method that improves selective prediction performance for nlp models. we conduct experiments to compare different models under the selective prediction setting, demonstrate the effectiveness of the proposed regularization trick, and study two scenarios where selective prediction and the error regularization method can be helpful. we summarize interesting experimental observations as follows: future work (1) despite the effectiveness of the proposed error regularization trick, we are not certain on the best way for computing the error (current or history); it is important to unify them into one method that consistently does well. (2) we have only covered a selection of nlp tasks, and there are still other unexplored categories: tokenlevel classification such as named entity recognition and question answering, sequence generation such as summarization and translation, and so on; it would be interesting to extend selective prediction to these problems. (3) there exists another setting for selective prediction where abstention induces a fixed cost @xcite and the goal is to minimize the overall cost instead of auc; it would also be interesting to investigate this setting for nlp applications.