SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2211.00151 · 2022

A Close Look into the Calibration of Pre-trained Language Models

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 8 functions out of this paper's own repositories and ran 2 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
lifan-yuan/plmcalibration canonical 2 of 3
yangyi-chen/lm-toast pwc_unofficial 0 of 5
FunctionStatusWhere it lives
ece_equal_interval Ran lifan-yuan/plmcalibration/metric.py
code served (permissive licence) · get_code("47774a4ca35cf0e3")
ece_equal_mass Ran lifan-yuan/plmcalibration/metric.py
code served (permissive licence) · get_code("4427a224ec9b8f4f")
compute_hidden Not yet run yangyi-chen/lm-toast/src/utils/calibration_methods.py
code served (permissive licence) · get_code("e115d79cf282ebb9")
evaluation Not yet run lifan-yuan/plmcalibration/prompt-ood.py
code served (permissive licence) · get_code("5439c7c6310eaacf")
get_conditional_config Not yet run yangyi-chen/lm-toast/openprompt/config.py
code served (permissive licence) · get_code("c4adc1412f1960c8")
get_config_from_file Not yet run yangyi-chen/lm-toast/openprompt/config.py
code served (permissive licence) · get_code("b50275399496884d")
get_user_config Not yet run yangyi-chen/lm-toast/openprompt/config.py
code served (permissive licence) · get_code("9cdefe23f43015ca")
wrap_feature_based_testloader Not yet run yangyi-chen/lm-toast/src/utils/calibration_methods.py
code served (permissive licence) · get_code("69772baf34349d01")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Pre-trained language models (PLMs) may fail in giving reliable estimates of their predictive uncertainty. We take a close look into this problem, aiming to answer two questions: (1) Do PLMs learn to become calibrated in the training process? (2) How effective are existing calibration methods? For the first question, we conduct fine-grained control experiments to study the dynamic change in PLMs' calibration performance in training. We consider six factors as control variables, including dataset difficulty, available training samples, training steps, the number of tunable parameters, model scale, and pretraining. We observe a consistent change in calibration performance across six factors. We find that PLMs don't learn to become calibrated in training, evidenced by the continual increase in confidence, no matter whether the predictions are correct or not. We highlight that our finding somewhat contradicts two established conclusions: (a) Larger PLMs are more calibrated; (b) Pretraining improves model calibration. Next, we study the effectiveness of existing calibration methods in mitigating the overconfidence issue. Besides unlearnable calibration methods (e.g., label smoothing), we adapt and extend two recently proposed learnable methods that directly collect data to train models to have reasonable confidence estimations. Experimental results show that learnable methods significantly reduce PLMs' confidence in wrong predictions. The code is available at \url{https://github.com/lifan-yuan/PLMCalibration}.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2211.00151")
get_code_for_paper("2211.00151")
have("2211.00151")

Connect an agent — have() is free.