PreprintCited by 541Domain Adaptation and Few-Shot LearningTopic ModelingNatural Language Processing Techniques

Calibrate Before Use: Improving Few-Shot Performance of Language Models

Open access
Zhao, Tony Z., Wallace, Eric, Feng, Shi, Klein, Dan, Singh, Sameer·2021·arXiv

Abstract

GPT-3 can perform numerous tasks when provided a natural language prompt that contains a few training examples. We show that this type of few-shot learning can be unstable: the choice of prompt format, training examples, and even the order of the training examples can cause accuracy to vary from near chance to near state-of-the-art. We demonstrate that this instability arises from the bias of language models towards predicting certain answers, e.g., those that are placed near the end of the prompt or are common in the pre-training data. To mitigate this, we first estimate the model's bias towards each answer by asking for its prediction when given the training prompt and a content-free test input such as "N/A". We then fit calibration parameters that cause the prediction for this input to be uniform across answers. On a diverse set of tasks, this contextual calibration procedure substantially improves GPT-3 and GPT-2's average accuracy (up to 30.0% absolute) and reduces variance across different choices of the prompt.

The claims and statistics of this paper haven’t been checked yet.

Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.

A few free checks a day · papers already verified open instantly · results are public

Integrity signals

Registry

DataCite · 10.48550/arxiv.2102.09690

Cites

32 of 32 references verified0 citation errors · 0 not checkable

Statistics

Claims the paper makes

The claims and statistics of this paper haven’t been checked yet.

Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.

A few free checks a day · papers already verified open instantly · results are public

Claims other papers make about this one

Each is checked against this paper’s own text: does it say what the citing paper says it does?

  • Using demonstrations with gold labels significantly improves performance over no demonstrations.

    “using the demonstrations with gold labels significantly improves the performance over no demonstrations”

    From Rethinking the Role of Demonstrations: What Makes In-Context Learning Work? (2022) · cites this paper as Zhao et al., 2021

    The paper reports the opposite for some comparisons. Section 5.1 (p. 6) says accuracy fell from zero-shot to one-shot in four baseline cases; the discussion on p. 3 gives DBPedia as an example, dropping from 36.0% to 25.9%. The improvements emphasized elsewhere are attributed to contextual calibration, not simply to adding gold-labeled demonstrations. (LLM, conf=0.87)

    Checked by a reasoning model — may be wrong.

    Experimental — accuracy not yet measured
  • Contextual calibration and class-balanced sampling were used when these techniques improve performance on a validation set.

    “We use contextual calibration (Zhao et al., 2021) and class-balanced sampling when these techniques improve performance on a validation set.”

    From Adapting Language Models to Compress Contexts (2023) · cites this paper as Zhao et al., 2021

  • LMs are biased towards outputting answers that are towards the end of the prompt, a recency bias.

    “This finding is consistent with the recency bias proposed by (Zhao et al., 2021): LMs are biased towards outputting answers that are towards the end of the prompt.”

    From Understanding the Dark Side of LLMs' Intrinsic Self-Correction (2025) · cites this paper as Zhao et al., 2021

  • LLMs are sensitive to the prompt format.

    “LLMs are shown to be sensitive to the prompt format (Zhao et al., 2021;Lu et al., 2021;Wei et al., 2023;Madaan & Yazdanbakhsh, 2022)”

    From Large Language Models as Optimizers (2023) · cites this paper as Zhao et al., 2021

  • Zhong et al. first define a template using a discrete search method such as AutoPrompt, initialize virtual tokens based on this discovered prompt, and then fine-tune the embeddings to increase task accuracy.

    “Zhong et al. [152] first define a template using a discrete search method such as AutoPrompt [125]'s, initialize virtual tokens based on this discovered prompt, and then fine-tune the embeddings to increase task accuracy.”

    From Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processing (2023) · cites this paper as [152]

    The Background and Experimental Setup (p. 2) describes prompt templates, but not the attributed sequence of discrete search, virtual-token initialization, and embedding fine-tuning. The Discussion (p. 7) says the authors use a fixed language model without fine-tuning. Searches for Zhong, virtual tokens, AutoPrompt-based initialization, and embedding fine-tuning found no passage addressing that sequence. (LLM, conf=0.76)

    Experimental — accuracy not yet measured

Self-check

Percentages, sums and reported differences re-computed from the paper’s own numbers.

The self-check needs the paper’s full text.

Cites

Flagged first, then by citations

1 of the 33 references couldn’t be matched to a known paper.

Research works printed but not linked: 2

  1. Brown, T. B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., Agarwal, S., Herbert-Voss, A., Krueger, G., Henighan, T., Child, R., Ramesh, A., Ziegler, D. M., Wu, J., Winter, C., Hesse, C., Chen, M., Sigler, E., Litwin, M., Gray, S., Chess, B., Clark, J., Berner, C., McCandlish, S., Radford, A., Sutskever, I., and Amodei, D. Language models are few-shot learners. In NeurIPS , 2020.
  2. Schwartz, R., Sap, M., Konstas, I., Zilles, L., Choi, Y ., and Smith, N. A. The effect of different writing tasks on linguistic style: A case study of the ROC story cloze task. In ACL , 2017.

Cited by

Sorted by citations

Authors
Zhao, T. Z., Wallace, E., Feng, S., Klein, D., & Singh, S.
Affiliations
University of California, Berkeley (US)
Venue
arXiv
Publisher
arXiv
Published
2021
ISSN
2331-8422 (ISSN-L)
OpenAlex
W3132736064
Cited by
513
References
33
Citations by year
2026: 5 · 2025: 69 · 2024: 114 · 2023: 206 · 2022: 86 · 2021: 33
Type
posted content
Language
en
Open access
Locations
  • arXiv (Cornell University) (submittedVersion)
  • arXiv (Cornell University)
Topics
  • Physical Sciences › Computer Science › Artificial Intelligence › Domain Adaptation and Few-Shot Learning
  • Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
  • Physical Sciences › Computer Science › Artificial Intelligence › Natural Language Processing Techniques
Keywords
few-shot learning, GPT-3, GPT-2, prediction variance, natural language prompts

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review