Source-linked AI summary
Prototypical Calibration for Few-shot Learning of Language Models
Zhixiong Han, Yaru Hao, Li Dong, Yutao Sun, Furu Wei
TL;DR
Prompt-conditioned GPT predictions can be biased and volatile across templates, demonstrations, and their permutations. PROCA estimates category clusters and assigns them to labels to calibrate the decision boundary; experiments report an average 13% absolute improvement across nine text-classification tasks.
Problem
GPT predictions conditioned on prompts can favor specific answers and vary across templates, demonstrations, and their permutations, and prior approaches did not explain this fragility.
Source: §1 · p. 1Method
PROCA estimates prototypical clusters with a Gaussian mixture model, assigns clusters to labels through weighted bipartite matching, and calibrates predictions using the learned boundary.
Source: §1 · p. 2Results
PROCA reports an average 13% absolute improvement across different pretrained language-model sizes on nine text-classification tasks.
Source: §1 · p. 2, §6 · p. 10Takeaways & Limitations
The calibrated boundary is reported effective across prompt templates, class proportions, and demonstration permutations.
Source: §6 · p. 10PROCA is not applicable to open-ended label spaces and does not calibrate inherent language-model biases such as gender and occupation bias.
Source: §6 · p. 10
Abstract
from arXiv · showhide
In-context learning of GPT-like models has been recognized as fragile across different hand-crafted templates, and demonstration permutations. In this work, we propose prototypical calibration to adaptively learn a more robust decision boundary for zero- and few-shot classification, instead of greedy decoding. Concretely, our method first adopts Gaussian mixture distribution to estimate the prototypical clusters for all categories. Then we assign each cluster to the corresponding label by solving a weighted bipartite matching problem. Given an example, its prediction is calibrated by the likelihood of prototypical clusters. Experimental results show that prototypical calibration yields a substantial improvement on a diverse set of tasks. Extensive analysis across different scales also indicates that our method calibrates the decision boundary as expected, greatly improving the robustness of GPT to templates, permutations, and class imbalance.
1 Introduction
PROCA adaptively learns a decision boundary for few-shot classification, addressing prompt-related fragility in GPT; experiments report a 13% average absolute improvement across nine text-classification datasets.
1 Introduction
- GPT in-context predictions can favor particular answers and vary across templates, demonstrations, and their permutations, while prior approaches did not explain this fragility.In-context learning conditions GPT on hand-crafted prompts containing task templates and input–label demonstrations, without parameter updating.Source: §1 · p. 1
- 13% average absolute improvement over the conventional approach was reported across nine text-classification datasets and different GPT model sizes.The introduction also reports effectiveness across templates and demonstration permutations.Source: §1 · p. 2
- The authors propose prototypical calibration (PROCA) to adaptively learn a more robust decision boundary for few-shot language-model classification.Source: §1 · p. 2
2 Decision Boundary of Few-Shot Learning with GPT
Few-shot accuracy depends strongly on the decision boundary, and the performant boundary varies across prompts and language models. Each prompt has a relatively robust region, while boundaries far from it can yield poor performance.
2 Decision Boundary of Few-Shot Learning with GPT
- A decision boundary is an explicit prediction criterion in the output space for a classification problem.Source: §2 · p. 2
- Accuracy can fluctuate from near state-of-the-art to random guessing as the decision boundary shifts, and each prompt has a relatively robust region.Performance across GPT-2-Large and GPT-J is shown for different prompts and decision boundaries.Source: §2 · p. 3, Figure 3 · p. 3
- Performant decision boundaries are inconsistent across language models and prompts, so a boundary that works for one setting may not transfer to another.Source: §2 · p. 3
3 Prototypical Calibration
Prototypical calibration learns a decision boundary from model-output clusters, then maps those clusters to labels and uses their likelihoods for prediction. Its pipeline estimates clusters with a Gaussian mixture model, selects an estimation using cluster-label assignment scores, and applies the resulting mapping at inference.
3 Prototypical Calibration
- PROCA is proposed to adaptively learn a better decision boundary because the conventional boundary can deviate from the robust region.This introduces the calibration procedure that the subsequent subsections specify.Source: §3 · p. 3
3.1 Prototypical Cluster Estimation
- PROCA estimates one prototypical cluster per category by modeling N-dimensional GPT outputs as Gaussian distributions and fitting a Gaussian mixture model.The model prediction is represented by category log probabilities derived from GPT logits; an unlabeled in-domain estimate set is used to fit the parameters with EM.Source: §3.1 · pp. 3–4
3.2 Cluster-Label Assignment
- Cluster-label assignment scores sum each cluster’s estimated belongingness to its assigned label, and a weighted bipartite matching selects the label permutation with the highest score.The Kuhn-Munkres algorithm accelerates the matching.Source: §3.2 · p. 4
3.3 Estimation Selection Based on Cluster-Label Assignment
- Because EM is sensitive to GMM initialization, PROCA repeats estimation with different random seeds and selects the estimate with the highest optimal assignment score.The score is used to evaluate how well the estimated clusters belong to their assigned labels.Source: §3.3 · p. 4
3.4 Inference
- At inference, PROCA assigns a test example to its most likely estimated cluster and predicts that cluster’s assigned label, discarding mixture coefficients.The coefficients are discarded because the estimate-set and test-set class distributions may differ.Source: §3.4 · pp. 4–5
4 Experiments
Across nine text-classification datasets and five GPT-family model scales, experiments compare PROCA with GPT and contextual calibration, then examine prompt robustness and estimation choices.
4.1 Experimental Setup; 4.2 Evaluation Protocol
- Evaluation spans five GPT-family models and nine classification datasets, using 0-, 1-, 4-, and 8-shot settings and five random seeds, except Bloom uses two.Source: §4.1 · p. 5, §4.2 · p. 5
4.3 Main Results
- PROCA improves accuracy by 13% absolute over GPT and 6% over contextual calibration on average, with lower variance across prompts in most cases.Source: §4.3 · p. 5, Table 1 · p. 6
4.4 Effectiveness Analysis
- On SST-2 and Subj, estimate-set imbalance affects PROCA, but weights-cutting lets it beat contextual calibration even at extreme imbalance; balanced estimates yield gains up to 20% and 15%, respectively.Source: Figure 5 · p. 7, §4.4 · pp. 7–8
- Across nine SST-2 templates, PROCA brings large accuracy gains with low variance, while contextual calibration improves average accuracy but remains high-variance.Source: Figure 4 · p. 7, §4.4 · p. 7
- Across twelve orderings per class-proportion setting, PROCA outperforms alternatives with extremely low variance, unlike GPT and contextual calibration, which remain ordering-sensitive.Source: §4.4 · p. 7, Figure 6 · p. 8
4.5 Ablation Studies
- On GPT-neo, PROCA outperforms the original LM with generated or sampled estimate examples; sampled-data PROCA performs slightly better than generated-data PROCA.Source: Table 2 · p. 8, §4.5 · p. 8
- Selecting GMM estimates by assignment score rather than maximum likelihood yields more stable improvements on AGNews and DBPedia across GPT-2-XL and GPT-J.Source: §4.5 · pp. 8–9, Table 3 · p. 9
- Increasing estimate-set size within a small range can improve accuracy and reduce variance, but larger sets add little; several examples suffice on SST-2, MR, and Subj.Source: §4.5 · p. 9
5 Related Work
Related work examines what drives in-context learning and why few-shot performance varies across prompts, while this paper focuses on adapting the classification criterion to prediction distributions.
5 Related Work
- Prior accounts link in-context learning to latent concepts, corpus sources, co-occurrence statistics, and prompt components such as instructions and demonstrations.Other work also studies semantically similar demonstrations and the roles of label space, input distribution, and prompt format.Source: §5 · p. 9
- Few-shot performance varies with label biases and demonstration order; contextual calibration can over- or under-correct because content-free inputs may not reflect model bias.Lu et al. (2021) study order sensitivity and prompt selection; Zhao et al. (2021) describe majority, recency, and common-token biases.Source: §5 · p. 9
- Unlike content-free calibration, this paper derives a classification criterion from the overall prediction distribution for text inputs.The authors describe this as adapting the criterion to biases introduced by models and prompts.Source: §5 · p. 9
6 Conclusion and Limitation
The conclusion identifies the decision boundary as critical to few-shot performance and reports that PROCA improves results across models and tasks, while noting limits on its scope.
6 Conclusion and Limitation
- 13% average absolute improvement is reported across different sizes of pretrained language models on nine text classification tasks.The conclusion also reports effectiveness across prompt templates, class proportions, and permutations.Source: §6 · p. 10
- The authors identify the decision boundary as critical to few-shot performance and say PROCA learns a more robust one across templates, class proportions, and permutations.They state that the traditional boundary leads to prompting fragility.Source: §6 · p. 10
- PROCA requires a fixed label space, so it does not apply to open-ended tasks and does not calibrate inherent biases such as gender or occupation bias.The authors propose extending the method to open-ended tasks such as generative question-answering and summarization.Source: §6 · p. 10
A Experimental Details and Additional Results
The appendix captions identify tables covering model-and-task comparisons, estimate-set construction, prompt templates, and estimate-set sizes.
A Experimental Details and Additional Results
- Table 4 covers average performance for the conventional approach, contextual calibration, and PROCA on GPT-2-Large and GPT-neo across nine text-classification tasks.The caption supplies the comparison scope but no cell values.Source: Table 4 · p. 13
- Table 5 compares 0-shot and 1-shot estimate-set construction methods for GPT-neo across nine text-classification tasks, distinguishing generated PROCA-g from sampled PROCA-t.The caption identifies the two estimate-set sources but gives no outcome values.Source: Table 5 · p. 13
- Table 6 gives prompt templates for nine datasets, while Table 7 reports estimate-set sizes for nine datasets; its GPTs include GPT-2-Large, GPT-2-XL, GPT-neo, and GPT-J.Source: Table 6 · p. 14, Table 7 · p. 14
B Comparisons among using logits, probability, and log-probability for PROCA.
Across the evaluated output formats, log-probability performs better than probability, while logits degrade severely at zero shot; the figure compares logits, probability, and log-probability.
B Comparisons among using logits, probability, and log-probability for PROCA
- PROCA with logits appears stronger when few-shot demonstrations are provided but degrades severely at zero shot.The authors say output embedding normalization over the label space is necessary, since zero-shot output may be biased toward tokens outside that space.Source: B Comparisons among using logits,… · p. 14
- The comparison evaluates logits, probability, and log-probability for GPT-2-XL on SST-2, AGNews, and AP.Figure 8 plots results for these three model-output formalizations.Source: B Comparisons among using logits,… · p. 14, Figure 8 · p. 15
- PROCA with log-probability consistently outperforms PROCA with probability on SST-2, AGNews, and AP, especially on AGNews.The authors attribute this to log-probability making predictions more fitted to a Gaussian distribution and more discrepant.Source: B Comparisons among using logits,… · p. 14, Figure 8 · p. 15
Related papers
This paper cites
- BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding2018
- Language Models are Few-Shot Learners2020
- BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension2019
- Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?2022
- Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity2021
- Unified Language Model Pre-training for Natural Language Understanding and Generation2019