A well-calibrated neural model produces confidence (probability outputs) closely approximated by the expected accuracy. While prior studies have shown that mixup training as a data augmentation technique can improve model calibration on image classification tasks, little is known about using mixup for model calibration on natural language understanding (NLU) tasks. In this paper, we explore mixup for model calibration on several NLU tasks and propose a novel mixup strategy for pre-trained language models that improves model calibration further. Our proposed mixup is guided by both the Area Under the Margin (AUM) statistic (Pleiss et al., 2020) and the saliency map of each sample (Si-monyan et al., 2013). Moreover, we combine our mixup strategy with model miscalibration correction techniques (i.e., label smoothing and temperature scaling) and provide detailed analyses of their impact on our proposed mixup. We focus on systematically designing experiments on three NLU tasks: natural language inference, paraphrase detection, and commonsense reasoning. Our method achieves the lowest expected calibration error compared to strong baselines on both in-domain and out-of-domain test samples while maintaining competitive accuracy. Training a well-calibrated classifier that produces a match between confidence (the probability output that a model assigns to a prediction) and correctness (accuracy), is important in modern neural networks. As an example, if an AI-based application knows what it does not know , or in other words, the chance that the current prediction is wrong, a human is more helpful to correct the error. However, many works reveal that current deep neural networks are prone to over-confidence, which implies that the models' confidence is not reliable (Guo et al., 2017). This is a critical issue on the deployment of AI-based user applications such as the healthcare domain (Zhu et al., 2018; Li et al., 2019) or safety-critical domain (Sarabadani, 2019) due to the problem of prediction trustworthiness. Recently, the study of calibration on neural network models especially on natural language processing tasks has started to receive attention. To overcome the problem of miscalibration, numerous suggestions on how to address it have been proposed. For example, Guo et al. (2017) revealed that using temperature scaling before the final softmax layer reduces calibration errors. Mller et al. (2019), Kumar and Sarawagi (2019), and Wang et al. (2020a) found that label smoothing and its variants yield better calibration for neural machine translation. Desai and Durrett (2020) also reported that the aforementioned miscalibration correction methods can be applied to calibrate pre-trained language models which are often miscalibrated potentially due to over-parameterization. Mixup (Zhang et al., 2018) is a data augmentation method for deep neural networks in which additional samples are generated during training by combining random pairs of training inputs and their associated labels. While simple to implement, mixup has been shown to improve both predictive performance and model calibration, particularly on image classification tasks due to its regularization effect through data augmentation (Thulasidasan et al., 2019). The recent success of mixup on image classification has led to the development of various mixup strategies for NLU especially those that use hidden state representations (Guo et al., 2019a; Chen et al., 2020; Zhang et al., 2020; Sun et al., 2020; Kong et al., 2020; Yin et al., 2021). However, most prior works on NLU focus on performance improvement using mixup rather than model calibration. Despite its benefits for calibration, a mixup for correcting miscalibrated predictions is still an under-explored topic in NLU. While Kong et al. (2020) explored BERT (Devlin et al., 2019) cali-5364 bration using mixup for both in-domain and out-of-domain, they only focused on generating mixup samples by utilizing the distance between instances in the feature space. In contrast, we propose a novel mixup method, in which we first leverage the behavior of a model on individual samples during training (training dynamics), which can reveal samples with distinct pronounced characteristicswhether they are easy-to-learn or hard-to-learn/ambiguous for the model, and then we generate mixup samples by mixing easy-to-learn with hard-to-learn/ambiguous samples according to their similarity/dissimilarity provided by saliency maps. Saliency maps capture how much each data portion contributes to the final classification decision of a sample (Si-monyan et al., 2013). Intuitively, easy-to-learn samples help with model optimization, whereas hard-to-learn or potentially ambiguous samples are essential for learning since they are the most challenging for the model (Swayamdipta et al., 2020), and mixing them using saliency maps can yield better calibrated models (more realistic model con-fidence), e.g., mixing easy-to-learn with hard-to-learn/ambiguous samples by similarity in saliency maps can benefit in-domain calibration and by dissimilarity can benefit out-of-domain calibration. To monitor training dynamics, we use the Area Under the Margin (AUM) statistic (Pleiss et al., 2020) which measures how different a true label for a sample is compared to a model's beliefs at each epoch and is calculated as the average difference between the logit values for a sample's assigned class and its highest non-assigned class across training epochs. Moreover, we combine our mixup with wellknown miscalibration correction methods such as label smoothing and temperature scaling (Guo et al., 2017) to investigate their impact on our proposed mixup. We conduct a comprehensive set of experiments using BERT (Devlin et al., 2019) and RoBERTa (Liu et al., 2019) to show the efficacy of our mixup approach by testing on three NLU tasks: natural language inference, paraphrase detection, and commonsense reasoning. We achieve the lowest Expected Calibration Error (ECE) without accuracy drops in comparison with strong baseline methods. Our contributions are as follows:  We propose a novel mixup method which is guided by AUM and saliency signals and is targeted at improving model calibration. Specifically, we compare logits to categorize samples into two sets (i.e., a set of easy-to-learn samples and another set of hard-to-learn/ambiguous samples), and interpolate samples across these two sets by find-ing the most similar and most dissimilar samples from the other set while leveraging saliency (to compute sample similarities) for pre-trained language models' calibration on in-domain and out-of-domain data. We combine our method with miscalibration correction techniques (i.e., label smoothing, temperature scaling) to investigate their impact on our proposed mixup. We conduct comprehensive experiments showing that our method achieves the lowest expected calibration errors (ECEs) on both in-domain and out-of-domain samples compared with strong baselines without accuracy drops on multiple NLU tasks, namely, natural language inferences, paraphrase detection, and commonsense reasoning. Model Calibration Calibration on NLU tasks has been widely studied in related literature. Nguyen and O'Connor (2015) provided the method of how to analyze the calibration of non-neural NLP models. Guo et al. (2017) examined the calibration of modern deep neural networks and revealed that techniques such as temperature scaling and dropout affect the calibration on binary/multi-class classification tasks. Wang et al. (2020b) investigated the calibration of neural machine translation models and found that inference suffers from serious miscalibration. Jagannatha and Yu (2020) demonstrated that neural networks show high calibration error on structured predictions such as NER, POS, and QA, and proposed to use a binary class forecaster to calibrate the predictor confidence for a defined output entity of interest. Desai and Durrett (2020) explored pre-trained language models' calibration in combination with temperature scaling and label smoothing both on in-domain and out-of-domain datasets. Jung et al. (2020) jointly optimized two objectives (a cross-entropy loss and a calibration loss) and directly penalized the difference between the predicted and the true posterior probabilities dynamically over the training steps. He et al. (2021) obtained better calibration on natural language understanding tasks by augmenting and training the classifier jointly with an energy-based model using noise-contrastive estimation. Mixup Mixup (Zhang et al., 2018) is a method for data augmentation in which additional samples are generated during training by convexly combining random pairs and their associated labels, and aims to alleviate overfitting. Verma et al. (2019) showed that manipulating hidden representations rather than manipulating input-level features on mixup results in better regularization effects due to the fact that it encourages the neural network to focus more on representations of the real training examples in a low dimensional subspace. Many works have empirically noticed regularization effects that improve model performance on deep neural networks. For example, Guo et al. (2019a) explored the NLU specific mixup strategy by using sentence and word embeddings on CNNs and LSTMs to add performance gains in supervised text classification. Chen et al. (2020) proposed mixup for semi-supervised learning in which labeled and unlabeled samples are interpolated with their hidden representations to improve the performance of text classification. Zhang et al. (2020) explored mixup for sequence labeling tasks with active learning to improve the performance of supervised sequence labeling tasks. Yin et al. (2021) proposed mixup that interpolates every instance in a mini-batch to boost the performance of NLU tasks on the pre-trained language model RoBERTa (Liu et al., 2019). Similar to us, Yoon et al. (2021) explored mixup by incorporating saliency signals to generate augmented samples. Precisely, they use saliency signals to select a span of text from one sample to be replaced with another text span from another sample. However, in contrast, our method first divides data samples into two categories (easy-to-learn and hard-to-learn/ambiguous categories) according to their AUM (Pleiss et al., 2020) distribution monitored over training epochs and then uses saliency to find the most similar/dissimilar samples across these two data categories. Recently, several works started to explore mixup for NLU model calibration. For example, Thulasidasan et al. (2019) investigated the impact of mixup for model calibration of NLU but only explored in-domain settings with simple deep learning architecture such as CNNs. Kong et al. (2020) explored BERT calibration using mixup as a regularization component on in-domain and out-of-domain. However, their mixup method only relied on the feature space distance between samples. In contrast, we explore a novel mixup method in which we categorize the training samples into two sets using AUM (Pleiss et al., 2020) and combine samples across these two sets based on saliency signals, for in-domain and out-of-domain model calibration. Background Let D train = { ( x i , y i ) } i =1 ,  ,n be a training set and f a language model. Mixup training generates vicinity training samples according to the rule introduced in Zhang et al. (2018):  x = x i + (1   ) x j  y = y i + (1   ) y j (1) where x i and x j are two randomly sampled input points, y i and y j are their associated one-hot encoded labels, and  is a mixing ratio sampled from a Beta(  ,  ) distribution with a hyper-parameter  . In mixup, training data is augmented by linearly interpolating training samples in the input space. We propose a mixup method targeted at improving model calibration that synthesizes samples guided by the Area Under the Margin (AUM) (Pleiss et al., 2020) and saliency (Simonyan et al., 2013). Data Categorization In our method, we first categorize D train into two sets (a set of easy-to-learn samples and a set of hard-to-learn/ambiguous samples) according to the AUM of each sample. Given a sample ( x i , y i ) , we compute AUM ( x i , y i ) as the area under the margin averaged across all training epochs T . Specifically, at some epoch t  T , the margin is defined as: M t ( x i , y i ) = z y i  max y i where M t ( x i , y i ) is the margin of example x i with gold label y i , z y i is the logit corresponding to the gold label y i , and max y i != k ( z k ) is the largest other logit corresponding to label k not equal to y i . Precisely, the margin measures how different a gold label is compared to a model's beliefs at each epoch t . The AUM of ( x i , y i ) across all epochs is: AUM ( x i , y i ) = 1 TT (cid:88) t =1 M t ( x i , y i ) (3) Intuitively, the samples with high AUM are easy-to-learn (the model's belief matches the gold label), but they are essential for model optimization, while 5366 Algorithm 1 : Identify high/low AUM samples Require: D train = { ( x i , y i ) } i =1 ,  ,n ; model f 1: function DATA-CATEGORIZATION ( D train ) 2: D high   , D low   3: Train f for T epochs and compute AUM ( x i , y i ) for each i as in Eq. the samples with low AUM are hard-to-learn or ambiguous (and hence they are the most challenging for the model), but they are essential for learning. Our proposed mixup method first splits D train into two data categories depending on whether the AUM value is high or low, namely, D high and D low . In experiments, we compute the median AUM over the entire training samples and use it as a threshold to split the dataset. If a sample has a lower AUM than the threshold, we add the sample to D low , otherwise we add it to D high . Accordingly, we balance D high and D low , but other splits are possible. We then conduct a mixup operation by referring to each other set. Mixing easy-to-learn and hard-to-learn adjusts the difficulty of samples and hence adjusts models' confidence according to samples' difficul-ties and yields better calibrated models. The data categorization step is summarized in Algorithm 1. Mixup using Saliency Signals We conduct a mixup operation on the two data categories generated by Algorithm 1 using saliency signals (as detailed below). For the mixup, rather than selecting random samples from D high and D low to mix, we utilize saliency signals to select samples. To measure saliency, gradient-based methods are usually used for saliency computation (Li et al., 2016; Rei and Sgaard, 2018; Yoon et al., 2021). Following this idea, we simply compute the gradient of the classification loss L with respect to each logit value z i  z and take the absolute value of the gradient components as the saliency map or signature S for a sample ( x i , y i )  D train . For a sample ( x i , y i ) , we then leverage its saliency map S to find the most similar and most dissimilar samples from Algorithm 2 : Proposed Mixup Require: D train = { ( x i , y i ) } i =1 ,  ,n ; model f 1: D high , D low  DATA-CATEGORIZATION ( D train ) 2: for k := 0 to T do 3: T otal _ Loss  0 4: for i := 0 to |D train | do 5: Loss  CrossEntropy ( f ( x i ) , y i ) 6: Construct a saliency map S by computing the gradient of Loss with respect to z 7: if ( x i , y i )  D high then : 8: Find the most similar/dissimilar samples from D low using Eq. the other data category that ( x i , y i ) does not belong to according to its AUM, in order to calibrate in-domain and out-of-domain data. For example, if ( x i , y i )  D high , we find its most similar sample ( x (cid:48) i , y (cid:48) i ) and its most dissimilar sample ( x (cid:48)(cid:48) i , y (cid:48)(cid:48) i ) from D low , that return the largest and smallest cosine similarity, respectively, with the saliency map S of ( x i , y i ) . That is, the most similar and most dissimilar samples to ( x i , y i )  D high are calculated as follows: ( x (cid:48) i , y (cid:48) i ) = argmax ( x j ,y j ) D low CosSim ( S, S ( x j ,y j ) ) ( x (cid:48)(cid:48) i , y (cid:48)(cid:48) i ) = argmin ( x j ,y j ) D low CosSim ( S, S ( x j ,y j ) ) (4) Similarly, if ( x i , y i ) belongs to D low , we find the most similar/dissimilar samples from D high that return the largest/smallest cosine similarity with S 5367 as follows: ( x (cid:48) i , y (cid:48) i ) = argmax ( x j ,y j ) D high CosSim ( S, S ( x j ,y j ) ) ( x (cid:48)(cid:48) i , y (cid:48)(cid:48) i ) = argmin ( x j ,y j ) D high CosSim ( S, S ( x j ,y j ) ) (5) We then generate two mixup samples for a given sample ( x i , y i ) by interpolating the selected samples, which are the most similar sample ( x (cid:48) i , y (cid:48) i ) , and the most dissimilar sample ( x (cid:48)(cid:48) i , y (cid:48)(cid:48) i ) . For the mixup operation, we follow the original mixing ratio sampling strategy which is shown in Eq. (1). The ratio  is sampled from a Beta( ,  ) distribution with a hyper-parameter  . Intuitively, by synthesizing the original sample and the most similar sample from the other data category, we calibrate in-domain data. The augmented sample mimics in-domain sample since it aligns the most with the original sample. Furthermore, by selecting the sample from the other category, we allow the generated mixup sample to combine easy-to-learn and hard-to-learn samples properly. By synthesizing the original and the most dissimilar sample from the other data category, we calibrate out-of-domain data. The augmented sample mimics out-of-domain instances since we pick a sample that is the most dissimilar to the original sample. As above, by selecting the sample from the other category, we allow the augmented sample to contain both information of easy-to-learn and hard-to-learn samples, useful for both optimization and learning. Note that our mixup method mixes samples on the level of [CLS] hidden state representations generated by task-specific layer on top of the pre-trained language model. We summarize the process in Algorithm 2. We combine each loss by weighted sum (see Alg. 2) where , ,  are hyper-parameters that sum up to 1. In our experiments, we conduct our mixup operation using mini-batch SGD to update the model weights. Note that other saliency measures are possible to compute similar-ity/dissimilarity between samples and will be an interesting future direction. A model is perfectly calibrated when the confidence estimate  p of the model is equal to true probability (accuracy) P ( y = y |  p ) =  p . (Naeini et al., 2015; Guo et al., 2017; Desai and Durrett, 2020). This can be empirically approximated by discretiz-ing the probability interval into a fixed number of bins M = 10 where each bin b m contains predicted probabilities that encompass the interval. The expected calibration error (ECE) is calculated by weighting the average of the difference between each bin's accuracy and confidence as follows: acc ( b m ) = 1 | b m | (cid:88) i  b m 1 ( y i = y i ) conf ( b m ) = 1 | b m | (cid:88) i  b m  p i ECE = M (cid:88) m =1 | b m | N | acc ( b m )  conf ( b m ) | where N is the total number of predictions. We explore the combination of miscalibration correction methods (described below) with mixup to investigate their impact on our proposed mixup for model calibration. Label Smoothing (LS) In supervised learning, one-hot encoded labels fail to provide uncertainty of inputs due to the fact that all the probability mass is given to one class. This results in over-confident models since the largest logit becomes larger than the others which removes the uncertainty of label space. Label smoothing (LS) is a solution to penalize this by preventing the models from becoming over-confident. In this work, we incorporate label smoothing with our proposed mixup. We generate smoothed one-hot target signal while creating mixup instances by distributing  | y | 1 mass over non ground-truth classes, where   (0 , 1) is a hyper-parameter and | y | is the number of classes. 1 Temperature Scaling (TS) Temperature scaling (TS) is a post-processing step which re-scales the logit vector z using a single scale parameter temperature, T > 0 for all classes. TS has the effect of softening the outputs to be uniform with T > 1 , while T  0 has the effect of collapsing probability mass to one class. We explore the effect of TS when incorporated with our proposed mixup. We evaluate our calibration-targeted mixup on three natural language understanding tasks: natural lan-1 guage inference, paraphrase detection, and commonsense reasoning. We evaluate the models in-domain (training and testing on data from the same distribution) and out-of-domain (training and testing on data from different distributions). Mixup reduces the number of undesirable oscillations when predicting especially on out-of-distribution samples (Zhang et al., 2018). Hence, effective mixup should be less prone to over-fitting when handling out-of-distribution data. To test the benefits of our proposed method for pre-trained language model calibration, we use in-domain trained models to predict out-of-distribution test samples. We describe our in-domain and out-of-domain sets as follows. Natural Language Inference Stanford Natural Language Inference (SNLI) is a natural language inference task to predict if the relation between a hypothesis and a premise is entailment, contradiction, or neutral (Bowman et al., 2015). Multi-Genre Natural Language Inference (MNLI) captures natural language inference with more diverse domains (Williams et al., 2018) than SNLI. Paraphrase Detection Quora Question Pairs (QQP) is a paraphrase detection task to test if two questions are semantically equivalent (Iyer et al., 2017). TwitterPPDB (TPPDB) is to determine whether sentence pairs from Twitter convey similar semantics when they share URLs (Lan et al., 2017) Commonsense Reasoning Situations With Adversarial Generations (SWAG) is a commonsense reasoning task to choose the most plausible continuation of a sentence among four candidates (Zellers et al., 2018). HellaSWAG is a dataset built using adversarial filtering to generate challenging out-of-domain samples. It is distributionally different in that its examples exploit statistical biases in pre-trained models. In this work, we explore the mixup effects on NLU with the goal of producing better calibrated models, in particular pre-trained language models, which are BERT (Devlin et al., 2019) and RoBERTa (Liu et al., 2019). We consider the following baselines:  Pre-trained Language Models : Pre-trained language models fine-tuning on each downstream task using BERT (Devlin et al., 2019) and RoBERTa (Liu et al., 2019). Mixup (Zhang et al., 2018; Thulasidasan et al., 2019): Mixup augments training data by linearly interpolating randomly selected training samples in the input space. The interpolation of Mixup is performed on the input embeddings obtained from the first layer of the language model. Manifold-mixup (M-mixup) (Verma et al., 2019) : An extension of Mixup, which interpolates training samples in the hidden feature space. The interpolation of Manifold-mixup is performed on the features obtained from the last layer of the language model. Each method is compared with two variants where miscalibration correction methods (label smoothing, LS and temperature scaling, TS) are applied. 2 4.3 Implementation Details We use the same set of hyper-parameters across all tasks as Desai and Durrett (2020) for a fair comparison. We train models with a maximum of 3 epochs. For BERT, we set batch size of 16, a learning rate of 1e-5, gradient clip of 1.0, and no weight decay. For RoBERTa, we set batch size of 32, a learning rate of 2e-5, gradient clip of 1.0, and weight decay of 0.1. We follow the published train/validation/test split by Desai and Durrett (2020). 3 For mixup, we use a mixing ratio sampling strategy hyper-parameter  = 0 . 4 . We use loss weight hyper-parameters, , , , values as 0 . 8 / 0 . 1 / 0 . 1 respectively. We did hyper-parameter search for label smoothing   [0 . 001 , 0 . 003 , 0 . 01 , 0 . 03 , 0 . 1 , 0 . 3] . We use  = 0 . 01 / 0 . 03 / 0 . 3 for BERT,  = 0 . 003 / 0 . 03 / 0 . 3 for RoBERTa on SNLI/QQP/SWAG, respectively. We use threshold values for splitting data into two groups D high and D low (the median AUM over full training samples) as 3 . 5 / 4 . 4 / 2 . 5 for BERT, 3 . 4 / 4 . 0 / 2 . 7 for RoBERTa on SNLI/QQP/SWAG, respectively. For all results, we report the mean across five training runs with random restarts. Finally, all experiments are conducted on a single NVIDIA RTX A5000 24G GPU with a total time for fine-tuning all models being under 24 hours. Temperature scaling (TS) searches are performed in the range of [0.01,5.0] with a granularity of 0.01 using development datasets. TS is completed very fast since it uses separate cached logits. We show the comparison of experimental results (ECE) on BERT and RoBERTa in Table 1. For each task, we train the model on in-domain training set, and evaluate its expected calibration errors (ECEs) on in-domain and out-of-domain test sets. We make the following observations: First, for in-domain data, label smoothing (LS) does not exhibit its effectiveness on pre-trained language models' calibration. Specifi-cally, for in-domain data, pre-trained language models with LS (i.e., BERT+LS/RoBERTa+LS) achieve higher expected calibration errors (ECEs) compared with vanilla pre-trained language models (i.e., BERT/RoBERTa) on all tasks. In contrast, out-of-domain gains benefit from LS (ex-cept RoBERTa on MNLI). From these results, we conclude that simply incorporating label uncertainty (through label smoothing) is not an effective regularization method since LS does not consistently improve the model calibration (especially for the in-domain setting). While temperature scaling (TS) corrects the miscalibration of vanilla pre-trained language models (see BERT/RoBERTa No TS vs. TS in the table), it fails to correct miscalibrated pre-trained language models with LS (see BERT+LS/RoBERTa+LS No TS vs. TS) in-domain. Interestingly, for some cases of out-of-domain data, pre-trained language models with LS show comparatively low ECEs while TS further reduces ECEs (e.g., BERT(LS) on Twit-terPPDB/HellaSWAG, RoBERTa(LS) on TwitterP-PDB). However, its impact is not enough as it still results in high ECE. This implies that TS is not a notable strategy either to pre-trained language models' calibration. Accordingly, we conclude that stronger regularization techniques are required to calibrate the pre-trained language models. Second, we find that mixup on the hidden feature space (i.e., M-Mixup) generally yields lower ECE than mixup on the input embedding space (i.e., Mixup) on most tasks. We infer that Mixup generates augmented samples that are not good for model calibration (i.e., semantically or syntactically) and fails to encourage regularization effects that arise from mixup. We observe that mixup training with LS is beneficial to reduce ECEs on some tasks. We find that TS leads to much lower ECEs on Mixup and M-Mixup (with and without LS) on most tasks. However, this implies that baseline mixup methods fail to produce well-calibrated models independently (without LS or TS). This supports our intuition and motivation for the design of a more robust approach of mixup. Third, we observe that our proposed mixup yields the best calibrated models (lowest ECEs) both on in-domain and out-of-domain data (ex-cept on SWAG with RoBERTa). We observe that often LS effectively operates along with our proposed mixup and achieves the lowest ECEs on most tasks on in-domain and out-of-domain settings. In contrast to baseline mixup methods, our proposed mixup performs well on in-domain and out-of-domain even without applying post-calibration correction TS (see ECE values of baselines compared with our ECE values). We also observe that TS improves the model calibration further on our mixup training in most cases. Accordingly, we confirm the robustness of our AUM and saliency guided mixup for pre-trained language models calibration. Accuracy We explore the accuracy of mixup training and show comparisons in Table 2. We make the following observations: 1) Both BERT+LS/RoBERTa+LS generally lead to substantial accuracy drops especially on in-domain compared with BERT/RoBERTa (i.e., 4.49% accuracy drops on SWAG). This implies that label smoothing (LS) fails to improve model generalization by simply manipulating labels (changing from hard to soft labels). This potentially leads to a loss of information that is correlated to model generalization (Mller et al., 2019). 2) Mixup and M-Mixup fail to achieve an accuracy that is as good as that of vanilla pre-trained language models, potentially due to an increased chance of manifold intrusion resulting from conflicts between the synthetic samples of the mixup and original training data (Guo et al., 2019b). 3) In contrast, our proposed mixup method generally achieves competitive accuracy regardless of applying LS or not. This evidence supports the robustness of our proposed mixup. Note that TS does not affect the model's accuracy because it does not change the maximum of the softmax function. Effect of AUM and Saliency We investigate the effectiveness of each component (i.e., AUM and saliency) in our proposed mixup. As shown in Table 3, our proposed mixup without the AUM (i.e., -AUM) and without saliency (i.e., -Saliency) generally increase the expected calibration errors. In our method without using AUM, we randomly divide training data into two categories and conduct mixup operation based on saliency map. In our method without using saliency, we randomly pick two samples from the opposite low and high AUM set and conduct mixup operation. The results demonstrate that both metrics (AUM and saliency) are required to improve model calibration. Effect of selecting the most similar and dissimilar samples We explore the effectiveness of selecting the most similar and dissimilar samples, which are used for mixing purposes for in-domain and out-of-domain calibration, respectively. Specifically, in our proposed mixup, we synthesize additional samples that mimic in-domain data by selecting the most similar sample from the other category (e.g., an easy-to-learn sample is mixed with a hard-to-learn/ambiguous sample that is most similar to the easy-to-learn sample, by saliency maps). This is because the selected sample aligns the most with the given sample. This intuitively results in better model generalization due to the effect arising from data augmentation (i.e., augmenting samples that are particularly similar to in-domain data) and allows better in-domain calibration. Similarly, we calibrate out-of-domain by augmenting a sample that mimics out-of-domain distribution. This is because we select the sample that is the most different from a given sample by selecting the most dissimilar sample from the other category. To verify this intuition, we conduct our proposed mixup when excluding the most similar instance (i.e., -similar) and the most dissimilar instance (i.e., -dissimilar), respectively. Table 3 shows the results of this ablation. We observe that our proposed mixup without using the most dissimilar sample (i.e., -dissimilar) results in higher ECEs compared with our mixup that uses dissimilar samples on all tasks in the out-of-domain setting for both BERT and RoBERTa. Interestingly, we observe that our proposed mixup without using the most similar sample (i.e., -similar) results in higher ECEs compared with our mixup that uses the most similar samples on in-domain and out-of-domain data for both BERT and RoBERTa. These results support that selecting the most sim-ilar/dissimilar samples effectively calibrates pre-trained models for in-domain/out-of-domain data. We proposed a novel mixup guided by the Area Under the Margins (AUM) and saliency maps to mitigate the miscalibration of pre-trained language models BERT and RoBERTa. We showed that our proposed mixup method achieves the lowest Expected Calibration Errors (ECEs) for both pre-trained language models on various types of natural language understanding tasks, for both in-domain and out-of-domain data. For future work, we will enhance our proposed mixup further, focusing not only on model calibration but also on performance gains. Exploring different saliency maps for computing sample similarity/disimilarity (and its degree) is another interesting future direction. This research is supported in part by NSF CAREER award #1802358 and NSF CRI award #1823292. Any opinions, findings, and conclusions expressed here are those of the authors and do not necessarily reflect the views of NSF. We thank AWS for computing resources. We also thank our anonymous reviewers for their constructive feedback and comments, which helped improve our paper.
abstain abstain objective abstain objective method result abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain other abstain other method abstain result result objective other objective result other other other other other other other other other other other other other other other abstain other abstain other other other other abstain abstain other abstain method method method abstain abstain abstain abstain other abstain method method method method method abstain abstain method method abstain method method abstain method method method abstain abstain method abstain method method method method method method method method abstain abstain abstain abstain other method abstain abstain abstain method method abstain abstain method abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain method method abstain abstain abstain abstain abstain method method method method method method abstain method abstain abstain abstain method method abstain abstain abstain abstain abstain abstain method abstain abstain abstain abstain abstain abstain result abstain abstain abstain result abstain abstain abstain abstain result abstain abstain abstain abstain abstain result abstain result result abstain abstain abstain abstain abstain result abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain objective objective objective abstain other other other other