[Paper Review] Uncertainty Quantification with Pre-trained Language Models: A Large-Scale Empirical Analysis
This paper presents a large-scale empirical study on uncertainty quantification in pre-trained language models (PLMs), evaluating key design choices including PLM architecture, size, uncertainty quantifiers, and fine-tuning losses. It finds that using ELECTRA with Focal Loss fine-tuning, Temp Scaling recalibration, and larger model sizes yields the best calibration across NLP classification tasks under in-domain and out-of-domain settings.
Pre-trained language models (PLMs) have gained increasing popularity due to their compelling prediction performance in diverse natural language processing (NLP) tasks. When formulating a PLM-based prediction pipeline for NLP tasks, it is also crucial for the pipeline to minimize the calibration error, especially in safety-critical applications. That is, the pipeline should reliably indicate when we can trust its predictions. In particular, there are various considerations behind the pipeline: (1) the choice and (2) the size of PLM, (3) the choice of uncertainty quantifier, (4) the choice of fine-tuning loss, and many more. Although prior work has looked into some of these considerations, they usually draw conclusions based on a limited scope of empirical studies. There still lacks a holistic analysis on how to compose a well-calibrated PLM-based prediction pipeline. To fill this void, we compare a wide range of popular options for each consideration based on three prevalent NLP classification tasks and the setting of domain shift. In response, we recommend the following: (1) use ELECTRA for PLM encoding, (2) use larger PLMs if possible, (3) use Temp Scaling as the uncertainty quantifier, and (4) use Focal Loss for fine-tuning.
Motivation & Objective
- To identify the most effective configuration for building a well-calibrated PLM-based prediction pipeline in safety-critical NLP applications.
- To investigate how different choices—PLM architecture, size, uncertainty quantifier, and fine-tuning loss—affect calibration error in diverse NLP tasks.
- To evaluate pipeline performance under domain shift, assessing robustness and reliability in out-of-distribution settings.
- To provide actionable recommendations based on large-scale empirical evaluation across three NLP tasks and in- and out-of-domain settings.
Proposed method
- Conducted large-scale empirical evaluation across three NLP classification tasks: Sentiment Analysis, Natural Language Inference, and Commonsense Reasoning.
- Evaluated 120 distinct PLM-based pipelines combining different configurations of PLM architecture, size, uncertainty quantifier, and fine-tuning loss.
- Used in-domain and out-of-domain test sets to assess calibration robustness under distribution shift.
- Measured calibration using Expected Calibration Error (ECE), Maximum Mean Calibration Error (MMCE), and selective prediction performance.
- Evaluated out-of-domain detection capability using FAR95 (false alarm rate at 95% recall) to assess uncertainty reliability on unseen domains.
- Applied post-hoc calibration via Temp Scaling and compared it with MC Dropout and ensemble methods.
Experimental results
Research questions
- RQ1Which pre-trained language model architecture yields the most consistent calibration performance across diverse NLP tasks and domain shifts?
- RQ2How does model size influence calibration quality, both in-domain and out-of-domain?
- RQ3Which uncertainty quantifier (e.g., Temp Scaling, MC Dropout, ensemble) most effectively reduces calibration error in PLM-based pipelines?
- RQ4Which fine-tuning loss (e.g., Cross Entropy, Focal Loss, Label Smoothing, Brier Loss, MMCE) leads to better-calibrated predictions across tasks and domains?
Key findings
- ELECTRA consistently outperforms other PLMs in calibration quality across all three tasks and both in- and out-of-domain settings.
- Larger PLMs yield significantly better calibration, especially in Commonsense Reasoning, where larger models show superior in-domain calibration compared to smaller variants.
- Focal Loss achieves the lowest Expected Calibration Error (ECE) in both in-domain and out-of-domain evaluations and delivers the best FAR95 score, indicating strong out-of-domain detection capability.
- Temp Scaling is the most effective post-hoc uncertainty quantifier, significantly reducing calibration error, particularly in out-of-domain scenarios.
- Ensemble methods are less effective in reducing calibration error when applied to PLM-based pipelines, contrary to their success with traditional models.
- Label Smoothing and Brier Loss improve out-of-domain calibration but are less effective than Focal Loss in maintaining low ECE and high detection performance.
Better researchstarts right now
From reading papers to final review, dramatically reduce your research time.
No credit card · Free plan available
This review was created by AI and reviewed by human editors.