Confidence Evaluation for LLM Zero-Shot Classifiers: White-Box Methods Significantly Outperform Black-Box

White-box logit confidence significantly outperforms black-box methods, and decision-only scoring greatly reduces decoding cost.
The study systematically compares black-box and white-box confidence estimation methods across eleven open-source models from 1B to 32B on five text classification datasets. Results show that the choice of confidence method rarely affects accuracy; the real gap lies in discriminative ability: logit-based white-box scoring reaches AUROC of 0.74-0.77, while black-box methods such as verbalized confidence and sampling reach only 0.57-0.66. The study also finds that replacing full labels with single-token identifiers preserves discriminative ability but loses an average of 3-6 accuracy percentage points. Its proposed decision-only scoring scores only the label-divergence positions in the prefix tree, reducing decoding steps by 88-96% on large label sets without performance loss. The best open-source configurations are already competitive with the commercial classifier Jev 1.13.0.

Large language models (LLMs) are now commonly used as zero-shot text classifiers, but the value of a classification result depends on how confident we can be in that label. A new study systematically compares black-box and white-box confidence estimation methods across multiple open-source models and proposes a new technique that can dramatically reduce computational cost.
Study Design: Eleven Open-Source Models, Five Datasets
The study evaluates eleven open-weight models on five text classification datasets, with parameter counts ranging from 1B to 32B and label counts ranging from 3 to 151. Evaluation dimensions include classification performance (accuracy, F1-macro), discriminative ability (AUROC), and calibration quality (ECE and Brier score).
Black-Box vs. White-Box Methods
The study compares two ways of obtaining confidence. Black-box methods include model verbalised confidence and sampling-based estimation; white-box methods directly read token probabilities, covering P(True) as well as various constrained-generation-based logit scoring methods. This distinction captures a key difference in real-world deployment: whether the caller can access the model's internal probability distribution.
According to the paper, the choice of confidence method rarely has a significant effect on accuracy. What really sets methods apart is discriminative ability—logit-based scoring methods reach AUROC of 0.74-0.77, while black-box methods reach only 0.57-0.66. This result suggests that the model already "knows" how certain it is; the key is how to read that information out.
AUROC (Area Under the ROC Curve) measures the ability of a confidence score to separate correct predictions from incorrect ones: if you randomly draw one correct sample and one incorrect sample, AUROC is the probability that the confidence score assigns a higher score to the correct sample. 0.5 corresponds to random guessing, and 1.0 indicates perfect separation. It depends only on the ranking of scores, not on a specific threshold, so it is more sensitive than accuracy when comparing different confidence methods.
ECE (Expected Calibration Error) measures calibration quality—that is, whether the model's claimed "80% certain" really corresponds to about an 80% chance of being correct. ECE is computed by bucketing samples by confidence and taking the weighted average of the difference between the average confidence and the true accuracy within each bucket; lower is better. Brier score is the mean squared error between predicted probabilities and true labels (0/1), penalizing both wrong direction and overconfidence; it is also lower-is-better. AUROC and ECE focus on different aspects: a method can have very high AUROC yet poor calibration, and vice versa. This is exactly the core of the "trade-off between discriminative ability and calibration" discussed in the article.
P(True) is a self-evaluation-style white-box method: after the original input and the model's candidate label, a question asking "Is this answer true?" is appended, and then the model's probability distribution over the two tokens "True" and "False" is read, using P(True) as the confidence for that label. Its advantage is that it does not require constructing constraints separately for each label, making it highly general; the cost is an additional forward pass. In contrast, constrained-generation-based logit scoring forces the model to generate over the token sequence corresponding to the label set, directly reads the log probabilities of each candidate label and normalizes them, thereby obtaining a complete distribution over all labels. Such methods usually have stronger discriminative ability, but they require structured constraints on the label space and are more complex to implement.
Key Findings: The Trade-off Between Discriminative Ability and Calibration
White-Box Methods Significantly Improve Confidence Judgment
The AUROC gap means that at the same accuracy, white-box confidence can more reliably separate correct from incorrect predictions. For downstream processes that require thresholds or human review, this improvement is far more practically meaningful than changes in accuracy beyond the decimal point.
The Cost of Single-Token Identifiers
The study also tested replacing full label text with single-token identifiers. The results show that this preserves discriminative ability but loses an average of 3-6 accuracy percentage points. In other words, trading efficiency for concise IDs is feasible, but one must accept some accuracy cost.
Decision-Point Scoring Greatly Reduces Decoding Overhead
The proposed decision-only scoring scores only the positions in the prefix tree (trie) where labels diverge. On the three largest label sets, this method reduces decoding steps by 88-96%, with performance comparable to full label scoring. For classification tasks with large label spaces, this is a directly usable engineering optimization.
A trie (prefix tree) is a way of organizing a label set into a tree structure: the parts where all labels share the same prefix are stored only once. For example, "sports news" and "sports commentary" share the path "sports." In constrained decoding, the trie is used to mask out tokens that cannot form a valid label at each step, ensuring that the generated result necessarily falls within the label set. The key observation behind decision-only scoring is that if multiple labels have identical tokens before a certain position, then the scores at those positions are the same for all candidate labels and contribute nothing to the final ranking. Only the "decision points" where labels begin to diverge carry discriminative information. Therefore, it suffices to compute and compare logits at these divergence positions to obtain the same ranking result as full per-token scoring, reducing decoding steps from being proportional to the total label length to depending on the depth and branching of the tree.
Open-Source Models Are Approaching Commercial Classifiers
The study points out that the best-performing open-source model-method combinations (Gemma 4 31B and Qwen 3.5 9B) are competitive with the commercial classifier Jev 1.13.0. Combined with the decoding efficiency gains from decision-only scoring, the advantages of open-source solutions in cost and controllability deserve attention.
From a practical perspective, when deploying a zero-shot classifier, one should not look only at accuracy but also examine the discriminative ability of the confidence signal. If the system can access token probabilities, logit-based scoring methods should be the default option; if only a black-box interface is available, one should maintain cautious expectations about the reliability of confidence.
Zero-shot text classification refers to the task of having the model assign inputs to a predefined label set solely through natural language instructions, without providing any labeled examples. Unlike traditional supervised classifiers, it does not rely on task-specific training data, so it can quickly adapt to new label systems; however, its performance depends heavily on prompt construction, label phrasing, and the model's own instruction-following ability. This also explains why "replacing full label text with single-token identifiers" leads to accuracy loss: the semantic prior carried by the full label name is itself part of the zero-shot capability, while abstract IDs strip away this layer of information, leaving the model able to rely only on the mapping relationships in the context. Similarly, as the number of labels increases from 3 to 151, the semantic proximity among candidates rises, and the difficulty of classification and confidence estimation increases accordingly.
Key Takeaways
- The choice of confidence method rarely significantly affects accuracy, but logit scoring methods have clearly better discriminative ability (AUROC 0.74-0.77) than black-box methods (AUROC 0.57-0.66)
- Replacing full labels with single-token identifiers preserves discriminative ability but loses an average of 3-6 accuracy percentage points
- decision-only scoring reduces decoding steps by 88-96% on large label sets, with performance comparable to full scoring
- The best open-source configurations (Gemma 4 31B, Qwen 3.5 9B) are competitive with the commercial classifier Jev 1.13.0
Related articles

Prompt Engineering for Beginners: From Writing Prompts to Engineering Thinking
Starting from the essence and four functions of prompts, this article systematically explains the six-step process, four success criteria, learning value, and practical limitations of prompt engineering to help you build a complete understanding.

Anthropic Launches Nasdaq IPO: AI Giant's Listing and Risk Disclosures
Anthropic officially launches its Nasdaq IPO under ticker ANT, with market valuation expected to potentially exceed SpaceX's record. The prospectus devotes nearly 100 pages to AI risks, while first-half revenue grew over 14x but net losses widened sharply, reigniting the AI bubble debate.

Rust cURL Clone Uses 4,832 unsafe Blocks—Is the Memory Safety Myth Broken?
A Rust cURL clone uses 4,832 unsafe keywords, challenging Rust's memory safety narrative. We analyze what unsafe really means, compare Fil-C, and examine rewrite motives.