Papers › A Study on the Calibration of In-context Learning

A Study on the Calibration of In-context Learning

7 Dec 2023arXiv:2312.04021archive 2025-07-28

HANLIN ZHANG, Yi-Fan Zhang, Yaodong Yu, Dhruv Madeka, Dean Foster, Eric Xing, Himabindu Lakkaraju, Sham Kakade

Accurate uncertainty quantification is crucial for the safe deployment of machine learning models, and prior research has demonstrated improvements in the calibration of modern language models (LMs). We study in-context learning (ICL), a prevalent method for adapting static LMs through tailored prompts, and examine the balance between performance and calibration across a broad spectrum of natural language understanding and reasoning tasks. Through comprehensive experiments, we observe that, with an increasing number of ICL examples, models initially exhibit increased miscalibration before achieving better calibration and miscalibration tends to arise in low-shot settings. Moreover, we find that methods aimed at improving usability, such as fine-tuning and chain-of-thought (CoT) prompting, can lead to miscalibration and unreliable natural language explanations. Furthermore, we explore recalibration techniques and find that a scaling-binning calibrator can reduce calibration errors consistently.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2312.04021")

Code

Syntology Ran 9 of 17 code samples harvested from 1 repository linked to this paper; 8 have no recorded run. Of those that ran: 1 ran · our draft was wrong; 1 ran · fixture could not drive it; 7 ran with no contract checked.

By repository: official repository: 17 samples from 1 repository, 9 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

hlzhang109/icl-calibration officialmentioned in papermentioned on GitHubpytorchMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

17 samples harvested; 9 ran; 0 honoured the contract we drafted; 8 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · our draft was wrong
1ran · fixture could not drive it
7ran
8unverified

Licence: 0 of the 17 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from hlzhang109/icl-calibration. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

apply_rotary_pos_emb hlzhang109/icl-calibration/llama/modeling_llama.py official repository ran · fixture could not drive it MIT (permissive) · 9b4dff79d5e6102c · report
chunk_size_helper hlzhang109/icl-calibration/utils.py official repository ran MIT (permissive) · 5d4d57fcfbf81571 · report
cross_entropy_loss hlzhang109/icl-calibration/calibrate/verified_calibration.py official repository ran MIT (permissive) · 19422cfbfee41729 · report
get_equal_bins hlzhang109/icl-calibration/calibration/utils.py official repository ran fingerprinted MIT (permissive) · 7dc9736cdb2847c4 · report
get_equal_prob_bins hlzhang109/icl-calibration/calibration/utils.py official repository ran fingerprinted MIT (permissive) · d1ebc0d7093a4203 · report
random_sampling hlzhang109/icl-calibration/utils.py official repository ran MIT (permissive) · 2ed507c8c59739f5 · report
rotate_half hlzhang109/icl-calibration/llama/modeling_llama.py official repository ran · our draft was wrong fingerprinted MIT (permissive) · b99eea6376d1e212 · report
setup_llama hlzhang109/icl-calibration/utils.py official repository ran MIT (permissive) · 182e1f46c31a2e09 · report
split hlzhang109/icl-calibration/calibration/utils.py official repository ran fingerprinted MIT (permissive) · 8e9dfd4ba4bf9fa3 · report
construct_prompt hlzhang109/icl-calibration/run_classification_cot.py official repository unverified MIT (permissive) · ef2f02ab0c2e6b74 · report
eval_accuracy hlzhang109/icl-calibration/run_classification.py official repository unverified MIT (permissive) · 556aa6b923228885 · report
get_p_content_free hlzhang109/icl-calibration/run_classification_calibrate.py official repository unverified MIT (permissive) · d09226e56c2085ea · report
load_commonsense_qa hlzhang109/icl-calibration/data_utils.py official repository unverified MIT (permissive) · 5459a3ffb7e8ae5f · report
load_cot_data hlzhang109/icl-calibration/data_utils.py official repository unverified MIT (permissive) · 37240d47eb548267 · report
load_strategy_qa hlzhang109/icl-calibration/data_utils.py official repository unverified MIT (permissive) · b74b229b1c013bd2 · report
save_pickle_tmp hlzhang109/icl-calibration/run_classification.py official repository unverified MIT (permissive) · ac63a1554effbb56 · report
save_pickle_tmp hlzhang109/icl-calibration/run_classification_cot.py official repository unverified MIT (permissive) · 94ba60d7c3f5ef45 · report

Tasks

In-Context LearningNatural Language UnderstandingUncertainty Quantification

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections