Manuscript Offprint
arXiv:2609.10122ProbPlug: A Plugin Uncertainty Network for Reliable Confidence in LLM Binary Classification
Jianzong Wang, Chuhang Liu, Botao Zhao, Zuheng Kang, Xulong Zhang, Xiaoyang Qu, Junqing Peng, Zhiewei Ye, and Yayun He
Ping An Technology (Shenzhen) Co., Ltd., Shenzhen, China,
Tsinghua Shenzhen International Graduate School, Shenzhen, China,
Hubei University of Technology, Hubei, China
Abstract. Large language models (LLMs) have achieved strong performance across a broad range of classification settings, yet the reliability of their predictions remains a major obstacle to deployment in high-stakes scenarios. Although confidence estimation for LLMs has been widely studied, confidence calibration for LLM-based classification remains underexplored. We introduce ProbPlug, a lightweight confidence estimation framework for LLM-based binary classification, which predicts whether an output is correct using internal token features extracted from a frozen LLM. ProbPlug employs a self-attention module to aggregate hidden representations and can be integrated into the original inference pipeline without modifying the base model. Experiments across multiple tasks involving both text-based and multimodal large models show that ProbPlug provides more reliable confidence estimates, improves classification performance with negligible additional overhead, and exhibits strong generalization across tasks. These results indicate that ProbPlug serves as a practical solution for confidence estimation in LLM-based classification. Our code is publicly available at this repository.
Keywords: Model Confidence · Multimodal Large Models · Text Classification · Speech Emotion Classification.
1 Introduction
Large language models (LLMs) have achieved promising results across both textual and multimodal classification tasks. [1], they can still produce misleading or incorrect predictions. Unlike conventional classifiers, which provide probability scores that can be used to adjust precision-recall trade-offs, LLM-based methods often lack reliable confidence estimates. This limitation hinders their use in reliability-sensitive applications. Therefore, accurately estimating model confidence is crucial for practical deployment.
† These authors contributed equally to this work.
J. Wang et al.
In recent years, researchers have explored various approaches to solve the confidence estimation problem for LLMs [2], including: (1) Verbalization: enabling LLMs to directly output confidence scores [3]; (2) Logit-based methods: leveraging the probability distributions of generated tokens [4], with recent work such as LogTokU [5] further analyzing token-level logit uncertainty for confidence estimation; (3) Self-consistency: taking the consistency of results from multiple repeated queries as the confidence metric [6], as exemplified by SelfCheckGPT [7]; (4) Trained probes: employing probabilities output by pre-trained classifiers as confidence estimates [8]; (5) Hybrid methods: integrating two or more of the aforementioned approaches (e.g., CISC [9]). Directly applying these existing methods to LLM-based classification tasks is undoubtedly a simple and feasible approach. However, since these methods are not specifically designed for this scenario, their performance fails to reach an optimal level. Accordingly, this work focuses on confidence estimation for LLM-based binary classification.
Inspired by findings in neuroscience [10], we note that during the human brain's decision-making process, signals flow between different brain regions. For instance, when the human ear perceives a question, sensory organs first receive the information; the signal then propagates from lower-level brain regions to higher-order cortices, where comprehension occurs in Wernicke's Area, analysis in the prefrontal cortex, answer generation in Broca's Area, and finally output via the motor cortex. Notably, the resulting answer and its confidence are associated with each step of this process.
Drawing on this insight, we hypothesize that LLM decision-making is closely related to representations across Transformer layers. Accordingly, we propose ProbPlug, a confidence network that takes layer-wise outputs as input and predicts confidence scores. To improve generalization, we focus on binary classification with Yes"/No" outputs and use only newly generated tokens as input. Experiments show that ProbPlug provides reliable confidence estimation while maintaining strong task performance and cross-task generalization, combining the generalization strength of LLM-based methods with the calibration ability of non-LLM-based approaches. The main contributions of this work are summarized below:
– We investigate the problem of confidence estimation in LLM-based classification and highlight that unreliable confidence remains a major obstacle to deploying LLMs in risk-sensitive scenarios.
– We propose ProbPlug, a lightweight plug-and-play framework that derives confidence scores from hidden representations of a frozen LLM, enabling estimation of prediction correctness without altering the base model.
– Extensive experiments on multiple benchmarks show that ProbPlug provides better-calibrated confidence estimates, improves downstream classification performance with negligible additional inference overhead, and demonstrates promising cross-task generalization ability.
Given an input prompt , the LLM generates the next token :
For binary classification tasks, the generated token is constrained to the set {Yes, No}. While it indicates the model's decision, it does not explicitly reflect decision confidence. In this work, we estimate the probability that the generated answer is correct by leveraging hidden representations from different transformer layers, which capture complementary information at different stages of model computation. Let denote the hidden representations corresponding to the final generated token across all transformer layers:
where denotes the total number of transformer layers. Our goal is to learn a lightweight confidence estimator such that
where denotes that the generated answer is correct. Based on this formulation, we propose ProbPlug, a plug-in uncertainty network that estimates decision confidence from layer-wise hidden representations of a frozen LLM. Only a lightweight external network needs to be trained, making ProbPlug plug-and-play and computationally efficient.
3 Method
3.1 Model Architecture
The hidden representations across Transformer layers encode semantic, reasoning, and decision-related information, which may also reflect model uncertainty. Based on this insight, ProbPlug aggregates these layer-wise signals for confidence estimation. As shown in Fig. 2, the framework is composed of three modules: Token Compression (TC), Layer Information Aggregation (LIA), and a classification head. The backbone LLM remains frozen during training.
Hidden State Extraction Given an input prompt, the frozen LLM produces a binary output token. We extract the hidden representations associated with the final generated token from all transformer layers.
J. Wang et al.

Fig. 1. Motivation for the proposed method. (a) Traditional LLM inference relies on next-token probabilities, which are often poorly calibrated and difficult to threshold in high-stakes settings. (b) ProbPlug estimates confidence from multi-layer hidden representations of a frozen LLM, enabling reliable and flexible threshold-based filtering.
Let denote the set of hidden states across layers, which has a dimension of , where denotes batch size, the number of tokens, the number of distinct layers, and the feature dimension. In our default configuration, we select only the final generated token , which directly reflects the models decision and empirically provides stronger cross-task generalization ability.
Token Compression Module The extracted hidden representations may contain redundant token-level information. To refine layer-wise features, we introduce a token-wise feature transformation module. For , it enhances single-token features via nonlinear mapping. Subsequently, the token representations are aggregated using two fully connected layers: it first maps the dimension to , and then compresses it to 1.
where , and denote the trainable parameters. denotes a nonlinear activation function. This module compresses token-level features into a single representation per layer, producing :
which summarizes the decision-related information from each transformer layer, has a dimension of .
Layer Information Aggregation Module Different transformer layers contribute unequally to the models decision confidence. To adaptively combine these

Fig. 2. The overview of the proposed method. The left sub-figure illustrates the frozen large language model, while the right subfigure presents the architecture of our proposed ProbPlug.
representations, we leverage multi-head attention to adaptively fuse layer-wise representations. Let
where is a learnable query vector. The attention weights are computed as
The aggregated representation is then obtained as
This formulation allows the model to adaptively weight information from different transformer layers during confidence estimation.
Confidence Prediction The aggregated representation is passed through a lightweight classifier to produce the confidence score:
J. Wang et al.
Table 1. Performance comparison (Part 1) of our proposed ProbPlug across in-task and cross-task scenarios. Trained on the SMS-SPAM dataset [11], the model was evaluated on SST2 [12] and Toxic Comment Classification [13]. * indicates the in-task dataset. Bold values denote the best performance.
| Methods | SMS-SPAM* | SST2 | Toxic Comment Class | |||
|---|---|---|---|---|---|---|
| F1-score | AUPRC | F1-score | AUPRC | F1-score | AUPRC | |
| Qwen3-8B [15] | 88.49 | / | 88.75 | / | 81.07 | / |
| Verbalization [3] | 87.66 | 82.48 | 90.10 | 86.27 | 81.25 | 63.35 |
| Logit [4] | 88.64 | 92.02 | 89.44 | 95.28 | 78.91 | 72.42 |
| Self-Consist [6] | 88.44 | 70.13 | 89.55 | 87.18 | 81.66 | 48.63 |
| CISC [9] | 86.86 | 68.80 | 91.12 | 93.49 | 81.50 | 50.64 |
| SAPLMA [8] | 92.05 | 95.85 | 87.89 | 96.85 | 81.09 | 70.80 |
| ProbPlug (Ours) | 94.78 | 97.56 | 88.47 | 97.42 | 81.68 | 73.20 |
where and are learnable parameters. represents the estimated probability that the LLMs generated answer is correct.
3.2 Cross-task Generalization and Multi-class Classification
A key advantage of this formulation is that it naturally supports cross-task generalization. Since many classification tasks can be reformulated as Yes/No decision problems, the trained confidence estimator can be directly applied to unseen tasks by modifying the prompt template.
For multi-class classification tasks, we decompose the task into multiple on-vs-rest binary decisions. Let be the total number of classes, and denote the confidence score associated with class . The final class probability is computed via a softmax normalization:
This formulation allows ProbPlug to be extended to multi-class and multimodal classification scenarios.
4 Experimental Results and Analysis
4.1 Experimental Configuration
Dataset To evaluate generalization, we conduct experiments on five public text datasets: SMS Spam Collection [11], SST-2 [12], Toxic Comment Classification, Civil Comments [13], and Amazon Polarity [14], covering spam detection, sentiment analysis, toxicity detection, and product review classification. We further use IEMOCAP [16], which contains 5,531 utterances from four emotion categories, to evaluate performance on multimodal large models.
Table 2. Performance comparison (Part 2) of our proposed ProbPlug across in-task and cross-task scenarios. The model was evaluated on Civil Comments [13] and Amazon-polarity [14].
| Methods | Civil comments | Amazon-polarity | ||
|---|---|---|---|---|
| F1-score | AUPRC | F1-score | AUPRC | |
| Qwen3-8B [15] | 66.91 | / | 94.42 | / |
| Verbalization [3] | 66.65 | 51.82 | 88.96 | 85.54 |
| Logit [4] | 65.86 | 55.15 | 94.52 | 97.06 |
| Self-Consist [6] | 66.41 | 45.41 | 94.55 | 94.16 |
| CISC [9] | 67.09 | 45.51 | 94.10 | 93.70 |
| SAPLMA [8] | 57.19 | 56.50 | 94.46 | 97.65 |
| ProbPlug (Ours) | 67.20 | 58.02 | 94.72 | 98.72 |
Baselines We adopt the Qwen3-8B model as the baseline and directly apply it to binary text classification across all datasets. We further explore variants where Qwen outputs either Verbalization [3] or Logit [4]. In addition, we compare advanced inference strategies, including Self-Consistency [6] and CISC [9]. Meanwhile, we evaluate SAPLMA [8], which attaches and trains a three-layer MLP classification head on top of the models internal representations. Model performance is quantified using F1-score and the area under the precision-recall curve (AUPRC), as is common in related literature [19].
4.2 Main Performance
As shown in Table 1 and 2, the ProbPlug outperforms several existing competitive confidence estimation methods on the same task in terms of both F1-score and AUPRC. Additionally, we evaluated our method on cross tasks without additional training by simply modifying prompts. The results demonstrate that our method outperforms current state-of-the-art approaches across most metrics. On the SST2 dataset, our method achieves a slightly lower F1-score than the CISC method. However, it exhibits significant advantages in other aspects: first, our method needs only one inference pass, with inherent efficiency advantages over CISC, which requires multiple repeated inferences. Furthermore, our method performs better in AUPRC, which implies that it could achieve higher performance by adjusting the classification threshold. Overall, the experiments demonstrate that our method achieves consistently improved performance on both in-task and cross-task datasets, with results averaged over multiple runs.
4.3 Multi-class Classification Performance
Furthermore, to evaluate the performance of our method on multi-class classification tasks and multimodal large models, we trained our ProbPlug model using Qwen2-audio as the base model. As shown in Table 3, our method exhibits significant advantages across all metrics compared to both existing non-LLM-based methods (e.g., Emotion2Vec) and other confidence estimation methods.
J. Wang et al.
Table 3. Comparison of the performance on the speech emotion recognition (Iemo-cap from the EmoBox benchmark [18]) task with multimodal large model. UA means unweighted accuracy, and WA denotes the weighted accuracy. The performance of Non-LLM-based methods was cited from the corresponding papers.
| Type | Methods | UA | WA | F1-score |
|---|---|---|---|---|
| Non-LLM-based | data2vec 2.0 large [20] | 57.30 | 56.23 | 56.70 |
| Whisper large v3 [21] | 73.54 | 72.86 | 73.11 | |
| Emotion2vec large [22] | 70.70 | 63.30 | / | |
| LLM-based | Qwen2-audio [17] | 64.33 | 60.37 | 61.61 |
| Verbalization [3] | 66.45 | 63.24 | 62.56 | |
| Logit [4] | 66.42 | 64.35 | 61.26 | |
| Self-Consist [6] | 67.24 | 66.21 | 63.13 | |
| CISC [9] | 67.78 | 67.43 | 63.62 | |
| SAPLMA [8] | 73.15 | 74.61 | 73.53 | |
| ProbPlug (Ours) | 77.33 | 77.32 | 77.76 |
Table 4. Calibration performance of SAPLMA and ProbPlug.
| Calibration | ECE | Brier Score | ||
|---|---|---|---|---|
| SAPLMA | ProbPlug | SAPLMA | ProbPlug | |
| SMS-SPAM | 0.0194 | 0.0126 | 0.0240 | 0.0210 |
| SST2 | 0.1123 | 0.1251 | 0.0987 | 0.0706 |
| Toxic Comment Class | 0.0695 | 0.0654 | 0.0740 | 0.0739 |
| Civil comments | 0.1884 | 0.1580 | 0.2183 | 0.2092 |
| Amazon-polarity | 0.1015 | 0.0412 | 0.0563 | 0.0374 |
| Average | 0.0982 | 0.0805 | 0.0943 | 0.0824 |
mentioned earlier. This indicates that our method can not only be generalized to multi-class classification tasks but also be applied to multimodal large models.
4.4 Calibration Experiments
To evaluate confidence reliability, we adopt Expected Calibration Error (ECE) and Brier Score as calibration metrics. ECE evaluates the consistency between predicted confidence and observed accuracy, whereas Brier Score quantifies the discrepancy between predicted probabilities and the corresponding ground-truth labels. As reported in Table 4, ProbPlug achieves lower average ECE (0.0805) and Brier Score (0.0824) than SAPLMA, indicating better calibration, with notable gains on SMS-SPAM and Amazon-polarity. Figure 3 (a) further shows that ProbPlug stays closer to the perfect calibration line across most bins, while SAPLMA exhibits clear overconfidence in high-confidence regions. These results demonstrate that ProbPlug provides more reliable confidence estimates.
4.5 Ablation Studies
We further analyze the contribution of each model component and the effect of the token selection hyperparameter (number of tokens, denoted as in Sec-

(a)
(b)
Fig. 3. (a) Reliability diagrams of confidence calibration for SAPLMA and ProbPlug on Amazon-polarity. (b) Visualization of the learned attention weights across the 36-layer base model. The distribution demonstrates the concentration of decision certainty within the terminal high-order reasoning layers (L30L35).
Table 5. Evaluation of in-task and cross-task performance under different ablation settings. TC means token compression module, while LIA means layer information aggregation module.
| Configurations | In-task (SMS-SPAM) | Cross-task (SST2) | ||
|---|---|---|---|---|
| F1-score | AUPRC | F1-score | AUPRC | |
| w/o TC | 94.05 | 96.99 | 74.98 | 95.44 |
| w/o LIA | 92.26 | 95.16 | 86.53 | 96.31 |
| 10 token | 95.94 | 97.84 | 86.84 | 94.95 |
| Ours | 94.78 | 97.56 | 88.47 | 97.42 |
tion 3.1). Models with different configurations are trained on SMS-SPAM and evaluated on both SMS-SPAM and SST2. As shown in Table 5, both the token compression module and the layer-wise information aggregation module improve performance. Using 10 tokens slightly improves in-task performance compared with (S=1), but noticeably reduces cross-task generalization. This is likely because preceding tokens contain task-specific semantic information, causing the confidence estimator to overfit to the source domain. In contrast, the final token mainly captures decision confidence with less task-specific noise. Therefore, using only the final token (S=1) provides better robustness across tasks.
4.6 Layer-wise Attention Visualization and Interpretability
To investigate where decision uncertainty is encoded across the 36 Transformer layers, we visualize the learned attention weights under different inference conditions. As shown in Figure 3 (b), ProbPlug exhibits a clear bimodal pattern in high-confidence cases, with attention concentrated on the early lexical layers (L0L5) and the final reasoning layers (L30L35), while intermediate lay-
J. Wang et al.
ers receive little weight. This suggests that confident predictions mainly rely on basic lexical cues and high-level reasoning, whereas intermediate semantic representations contribute limited information and may introduce task-specific noise. By suppressing these less informative layers, ProbPlug maintains a focused attention distribution and improves confidence robustness. The results indicate that the learned layer-wise attention effectively reflects the evolution of decision uncertainty across the Transformer hierarchy.
5 Conclusion
In this work, we introduce ProbPlug, a plug-in framework that estimates prediction confidence for LLM-based binary classification from hidden token representations. By operating on internal representations of the frozen base model without modifying its original architecture, ProbPlug addresses the problem of uncalibrated confidence in LLM outputs. Extensive experiments on multiple classification tasks, using both standard large language models (e.g., Qwen3) and multimodal large models (e.g., Qwen2-Audio), show that ProbPlug achieves three main benefits. First, it provides more reliable confidence estimates, improving the trustworthiness of LLM predictions. Second, it brings consistent gains in downstream classification performance with only limited additional inference overhead. Third, it demonstrates promising cross-task generalization, reducing the need for extensive retraining when adapting to new tasks. Overall, the experimental results demonstrate that ProbPlug offers an effective approach to confidence estimation for LLM-based classification. This study further highlights its potential to support more reliable deployment of LLMs in high-stakes scenarios that require trustworthy confidence assessment.
References
-
Zhang, Y., Wang, M., Li, Q., Tiwari, P., Qin, J.: Pushing the limit of LLM capacity for text classification. In: Companion Proceedings of the ACM on Web Conference 2025, pp. 1524–1528 (2025)
-
Mahaut, M., Aina, L., Czarnowska, P., Hardalov, M., Müller, T., Márquez, L.: Factual confidence of LLMs: on reliability and robustness of current estimators. In: Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 4554–4570 (2024)
-
Tian, K., Mitchell, E., Zhou, A., Sharma, A., Rafailov, R., Yao, H., Finn, C., Manning, C.D.: Just ask for calibration: Strategies for eliciting calibrated confidence scores from language models fine-tuned with human feedback. In: Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pp. 5433–5442 (2023)
-
Yin, Z., Sun, Q., Guo, Q., Wu, J., Qiu, X., Huang, X.-J.: Do large language models know what they dont know? In: Findings of the Association for Computational Linguistics: ACL 2023, pp. 8653–8665 (2023)
-
Ma, H., Chen, J., Zhou, J.T., Wang, G., Zhang, C.: Estimating LLM uncertainty with evidence. arXiv preprint arXiv:2502.00290 (2025)
-
Wang, X., Wei, J., Schuurmans, D., Le, Q.V., Chi, E.H., Narang, S., Chowdhery, A., Zhou, D.: Self-consistency improves chain of thought reasoning in language models. In: International Conference on Learning Representations (ICLR) (2023)
-
Manakul, O., Liusie, A., Gales, M.: SelfCheckGPT: Zero-resource black-box hallucination detection for generative large language models. In: Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pp. 9004–9017 (2023)
-
Azaria, A., Mitchell, T.: The internal state of an LLM knows when its lying. In: Findings of the Association for Computational Linguistics: EMNLP 2023, pp. 967–976 (2023)
-
Taubenfeld, A., Sheffer, T., Ofek, E., Feder, A., Goldstein, A., Gekhman, Z., Yona, G.: Confidence improves self-consistency in LLMs. In: Findings of the Association for Computational Linguistics: ACL 2025, pp. 20090–20111 (2025)
-
Warren, J.: How does the brain process music? Clinical Medicine 8(1), 32–36 (2008)
-
Almeida, T.A., Hidalgo, J.M.G., Yamakami, A.: Contributions to the study of SMS spam filtering: new collection and results. In: Proceedings of the 11th ACM Symposium on Document Engineering, pp. 259–262 (2011)
-
Socher, R., Perelygin, A., Wu, J., Chuang, J., Manning, C.D., Ng, A.Y., Potts, C.: Recursive deep models for semantic compositionality over a sentiment treebank. In: Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pp. 1631–1642 (2013)
-
Borkan, D., Dixon, L., Sorensen, J., Thain, N., Vasserman, L.: Nuanced metrics for measuring unintended bias with real data for text classification. In: Companion Proceedings of the 2019 World Wide Web Conference, pp. 491–500 (2019)
-
Zhang, X., Zhao, J., LeCun, Y.: Character-level convolutional networks for text classification. Advances in Neural Information Processing Systems 28 (2015)
-
Yang, A., Li, A., Yang, B., Zhang, B., Hui, B., Zheng, B., Yu, B., Gao, C., Huang, C., Lv, C., et al.: Qwen3 technical report. arXiv preprint arXiv:2505 (2025)
-
Busso, C., Bulut, M., Lee, C.-C., Kazemzadeh, A., Mower, E., Kim, S., Chang, J.N., Lee, S., Narayanan, S.S.: IEMOCAP: Interactive emotional dyadic motion capture database. Language Resources and Evaluation 42(4), 335–359 (2008)
-
Chu, Y., Xu, J., Yang, Q., Wei, H., Wei, X., Guo, Z., Leng, Y., Lv, Y., He, J., Lin, J., et al.: Qwen2-Audio technical report. arXiv preprint arXiv:2407.10759 (2024)
-
Ma, Z., Chen, M., Zhang, H., Zheng, Z., Chen, W., Li, X., Ye, J., Chen, X., Hain, T.: EmoBox: Multilingual multi-corpus speech emotion recognition toolkit and benchmark. In: Proc. Interspeech 2024, pp. 1580–1584 (2024)
-
Kadavath, S., Conerly, T., Askell, A., Henighan, T., Drain, D., Perez, E., Schiefer, N., Hatfield-Dodds, Z., DasSarma, N., Tran-Johnson, E., et al.: Language models (mostly) know what they know. arXiv preprint arXiv:2207.05221 (2022)
-
Baevski, A., Babu, A., Hsu, W.-N., Auli, M.: Efficient self-supervised learning with contextualized target representations for vision, speech and language. In: International Conference on Machine Learning, pp. 1416–1429 (2023)
-
Radford, A., Kim, J.W., Xu, T., Brockman, G., McLeavey, C., Sutskever, I.: Robust speech recognition via large-scale weak supervision. In: International Conference on Machine Learning, pp. 28492–28518 (2023)
-
Ma, Z., Zheng, Z., Ye, J., Li, J., Gao, Z., Zhang, S., Chen, X.: Emotion2Vec: Self-supervised pre-training for speech emotion representation. In: Findings of the Association for Computational Linguistics: ACL 2024, pp. 15747–15760 (2024)