Transferable Post-Hoc Calibration on Pretrained Transformers in Noisy Text Classification
Abstract
Recent work has demonstrated that pretrained transformers are overconfident in text classification tasks, which can be calibrated by the famous post-hoc calibration method temperature scaling (TS). Character or word spelling mistakes are frequently encountered in real applications and greatly threaten transformer model safety. Research on calibration under noisy settings is rare, and we focus on this direction. Based on a toy experiment, we discover that TS performs poorly when the datasets are perturbed by slight noise, such as swapping the characters, which results in distribution shift. We further utilize two metrics, predictive uncertainty and maximum mean discrepancy (MMD), to measure the distribution shift between clean and noisy datasets, based on which we propose a simple yet effective transferable TS method for calibrating models dynamically. To evaluate the performance of the proposed methods under noisy settings, we construct a benchmark consisting of four noise types and five shift intensities based on the QNLI, AG-News, and Emotion tasks. Experimental results on the noisy benchmark show that (1) the metrics are effective in measuring distribution shift and (2) transferable TS can significantly decrease the expected calibration error (ECE) compared with the competitive baseline ensemble TS by approximately 46.09%.
Cite
Text
Zhang et al. "Transferable Post-Hoc Calibration on Pretrained Transformers in Noisy Text Classification." AAAI Conference on Artificial Intelligence, 2023. doi:10.1609/AAAI.V37I11.26632Markdown
[Zhang et al. "Transferable Post-Hoc Calibration on Pretrained Transformers in Noisy Text Classification." AAAI Conference on Artificial Intelligence, 2023.](https://mlanthology.org/aaai/2023/zhang2023aaai-transferable/) doi:10.1609/AAAI.V37I11.26632BibTeX
@inproceedings{zhang2023aaai-transferable,
title = {{Transferable Post-Hoc Calibration on Pretrained Transformers in Noisy Text Classification}},
author = {Zhang, Jun and Yao, Wen and Chen, Xiaoqian and Feng, Ling},
booktitle = {AAAI Conference on Artificial Intelligence},
year = {2023},
pages = {13940-13948},
doi = {10.1609/AAAI.V37I11.26632},
url = {https://mlanthology.org/aaai/2023/zhang2023aaai-transferable/}
}