TL;DR
Large Language Models (LLMs) are notoriously bad at estimating their own confidence during in-context learning, causing standard selective classification (abstention) methods to fail. This paper introduces a training-free approach that uses pairwise queries—asking the model to compare two samples rather than score one—to effectively rank and filter out high-error samples. This simple shift yields significantly better accuracy-cost tradeoffs across text, code, and vision-language tasks.
What Problem Does This Paper Address?
Selective classification allows a machine learning model to say "I don't know" and hand difficult samples over to a human expert. Traditionally, this relies on the model's internal confidence scores (e.g., softmax probabilities or next-token logits).
However, for Large Language Models (LLMs) performing in-context learning (ICL), these confidence metrics are often poorly calibrated and weakly correlated with actual correctness.
As shown above in Figure 1, there is a massive misalignment between an LLM's next-token logits and its actual labeling behavior, with a heavy tail near 0.5. This inconsistency leads to a waste of expensive human annotation budgets on samples the model already got right, while missing actual errors. Since retraining or fine-tuning massive LLMs is often impossible or cost-prohibitive, we need a training-free way to identify low-confidence samples.
Methods
The authors introduce PairSel, a family of five training-free selective classification algorithms that leverage pairwise queries. Instead of asking the LLM "How confident are you in sample X?", a pairwise query asks "Between sample X and sample Y, which one is more likely to be correct?".
Using a standard comparison-based sorting algorithm (like MergeSort) with the pairwise query as the comparator, they sort the dataset in descending order of predicted correctness. They propose 5 ways to select the rejection subset ($\alpha$-fraction) from this sorted list:
- PairSel-Middle: Rejects the middle $\alpha$-fraction, assuming a balanced class distribution where the least confident points sit in the center.
- PairSel-Max-Entropy: Finds the contiguous subsequence of length $\alpha n$ with the highest empirical binary entropy.
- PairSel-Max-Presence: Finds the subsequence that overlaps most with the standard confidence-rejected set.
- PairSel-Max-Displacement: Rejects points with the largest rank discrepancy between the pairwise sort and the raw confidence sort.
- PairSel-kNN: Incorporates a feature-space distance metric to penalize isolated points or points whose neighbors have low confidence.
Datasets
The authors evaluated their methods across five datasets:
- Synthetic: A manually generated dataset with Gaussian features and a linear classifier to validate the theoretical proofs.
- Spider & Bird: Popular Natural Language to SQL (NL2SQL) benchmarks. The authors converted these into binary classification tasks by keeping correct pairs (label 1) and generating incorrect SQL statements via derangement (label 0) to test SQL verification.
- BoolQ: A standard text-based binary question-answering dataset (True/False questions based on passages).
- VisOnlyQA: A challenging vision-language dataset consisting of image-question pairs with True/False answers.
Key Insights and Ideas
- Relative over Absolute: LLMs are much better at relative comparisons ("Is X better than Y?") than absolute calibration ("What is the exact probability that X is correct?"). Pairwise queries exploit this inherent strength.
- Inconsistency as an Advantage: Even when an LLM's confidence scores are completely misaligned with its predictions, its pairwise comparison logic remains remarkably accurate.
- Theoretical Guarantees: The authors mathematically define the boundary where pairwise sorting beats vanilla confidence thresholding under mild assumptions (like the Neural Tangent Kernel regime), proving that lower similarity between the confidence model and the actual labeling model actually increases the advantage of pairwise queries.
Key Results
- Substantial Accuracy Gains: Pairwise methods consistently outperformed raw next-token logits and post-processing calibration baselines across almost all coverage levels. On the challenging Bird dataset (using Qwen 3), the best pairwise method boosted total accuracy by 15.84% over the raw baseline. On BoolQ (with Llama 3.1), it provided an 8.56% boost.
- Top Performing Variants: PairSel-Max-Displacement and PairSel-Max-Entropy emerged as the top-performing pairwise variants in most scenarios.
- Calibration Fragility: Surprisingly, standard post-processing calibration techniques (like fitting a mixture of Gaussians) actually decreased performance on several datasets (e.g., -4.42% on VisOnlyQA), highlighting the fragility of traditional calibration for ICL.
Limitations and Future Work
- Computational Cost: Sorting $n$ items requires $O(n \log n)$ pairwise queries. While significantly cheaper than human annotation, this can become token-heavy and slow for very large datasets.
- Noisy Queries on Hard Tasks: On extremely difficult datasets like VisOnlyQA, where the base model performance is close to random guessing, the pairwise queries also become highly noisy, leading to diminished returns.
- Future Directions: A promising direction for future work is exploring optimal selective classification algorithms that explicitly minimize the joint cost of pairwise queries and human expert annotation.
Summary updated