Preserving Pre-trained Features Helps Calibrate Fine-tuned Language Models

Guande He, Jianfei Chen, Jun Zhu
5/30/2023
cs.CLcs.LG

No official code found. Best implementation: thu-ml/LM-Calibration (17 stars, last commit 2023-05-31).

Abstract

Large pre-trained language models (PLMs) have demonstrated strong performance on natural language understanding (NLU) tasks through fine-tuning. However, fine-tuned models still suffer from overconfident predictions, especially in out-of-domain settings. In this paper, we tackle the problem of calibrating fine-tuned language models. We demonstrate that the PLMs are well-calibrated on the masked language modeling task with robust predictive confidence under domain shift, yet the fine-tuned models fail to retain such property due to catastrophic forgetting, which impacts the calibration on the downstream classification task. In light of these observations, we evaluate the calibration of several methods that preserve pre-trained features and show that preserving pre-trained features can improve the calibration of fine-tuned language models. Among these methods, our proposed method that encourages the fine-tuned model to learn generative representations with auxiliary language modeling objective achieves competitive accuracy and the lowest expected calibration error compared to several strong baselines under both in-domain and out-of-domain settings on three downstream NLU tasks.

View on arXivView PDF

Code Implementations(1)

170Shell, PythonMay 30, 20233 years ago

Similar Papers

Cite this paper

@article{he2023preserving,
  title  = {Preserving Pre-trained Features Helps Calibrate Fine-tuned Language Models},
  author = {Guande He and Jianfei Chen and Jun Zhu},
  year   = {2023},
  eprint = {2305.19249},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.19249v1},
  journal = {ICLR 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2305.19249.svg)](https://codeofpaper.com/paper/2305.19249)

Discussion