Calibrate Before Use: Improving Few-Shot Performance of Language Models
arXiv:2102.09690
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.
arXiv commentICML 2021
References in corpus (10)
- On Calibration of Modern Neural Networks
- A Deep Reinforced Model for Abstractive Summarization
- A Simple Method for Commonsense Reasoning
- Learning and Evaluating General Linguistic Intelligence
- Making Pre-trained Language Models Better Few-shot Learners
- Language Models as Knowledge Bases?
- Sharp Nearby, Fuzzy Far Away: How Neural Language Models Use Context
- How Can We Know When Language Models Know? On the Calibration of Language Models for Question Answering
- COMET: Commonsense Transformers for Automatic Knowledge Graph Construction
- Studying the Inductive Biases of RNNs with Synthetic Variations of Natural Languages
Cited by in corpus (19)
- On the Opportunities and Risks of Foundation Models
- Evaluating Large Language Models Trained on Code
- Multitask Prompted Training Enables Zero-Shot Task Generalization
- KnowPrompt: Knowledge-aware Prompt-tuning with Synergistic Optimization for Relation Extraction
- True Few-Shot Learning with Language Models
- Recent Advances in Natural Language Processing via Large Pre-Trained Language Models: A Survey
- QA Dataset Explosion: A Taxonomy of NLP Resources for Question Answering and Reading Comprehension
- CPT: Colorful Prompt Tuning for Pre-trained Vision-Language Models
- Differentiable Prompt Makes Pre-trained Language Models Better Few-shot Learners
- Few-Shot Bot: Prompt-Based Learning for Dialogue Systems
- NSP-BERT: A Prompt-based Few-Shot Learner Through an Original Pre-training Task--Next Sentence Prediction
- Controllable Semantic Parsing via Retrieval Augmentation
- Yuan 1.0: Large-Scale Pre-trained Language Model in Zero-Shot and Few-Shot Learning
- An Explanation of In-context Learning as Implicit Bayesian Inference
- Intersectional Bias in Causal Language Models
- An Empirical Study on Few-shot Knowledge Probing for Pretrained Language Models
- Adapting Language Models for Zero-shot Learning by Meta-tuning on Dataset and Prompt Collections
- GPT3Mix: Leveraging Large-scale Language Models for Text Augmentation
- What's in a Measurement? Using GPT-3 on SemEval 2021 Task 8 -- MeasEval