[Paper Review] How Can We Know When Language Models Know? On the Calibration of Language Models for Question Answering
The paper studies how well language models calibrated for QA tasks reflect true correctness and proposes fine-tuning and post-hoc methods to improve calibration without sacrificing accuracy.
Recent works have shown that language models (LM) capture different types of knowledge regarding facts or common sense. However, because no model is perfect, they still fail to provide appropriate answers in many cases. In this paper, we ask the question "how can we know when language models know, with confidence, the answer to a particular query?" We examine this question from the point of view of calibration, the property of a probabilistic model's predicted probabilities actually being well correlated with the probabilities of correctness. We examine three strong generative models -- T5, BART, and GPT-2 -- and study whether their probabilities on QA tasks are well calibrated, finding the answer is a relatively emphatic no. We then examine methods to calibrate such models to make their confidence scores correlate better with the likelihood of correctness through fine-tuning, post-hoc probability modification, or adjustment of the predicted outputs or inputs. Experiments on a diverse range of datasets demonstrate the effectiveness of our methods. We also perform analysis to study the strengths and limitations of these methods, shedding light on further improvements that may be made in methods for calibrating LMs. We have released the code at https://github.com/jzbjyb/lm-calibration.
Motivation & Objective
- Assess whether state-of-the-art QA LMs (T5, BART, GPT-2) produce calibrated confidence estimates.
- Develop and evaluate methods to improve calibration via fine-tuning and post-hoc adjustments.
- Analyze strengths/limitations of calibration approaches and provide insights for future improvements.
Proposed method
- Treat QA datasets as sequence-to-sequence tasks with input X and candidate outputs Y; compute P_LM(Y|X) and normalized probability over candidate set.
- Propose two fine-tuning objectives over candidate sets: softmax-based and margin-based, to align candidate probabilities with correctness.
- Investigate post-hoc calibration: temperature-based scaling and feature-based decision trees using inputs/features to recalibrate confidence.
- Introduce LM-specific techniques: paraphrase candidate outputs via round-trip translation to reduce wording bias, and input augmentation by retrieving context.
- Evaluate retrieval augmentation using Wikipedia excerpts to augment inputs.
- Use ablations to study effects of model size, paraphrase count, and different datasets on calibration.
Experimental results
Research questions
- RQ1Can LM-based QA models be calibrated so their confidence aligns with likelihood of correctness across diverse QA tasks?
- RQ2What finetuning or post-hoc strategies best improve calibration without sacrificing accuracy?
- RQ3How do input variations (paraphrasing, retrieved context) affect calibration performance?
- RQ4How does model size impact calibration quality across datasets?
Key findings
- Baseline LMs (T5, UnifiedQA) show strong accuracy but poor calibration (ECE > 0.2 on MT-test).
- Fine-tuning and post-hoc calibration methods improve ECE while maintaining or improving accuracy on multi-choice QA datasets.
- The best performing setup (Combo: margin-based fine-tuning plus temperature scaling, paraphrasing, and input augmentation) reduces ECE from 0.095 to 0.044 on MC-test (53% relative reduction).
- Paraphrasing candidate answers and providing retrieved contextual evidence significantly boosts calibration, especially for shorter questions.
- Calibration is complementary across methods; larger models generally show both higher accuracy and better calibration, though domain-shift effects exist.
- On extractive QA, calibration improvements are smaller, likely due to harder candidate span generation; higher entropy in confidence distributions may contribute.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.