Calibrated Language Model Fine-Tuning for In- and Out-of-Distribution Data
31013Authors
nan
Abstract
AbstractFine-tuned pre-trained language models can suffer from severe miscalibration for both in-distribution and out-of-distribution (OOD) data due to over-parameterization. To mitigate this issue, we propose a regularized fine-tuning method. Our method introduces two types of regularization for better calibration: (1) On-manifold regularization, which generates pseudo on-manifold samples through interpolation within the data manifold. Augmented training with these pseudo samples imposes a smoothness regularization to improve in-distribution calibration. (2) Off-manifold regularization, which encourages the model to output uniform distributions for pseudo off-manifold samples to address the over-confidence issue for OOD data. Our experiments demonstrate that the proposed method outperforms existing calibration methods for text classification in terms of expectation calibration error, misclassification detection, and OOD detection on six datasets. Our code can be found at https://github.com/Lingkai-Kong/Calibrated-BERT-Fine-Tuning.
Keywords
Full Content
Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, pages 1326–1340, November 16–20, 2020. c⃝2020 Association for Computational Linguistics 1326 Calibrated Language Model Fine-Tuning for In- and Out-of-Distribution Data Lingkai Kong, Haoming Jiang, Yuchen Zhuang, Jie Lyu, Tuo Zhao, Chao Zhang Georgia Institute of Technology, Atlanta, USA {lkkong,jianghm,yczhuang,jie.lyu,tourzhao,chaozhang}@gatech.edu Abstract Fine-tuned pre-trained language models can suffer from severe miscalibration for both in-distribution and out-of-distribution (OOD) data due to over-parameterization. To mit- igate this issue, we propose a regularized fine-tuning method. Our method intro- duces two types of regularization for bet- ter calibration: (1) On-manifold regulariza- tion, which generates pseudo on-manifold samples through interpolation within the data manifold. Augmented training with these pseudo samples imposes a smoothness regu- larization to improve in-distribution calibra- tion. (2) Off-manifold regularization, which encourages the model to output uniform dis- tributions for pseudo off-manifold samples to address the over-confidence issue for OOD data. Our experiments demonstrate that the proposed method outperforms existing cal- ibration methods for text classification in terms of expectation calibration error, mis- classification detection, and OOD detection on six datasets. Our code can be found at https://github.com/Lingkai-Kong/ Calibrated-BERT-Fine-Tuning. 1 Introduction Pre-trained language models have recently brought the natural language processing (NLP) community into the transfer learning era. The transfer learn- ing framework consists of two stages, where we first pre-train a large-scale language model, (e.g., BERT (Devlin et al., 2019), RoBERTa (Liu et al., 2019), ALBERT (Lan et al., 2020) and T5 (Raffel et al., 2019)) on a large text corpus and then fine- tune it on downstream tasks. Such a fine-tuning approach has achieved SOTA performance in many NLP benchmarks (Wang et al., 2018, 2019). Many applications, however, require trustwor- thy predictions that need to be not only accurate but also well calibrated. In particular, a well- calibrated model should produce reliable confi- Figure 1: The reliability diagrams on in-distribution data (the first row) and the histograms of the model con- fidence on out-of-distribution (OOD) data (the second row) of CNN (Kim, 2014) and fine-tuned BERT-MLP classifier (Devlin et al., 2019). Though BERT improves classification accuracy, it makes over-confident predic- tions for both in-distribution and OOD data. dent estimates for both in-distribution and out-of- distribution (OOD) data: (1) For in-distribution data, a model should produce predictive probabili- ties close to the true likelihood for each class, i.e., confidence ≈ true likelihood. (2) For OOD data, which do not belong to any class of the training data, the model output should produce high un- certainty to say ‘I don’t know’, i.e., confidence ≈ random guess, instead of producing absurdly wrong yet wildly confident predictions. Providing such calibrated output probabilities can help us to achieve better model robustness (Lee et al., 2018), model fairness (Chouldechova, 2017) and improve label efficiency via uncertainty driven learning (Gal et al., 2017; Siddhant and Lipton, 2018; Shen et al., 2018). 1327 Unfortunately, Guo et al. (2017) have shown that due to over-parameterization, deep convolutional neural networks are often miscalibrated. Our ex- perimental investigation further corroborates that …
Content truncated to 500 words
Labeled Text
AbstractFine-tuned pre-trained language models can suffer from severe miscalibration for both in-distribution and out-of-distribution (OOD) data due to over-parameterization. To mitigate this issue, we propose a regularized fine-tuning method. Our method introduces two types of regularization for better calibration: (1) On-manifold regularization, which generates pseudo on-manifold samples through interpolation within the data manifold. Augmented training with these pseudo samples imposes a smoothness regularization to improve in-distribution calibration. (2) Off-manifold regularization, which encourages the model to output uniform distributions for pseudo off-manifold samples to address the over-confidence issue for OOD data. Our experiments demonstrate that the proposed method outperforms existing calibration methods for text classification in terms of expectation calibration error, misclassification detection, and OOD detection on six datasets. Our code can be found at
Publication Details
- Paper ID:
- 31013
- Year:
- 2020
- Publication:
- TIPSTER
- Publication Type:
- conf
- DOI:
- nan