On the Evaluation of Neural Selective Prediction Methods for Natural Language Processing (2023)

Abstract: We provide a survey and empirical comparison of the state-of-the-art in neural selective classification for NLP tasks. We also provide a methodological blueprint, including a novel metric called refinement that provides a calibrated evaluation of confidence functions for selective prediction. Finally, we supply documented, open-source code to support the future development of selective prediction techniques.

## introduction deep learning has brought massive improvements to natural language processing over the past decade, but neural networks still make mistakes. accordingly, there is a current interest in confidence estimation techniques that perform well on deep neural networks. a prominent subarea of confidence estimation is selective prediction @xcite . selective prediction focuses on developing classifiers that choose to abstain when sufficiently uncertain. there is less focus on absolute measures of confidence, and more on a classifier's ability to successfully rank its predictions, enabling techniques that maximize prediction quality given a desired yield @xcite or that maximize yield given a desired quality @xcite . this paper provides a survey and rigorous empirical comparison of the state-of-the-art in neural selective classification (i.e. selective prediction where the underlying classifier is a neural network) specifically as it pertains to natural language processing. our main contributions: (a) we survey a variety of recent techniques proposed in the ml and nlp literature and compare them across six classification tasks from the glue benchmark @xcite , do careful hyperparameter tuning for all surveyed techniques, and perform multiple trials of each technique to get an adequate sense of median and variance; (b) inspired by @xcite and kendall-tau distance @xcite , we propose a simple metric called refinement that provides a calibrated measure of the performance of selective classification techniques; (c) we determine that using maximum softmax probability as a confidence indicator remains a strong baseline, but monte carlo dropout @xcite demonstrates significant improvement across multiple tasks and trials; (d) we release a documented python package called spred (selective prediction) to make our experiments transparent and reproducible. to facilitate evaluation of future techniques, the package provides tutorials about how to add and evaluate novel selective prediction methods. ## surveyed techniques our main goal in this paper is a reproducible and thorough comparison of a broad range of selective prediction techniques on nlp tasks. in this section, we describe the techniques we compare. ## experiment design to draw reliable conclusions on a sufficiently varied set of nlp tasks, we evaluated the techniques on six classification foot_6 tasks of the glue benchmark @xcite : cola, mnli, mrpc, qnli, rte, and sst-2. bearing in mind that our goal is to compare selective classification techniques, not to produce state-of-the-art prediction functions, we randomly partitioned each training set into two halves, using gluetrain-a for training and gluetrain-b for early stopping and hyperparameter tuning. since the gold labels for glue test sets are not all publicly available, we reserved the development set (gluedev) of each task for final evaluation. we trained the prediction function by fine-tuning bert-base-cased using the transformers package @xcite , mostly using the training parameters recommended by its run_glue.py script (the sole deviation is that we run each training for 6 epochs, rather than 3). for the techniques that required specialized loss functions, we substituted the default bert loss function with the alternative specified by the selective prediction technique. ## results for final evaluation, we ran ten experiment trials on the six glue tasks. specifically, we trained ten prediction functions with different random seeds for each loss function: the basic bert loss (basic), bert loss with error regularization (ereg.b, where @xmath0, 16} is the minibatch size), and the deep abstaining classifier loss (dac). for each resulting prediction function, we evaluated the various confidence functions. in all experiment trials, we used the hyperparameter settings established in section 4. figure 5 visualizes the results foot_8 for two glue datasets (mrpc and sst-2) using a violin plot foot_9 . each "string" of the violin corresponds to the refinement of a single trial on gluedev, while the "body" of the violin is a kernel density estimation of the result distribution. these results indicate that all techniques have considerable variation from trial to trial, and that each outperforms a random confidence baseline (which has an expected refinement of 0.5, according to theorem 2). beyond this, it is difficult to eyeball the results and make an informed decision about which technique to use. one can possibly eliminate trustscore based on figure 5 , but what should we make of the advantages that mcdm and mcdv seem to offer over the basic maxprob approach? the mc dropout techniques are considerably more expensive to run (since they require multiple independent decodings). are they meaningfully better than maxprob? we quantify the phrase "meaningfully better" by estimating the likelihood that a candidate technique outperforms the basic maxprob baseline. for a candidate technique t and evaluation metric m, define random variable x t,m as the result of the following trial: the expected value e(x t,m ) tells us the likelihood that technique t will outperform the baseline according to metric m . since we performed 10 trials for each of 6 glue tasks, we therefore have 60 samples 11 for estimating e(x t,m ). figure 6 shows the e(x t,refinement ) estimate for eight techniques (including the random confidence baseline), along with a 95% confidence interval. somewhere between 62% to 85% of the time (with 95% confidence), both mcdm and mcdv improve upon the maxprob baseline according to refinement. on its own, refinement is sufficient to evaluate the techniques that only modify the confidence function (i.e. mcdm, mcdv, and trustscore). techniques that employ specialized loss functions, (e.g. error-regularization or dac loss) should be evaluated using both refinement and aupr, since these techniques might improve the efficiency of the confidence function while simultaneously sacrificing the quality of the prediction function. simultaneous evaluation with aupr and refinement allows us to distinguish whether improvements are achieved via enhancements to the confidence or the prediction function. in these experiments, aupr and refinement largely agree about the quality of the loss specialization techniques, thus the techniques do not appear to impact the quality of the prediction function. in terms of improving the confidence function, ereg shows promise, but the trajectory of performance from minibatch size 8 to minibatch size 16 suggests that ereg needs a minibatch size of at least 32 to be a superior alternative to maxprob. ## related work selective prediction has a long tradition in machine learning, dating back to the 1950s @xcite . there is an extensive literature @xcite @xcite on training classifiers with the ability to abstain (also known as the "reject option"), usually specific to alternative classifiers like support vector machines. there is also a significant literature @xcite @xcite @xcite ) on the topic of calibration, i.e. the development of probabilistically interpretable confidence measures. in this paper, we restrict our focus to the relative rankings of selective predictors, and not the confidence values themselves. while our survey focuses on techniques designed to identify ambiguous instances in the evaluation set (and, for certain techniques, to also ignore label noise in the training set), there is also interest in selective prediction techniques that operate successfully under domain shift @xcite figure 6 : estimate of the likelihood e(x t,m ) that technique t outperforms the basic maxprob baseline according to metric m (refinement or aupr). the bars show a 95% confidence interval for this estimate. @xcite , i.e. when the distribution of evaluation instances differs from the training instances. evaluation of such techniques is beyond the scope of the work described here, but we have plans to expand the spred package to evaluate selective prediction under domain shift. ## conclusion we have provided a survey and empirical comparison of a diverse set of recent selective prediction techniques on a broad set of tasks. as a companion to the paper, the open-source python package spred provides reproducible results and transparent methodology. moreover, it comes with tutorials and unit tests that demonstrate how new techniques and tasks can be easily added. we hope this will facilitate novel selective prediction research on natural language domains.