[Paper Review] Prototypical Calibration for Few-shot Learning of Language Models
This paper proposes Prototypical Calibration (ProCa), a method to improve few-shot text classification in large language models by learning a robust, adaptive decision boundary through Gaussian Mixture Models to cluster model outputs by true label. It achieves a 13% absolute accuracy improvement across nine datasets, significantly enhancing robustness to prompt templates, demonstration permutations, and class imbalance.
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.
Motivation & Objective
- Address the instability of in-context learning in large language models due to fragile decision boundaries under varying prompts and demonstrations.
- Identify that conventional greedy decoding (max probability) fails to discriminate between classes effectively, especially under distributional shifts.
- Develop a method that learns a more robust decision boundary by modeling prototypical clusters of model outputs per class.
- Improve few-shot generalization by calibrating predictions using likelihoods from learned prototypical distributions rather than raw logits.
- Ensure consistency and robustness across different templates, demonstration orderings, and class imbalances in zero- and few-shot settings.
Proposed method
- Model the prediction distributions of examples with the same ground-truth label as prototypical clusters using a Gaussian Mixture Model (GMM).
- Assign each estimated cluster to a label via weighted bipartite matching to resolve label ambiguity in cluster assignment.
- Calibrate test predictions by computing the likelihood of each example under the prototypical distribution of each class.
- Use two estimation strategies: maximum likelihood and assignment score (Equation 4) to refine cluster-label correspondence.
- Adaptively learn the decision boundary based on the overall output distribution of demonstrations, avoiding reliance on content-free inputs.
- Optimize the decision boundary to be more discriminative than the standard 0.5 threshold or max-probability rule.
Experimental results
Research questions
- RQ1Why does in-context learning with large language models exhibit high sensitivity to prompt templates and demonstration permutations?
- RQ2Can a more robust decision boundary be learned from model outputs to improve few-shot classification beyond greedy decoding?
- RQ3How does the prototypical clustering of model predictions improve generalization across different prompt formats and class imbalances?
- RQ4To what extent does the proposed calibration method reduce bias from model inductive biases and prompt engineering?
- RQ5What is the optimal size of the estimation set for reliable prototypical calibration without overfitting?
Key findings
- ProCa achieves an average 13% absolute accuracy improvement over standard greedy decoding across nine text classification datasets using GPT-2 and GPT-J models.
- On AGNews and DBPedia, ProCa with the assignment score strategy improves 1-shot performance by up to 14.5% and 12.0% respectively, even surpassing contextual calibration.
- A small estimate set (e.g., 4–8 examples) is sufficient for ProCa to achieve near-optimal performance, with diminishing returns beyond a certain size.
- The calibrated decision boundary significantly improves robustness to prompt variations and demonstration permutations, reducing performance variance across settings.
- ProCa outperforms both max-likelihood and contextual calibration baselines on SST-2, MR, and Subj, even with only a few examples.
- The method effectively mitigates model bias and improves discrimination between classes, as evidenced by clearer separation in prediction distributions (Figure 2).
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.