AI agents built on large language models (LLMs) demonstrate strong capabilities in automated decision-making. However, LLMs may produce incorrect answers with high confidence, limiting their applicability in decisions that affect individuals and organizations. Reliable confidence scores are necessary to gate such decisions, and existing estimates are frequently unavailable or too coarse to support effective gating. This work uses supervised learning to train models to predict the correctness of LLM-generated answers, enabling automated confident responses and routing uncertain ones for human review. A linear confidence score head is fitted to the final-layer hidden state of the frozen LLM backbone, and text-only metamodels are trained as an alternative for closed models. All results come from a single 2B-parameter backbone, on graded answers that are about 98% SQuAD and the remainder TruthfulQA. Against multiple baselines, the confidence score head outperforms all baselines and metamodels, automating the largest fraction of the workload at high accuracy targets. Prompted confidence scores can appear well calibrated yet lack the resolution needed for thresholding. Although transferability to unseen datasets is modest, the confidence score head remains the most robust approach. The proposed confidence scoring framework enhances the safety of automating LLM-based agents and can be adapted to gate other properties, including safety or compliance.
Figures & tables
Figure 1: AI agent decision-making. The same agent in both panels retrieves, reasons, and produces an answer. a) All answers are acted on, and every wrong answer reaches the action unchecked. Alternatively, every answer can be routed to a reviewer in a human-in-the-loop approach. In this case, throughput is capped by the reviewers, and no answer is acted on without review. b) A confidence score for each answer gates the action. Answers above a threshold are acted on without review, while those below are routed for human review. The threshold value shown is illustrative.
Figure 2: LLM architecture and new confidence score head. The confidence score head reads the final-layer hidden state h∈R2304 at the last token of the concatenated prompt and generated answer and maps it to a probability by standardizing it coordinate-wise to z , then applying a linear layer and a sigmoid. The LLM backbone ( gemma-2-2b-it , 26 layers, 4-bit) is frozen during training, and only the parameters of the confidence score head are updated. The answer is generated autoregressively under the output schema and appended to the sequence before the confidence score head reads it. The last position attends over the whole sequence so that a single vector can depend on the answer, the question, and the context together.
Figure 3: ROC curves comparing the classification performance of the confidence score estimation approaches. Values in parentheses indicate each model’s ROC-AUC. The confidence score head is shown in red, the three metamodels in blue, the typed-decision model in green, and the remaining baselines in different shades of gray.
Model
ECE
Reliability
Resolution
Brier
Confidence score head
0.22
[0.21, 0.22]
0.07
[0.06 0 , 0.07 0 ]
0.064
[0.061, 0.068]
0.16
[0.15 0 , 0.16 0 ]
Metamodel: XGBoost
0.27
[0.26, 0.28]
0.09
[0.09 0 , 0.10 0 ]
0.06
[0.05 0 , 0.06 0 ]
0.191
[0.188, 0.194]
Metamodel: RF
0.30
[0.29, 0.30]
0.095
[0.091, 0.099]
0.06
[0.05 0 , 0.06 0 ]
0.194
[0.192, 0.196]
Metamodel: linear
0.23
[0.23, 0.24]
0.074
[0.070, 0.078]
0.056
[0.052, 0.059]
0.175
[0.171, 0.178]
Token log-prob.
0.11
[0.11, 0.12]
0.029
[0.026, 0.032]
0.051
[0.048, 0.054]
0.134
[0.130, 0.139]
Typed-decision (Laya)
0.07
[0.06, 0.08]
0.005
[0.004, 0.006]
0.029
[0.026, 0.032]
0.13
[0.13 0 , 0.14 0 ]
Table 1: Calibration performance of the confidence score estimation approaches. ECE = expected calibration error. ECE, Brier score, and Reliability are better when lower, whereas Resolution, which measures discrimination, is better when higher. Brackets are 95% bootstrap intervals. The self-score (schema) is computed on its own generation pass (Methods).
Figure 4: Automation performance of the confidence score estimation approaches. a) Accuracy of the automated answers as a function of the acceptance threshold. b) Coverage, i.e., the fraction of answers that are automated, as a function of the acceptance threshold. The star in both panels marks a shared operating point. At threshold 0.53 , the confidence score head’s automated answers are 95% accurate and cover 62% of the workload.
Model
≥90%
≥95%
≥97%
Confidence score head
85.5%
62.1%
38.2%
Metamodel: XGBoost
75.2%
17.8%
4.2%
Metamodel: RF
73.1%
22.7%
4.6%
Metamodel: linear
74.6%
9.0%
2.8%
Token log-prob.
71.8%
15.4%
8.4%
Typed-decision (Laya)
57.3%
0.2%
0.1%
Table 2: Automation performance at different accuracy targets. Each cell is the coverage, i.e., the percentage of answers accepted at the threshold that reaches the given accuracy target. Accepting every answer gives 81% accuracy at 100% coverage.
Model
Macro
Pooled
In domain
Confidence score head
0.82
[0.81, 0.83]
0.83
[0.83, 0.84]
0.88
[0.87, 0.89]
Metamodel: XGBoost
0.73
[0.72, 0.74]
0.74
[0.73, 0.75]
0.80
[0.79, 0.81]
Metamodel: RF
0.73
[0.72, 0.74]
0.74
[0.73, 0.75]
0.80
[0.79, 0.81]
Metamodel: linear
0.73
[0.72, 0.74]
0.74
[0.73, 0.76]
0.80
[0.79, 0.81]
Token log-prob.
0.73
[0.72, 0.75]
0.76
[0.75, 0.77]
0.80
[0.79, 0.81]
Typed-decision (Laya)
0.68
[0.66, 0.69]
0.70
[0.69, 0.72]
0.74
[0.73, 0.76]
Table 3: Discrimination on six datasets not used in training. Macro ROC-AUC is the unweighted mean over the six datasets, and pooled ROC-AUC is computed over all 8,724 answers at once. Brackets are 95% bootstrap intervals, drawn on a shared resample so that differences between models are paired. The in-domain column repeats the ROC-AUC of Fig. 3 , with intervals from Supplementary Table S2 .
Model
≥90%
≥95%
≥97%
Confidence score head
39.1%
20.7%
9.0%
Metamodel: XGBoost
5.5%
0.4%
0.4%
Metamodel: RF
0.3%
0.3%
0.0%
Metamodel: linear
2.6%
0.4%
0.3%
Token log-prob.
1.5%
0.3%
0.1%
Typed-decision (Laya)
10.5%
0.0%
0.0%
Table 4: Automation performance at different accuracy targets on six datasets not used in training. Each cell is the coverage, i.e., the percentage of answers accepted at the lowest threshold whose automated answers reach the given accuracy target. Accepting every answer gives 65% accuracy at 100% coverage. As in Table 2 , each threshold is selected on the same answers it is evaluated on. The in-domain values are given in Table 2 .
Dataset
Training
Validation
SQuAD
87,433
10,541
TruthfulQA
653
164
Total
88,086
10,705
trained on
74,873
development
13,213
Table 5: Sample sizes for each dataset split. The development slice is drawn from the pooled training rows, stratified by correctness, and subdivides the training total.
Figure S1: The causal attention mask. Each row shows the positions a token can attend to under causal attention. Only the last token attends to every position in the sequence, so its hidden state h , which the confidence score head reads, can depend on the whole prompt and answer. The example is abbreviated. The generations in this study also contain the detailed_answer field.
Figure S2: LLM answer accuracy on the validation split. Fraction of answers graded correct, overall and per dataset, with 95% bootstrap intervals. TruthfulQA contributes 164 of the 10,705 answers, so the overall accuracy is close to that of SQuAD.
Dataset
N
Answer accuracy
Overall
10,705
0.81
[0.80, 0.81]
SQuAD
10,541
0.81
[0.80, 0.82]
TruthfulQA
164
0.5
[0.4 0 , 0.6 0 ]
Table S1: LLM answer accuracy on the validation split. The values drawn in Fig. S2 , with 95% bootstrap intervals. The overall accuracy is the base rate against which the calibration quantities in Table 1 are measured.
Figure S3: ROC-AUC by model. Error bars are 95% bootstrap intervals, and the dashed line marks a random classifier. The intervals of the three metamodels overlap.
Model
ROC-AUC
Precision
Recall
F1 -score
Confidence score head
0.88
[0.87, 0.89]
0.95
[0.94, 0.95]
0.76
[0.75, 0.77]
0.84
[0.84, 0.85]
Metamodel: XGBoost
0.80
[0.79, 0.81]
0.91
[0.91, 0.92]
0.69
[0.68, 0.70]
0.79
[0.78, 0.79]
Metamodel: RF
0.80
[0.79, 0.81]
0.91
[0.90, 0.91]
0.76
[0.76, 0.77]
0.83
[0.82, 0.84]
Metamodel: linear
0.80
[0.79, 0.81]
0.91
[0.90, 0.91]
0.75
[0.75, 0.76]
0.82
[0.82, 0.83]
Token log-prob.
0.80
[0.79, 0.81]
0.89
[0.88, 0.90]
0.87
[0.86, 0.88]
0.88
[0.88, 0.89]
Typed-decision (Laya)
0.74
[0.73, 0.76]
0.85
[0.84, 0.86]
0.97
[0.96, 0.97]
0.90
[0.90, 0.91]
Table S2: Discrimination and decision quality of the confidence score estimation approaches. ROC-AUC summarizes performance over all thresholds, and precision, recall, and F1 -score are read at the 0.5 threshold. Brackets are 95% bootstrap intervals. The values are those drawn in Figs. S3 and S9 . Bold marks the best ROC-AUC and precision only, because at this threshold recall and F1 -score are highest for the models that come closest to accepting every answer, as the always correct row shows.
Figure S4: ROC-AUC by model, per dataset. Error bars are 95% bootstrap intervals, and the dashed line marks a random classifier. On TruthfulQA ( N=164 ), the intervals are too wide to separate the methods. LLM-as-Judge has the highest point estimate, and the token log-probability’s interval reaches the chance line, so no method is separated from it on this dataset.
Model
SQuAD ( N=10,541 )
TruthfulQA ( N=164 )
Confidence score head
0.88
[0.87, 0.89]
0.6
[0.5, 0.7]
Metamodel: XGBoost
0.80
[0.79, 0.81]
0.6
[0.5, 0.7]
Metamodel: RF
0.80
[0.79, 0.81]
0.6
[0.5, 0.6]
Metamodel: linear
0.80
[0.79, 0.81]
0.5
[0.5, 0.6]
Token log-prob.
0.81
[0.80, 0.82]
0.6
[0.5, 0.7]
Typed-decision (Laya)
0.74
[0.73, 0.76]
0.5
[0.4, 0.6]
Table S3: ROC-AUC within each dataset. The values drawn in Fig. S4 . Brackets are 95% bootstrap intervals. Because TruthfulQA has 164 answers against 10,541 for SQuAD, its intervals are about eight times wider and overlap across most of their range, so this dataset is too small to rank the methods. Values are reported to the precision their intervals support, which on TruthfulQA is one decimal.
Figure S5: ROC-AUC across initialization seeds. Validation ROC-AUC of the confidence score head over 100 refits that differ only in the random seed (Methods).
Figure S6: Score distributions for correct and incorrect answers. Each model’s confidence scores, split by whether the answer was graded correct (blue) or incorrect (red), with each class normalized to its own area. The confidence score head spreads its scores over a continuous range, with the two classes shifted apart. The self-score (schema) and LLM-as-Judge concentrate almost all their mass on a single value and take only 8 and 13 distinct values across the 10,705 answers. The typed-decision model also takes a continuous range of values, although its two classes overlap over much of the range.
Figure S7: Precision, recall, and F1 -score as a function of the decision threshold. The positive class is a correct answer. The dashed line marks the F1 -score of predicting every answer correct, and the dotted line marks the 0.5 threshold. The confidence score head and the metamodels trade precision for recall smoothly, whereas the self-score (schema) and LLM-as-Judge change in steps, because their scores take only a few discrete values.
Figure S8: Confusion matrices at the 0.5 threshold. P is an answer graded correct and N an answer graded incorrect. Rows are the actual grade and columns the prediction, and each row sums to 100%, so the top-right cell is the false positive rate, i.e., the share of incorrect answers labeled correct. The confidence score head rejects 82.1% of incorrect answers while accepting 76.1% of correct ones. The self-score (schema), LLM-as-Judge, and typed-decision model label most incorrect answers as correct (91.0%, 59.7%, and 69.9%), whereas the token log-probability labels 44.4% of them correct while accepting 87.1% of the correct ones. The last panel shows the always-correct floor.
Figure S9: Precision, recall, and F1 -score at the 0.5 threshold. Predicting every answer correct gives a recall of 1.0 and an F1 -score of 0.89 (the always-correct row of Table S2 ), so high recall and F1 -score at this threshold mostly reflect how close a model comes to accepting everything. The self-score (schema), LLM-as-Judge, and typed-decision model are near that floor on both. The confidence score head has the highest precision (0.95) at a recall of 0.76.
Model
≥90%
≥95%
≥97%
Confidence score head
85.5%
61.9%
38.4%
Metamodel: XGBoost
75.1%
18.8%
3.7%
Metamodel: RF
73.2%
22.9%
4.4%
Metamodel: linear
74.4%
13.2%
2.3%
Token log-prob.
72.0%
15.3%
8.4%
Typed-decision (Laya)
57.2%
2.1%
0.2%
Table S4: Coverage at thresholds selected out of sample. Each cell is the coverage at the given accuracy target, averaged over ten folds of the validation split stratified by correctness. For each fold, the threshold is selected on the remaining nine folds and evaluated on the held-out one. In Table 2 , the threshold is instead selected and evaluated on the whole validation split, and the two tables are otherwise computed alike.
Figure S10: Reliability diagrams. Scores are divided into ten equal-width bins, and each bar shows the answer accuracy within a bin, with the dashed black diagonal marking perfect calibration. In under-confident bins, pink hatching fills the gap from the diagonal up to the accuracy. In over-confident bins, solid red fills the gap from the accuracy up to the diagonal. Each panel reports its ECE, which must be read together with resolution (Table 1 ), because predicting the base rate for every answer minimizes it.
ECE
Reliability
Model
before
after
before
after
Confidence score head
0.22
[0.21, 0.22]
0.006
[0.005, 0.013]
0.07
[0.06 0 , 0.07 0 ]
0.0001
[0.0001, 0.0005]
Metamodel: XGBoost
0.27
[0.26, 0.28]
0.008
[0.005, 0.014]
0.09
[0.09 0 , 0.10 0 ]
0.0002
[0.0001, 0.0006]
Metamodel: RF
0.30
[0.29, 0.30]
0.01
[0.01 0 , 0.02 0 ]
0.095
[0.091, 0.099]
0.0004
[0.0002, 0.0008]
Metamodel: linear
0.23
[0.23, 0.24]
0.02
[0.02 0 , 0.03 0 ]
0.074
[0.070, 0.078]
0.001
[0.001 0 , 0.002 0 ]
Token log-prob.
0.11
[0.11, 0.12]
0.01
[0.01 0 , 0.02 0 ]
0.029
[0.026, 0.032]
0.0004
[0.0002, 0.0009]
Table S5: Calibration with Platt scaling. For each method, the map σ(alogit(p^)+b) is fitted to its own scores and cross-fitted within the validation split over ten folds stratified by correctness. Brackets are 95% bootstrap intervals.
Dataset
N
Accuracy
BioASQ
1,502
0.73
[0.71, 0.75]
DROP
1,423
0.50
[0.47, 0.53]
DuoRC
1,501
0.60
[0.58, 0.63]
RACE
674
0.50
[0.46, 0.54]
RelationExtraction
2,122
0.82
[0.80, 0.84]
TextbookQA
1,502
0.62
[0.59, 0.64]
Table S6: Answer accuracy per dataset not used in training. The fraction of answers graded correct, with 95% bootstrap intervals. This is the base rate every other quantity on that dataset is read against, and it varies widely across datasets. The in-domain equivalent is Table S1 .
Dataset
Conf. score head
MM: XGBoost
MM: RF
MM: linear
Token log-prob.
Typed-dec.
Judge
Self-score
BioASQ
0.78
[0.75, 0.81]
0.69
[0.66, 0.72]
0.68
[0.65, 0.71]
0.67
[0.64, 0.71]
0.68
[0.65, 0.72]
0.61
[0.58, 0.65]
0.65
[0.62, 0.68]
0.59
[0.57, 0.61]
DROP
0.76
[0.74, 0.79]
0.68
[0.66, 0.71]
0.71
[0.69, 0.74]
0.67
[0.64, 0.70]
0.63
[0.60, 0.65]
0.64
[0.61, 0.67]
0.65
[0.62, 0.67]
0.54
[0.52, 0.55]
DuoRC
0.82
[0.80, 0.84]
0.73
[0.70, 0.75]
0.73
[0.70, 0.75]
0.73
[0.70, 0.76]
0.79
[0.76, 0.81]
0.69
[0.67, 0.72]
0.74
[0.71, 0.76]
0.64
[0.63, 0.66]
RACE
0.82
[0.79, 0.85]
0.74
[0.71, 0.78]
0.74
[0.70, 0.77]
0.73
[0.69, 0.77]
0.73
[0.70, 0.77]
0.67
[0.63, 0.71]
0.68
[0.64, 0.72]
0.53
[0.50, 0.56]
RelationExtraction
0.90
[0.88, 0.93]
0.78
[0.75, 0.81]
0.77
[0.74, 0.80]
0.82
[0.79, 0.85]
0.83
[0.80, 0.86]
0.79
[0.76, 0.82]
0.71
[0.68, 0.73]
0.70
[0.68, 0.73]
TextbookQA
0.82
[0.80, 0.84]
0.74
[0.71, 0.76]
0.75
[0.72, 0.78]
0.75
[0.73, 0.78]
0.74
[0.71, 0.77]
0.64
[0.61, 0.67]
0.73
[0.71, 0.75]
0.60
[0.58, 0.62]
Table S7: ROC-AUC on the six datasets not used in training. Brackets are 95% bootstrap intervals. The self-score is scored against its own generation pass and therefore its own labels.
Dataset
Conf. score head
MM: XGBoost
MM: RF
MM: linear
Token log-prob.
Typed-dec.
Judge
Self-score
BioASQ
0.80
[0.78, 0.82]
0.81
[0.80, 0.83]
0.84
[0.83, 0.86]
0.79
[0.77, 0.81]
0.84
[0.83, 0.86]
0.85
[0.83, 0.87]
0.86
[0.84, 0.87]
0.82
[0.80, 0.83]
DROP
0.58
[0.55, 0.62]
0.68
[0.65, 0.70]
0.71
[0.69, 0.74]
0.68
[0.65, 0.70]
0.66
[0.63, 0.69]
0.65
[0.63, 0.68]
0.68
[0.65, 0.70]
0.62
[0.60, 0.65]
DuoRC
0.64
[0.60, 0.66]
0.74
[0.72, 0.76]
0.82
[0.80, 0.83]
0.70
[0.68, 0.73]
0.80
[0.77, 0.81]
0.77
[0.74, 0.79]
0.81
[0.79, 0.83]
0.76
[0.74, 0.78]
RACE
0.6
[0.6 0 , 0.7 0 ]
0.65
[0.61, 0.70]
0.71
[0.67, 0.74]
0.63
[0.58, 0.67]
0.68
[0.64, 0.72]
0.70
[0.66, 0.73]
0.71
[0.67, 0.74]
0.67
[0.63, 0.70]
RelationExtraction
0.94
[0.93, 0.95]
0.92
[0.91, 0.92]
0.94
[0.93, 0.94]
0.93
[0.92, 0.94]
0.92
[0.91, 0.93]
0.91
[0.90, 0.92]
0.92
[0.91, 0.92]
0.93
[0.92, 0.94]
TextbookQA
0.34
[0.31, 0.38]
0.67
[0.65, 0.70]
0.69
[0.67, 0.72]
0.66
[0.64, 0.69]
0.73
[0.71, 0.76]
0.75
[0.73, 0.77]
0.83
[0.81, 0.85]
0.77
[0.75, 0.78]
Table S8: F1 -score on the six datasets not used in training. Brackets are 95% bootstrap intervals. Every model is read at the 0.5 threshold. The self-score is scored against its own generation pass and therefore its own labels.
Dataset
Conf. score head
MM: XGBoost
MM: RF
MM: linear
Token log-prob.
Typed-dec.
Judge
Self-score
BioASQ
0.75
[0.72, 0.78]
0.82
[0.80, 0.85]
0.90
[0.88, 0.92]
0.78
[0.75, 0.80]
0.90
[0.88, 0.92]
0.96
[0.94, 0.97]
0.95
[0.93, 0.96]
0.998
[0.995, 1.000]
DROP
0.48
[0.44, 0.52]
0.78
[0.75, 0.81]
0.91
[0.89, 0.93]
0.82
[0.79, 0.85]
0.83
[0.81, 0.86]
0.77
[0.74, 0.80]
0.85
[0.82, 0.87]
0.998
[0.995, 1.000]
DuoRC
0.50
[0.47, 0.54]
0.77
[0.74, 0.79]
0.98
[0.97, 0.99]
0.67
[0.64, 0.70]
0.84
[0.82, 0.86]
0.87
[0.84, 0.89]
0.93
[0.92, 0.95]
0.999
[0.996, 1.000]
RACE
0.5
[0.4 0 , 0.6 0 ]
0.6
[0.6 0 , 0.7 0 ]
0.76
[0.71, 0.80]
0.6
[0.6 0 , 0.7 0 ]
0.73
[0.68, 0.77]
0.90
[0.87, 0.93]
0.95
[0.92, 0.97]
1.000
[1.000, 1.000]
RelationExtraction
0.94
[0.93, 0.95]
0.93
[0.92, 0.94]
0.99
[0.98, 0.99]
0.95
[0.94, 0.96]
0.93
[0.92, 0.94]
0.92
[0.91, 0.94]
0.95
[0.94, 0.96]
0.999
[0.998, 1.000]
TextbookQA
0.21
[0.19, 0.24]
0.61
[0.58, 0.65]
0.63
[0.60, 0.67]
0.58
[0.54, 0.61]
0.72
[0.69, 0.74]
0.86
[0.84, 0.88]
0.94
[0.93, 0.96]
1.000
[1.000, 1.000]
Table S9: Recall on the six datasets not used in training. Brackets are 95% bootstrap intervals. Every model is read at the 0.5 threshold. The self-score is scored against its own generation pass and therefore its own labels.
Dataset
Conf. score head
MM: XGBoost
MM: RF
MM: linear
Token log-prob.
Typed-dec.
Judge
Self-score
BioASQ
0.85
[0.82, 0.87]
0.80
[0.78, 0.82]
0.79
[0.77, 0.81]
0.80
[0.77, 0.82]
0.79
[0.77, 0.82]
0.76
[0.74, 0.79]
0.78
[0.76, 0.80]
0.69
[0.66, 0.71]
DROP
0.75
[0.71, 0.79]
0.60
[0.57, 0.63]
0.59
[0.56, 0.62]
0.58
[0.55, 0.61]
0.55
[0.52, 0.58]
0.57
[0.54, 0.60]
0.56
[0.53, 0.59]
0.45
[0.43, 0.48]
DuoRC
0.86
[0.83, 0.89]
0.72
[0.69, 0.75]
0.70
[0.68, 0.73]
0.74
[0.71, 0.77]
0.75
[0.73, 0.78]
0.69
[0.66, 0.71]
0.72
[0.69, 0.74]
0.61
[0.59, 0.64]
RACE
0.8
[0.8 0 , 0.9 0 ]
0.7
[0.7 0 , 0.8 0 ]
0.7
[0.6 0 , 0.7 0 ]
0.7
[0.6 0 , 0.7 0 ]
0.6
[0.6 0 , 0.7 0 ]
0.57
[0.53, 0.62]
0.56
[0.52, 0.61]
0.50
[0.46, 0.54]
RelationExtraction
0.94
[0.93, 0.95]
0.90
[0.89, 0.92]
0.89
[0.87, 0.90]
0.91
[0.90, 0.92]
0.92
[0.90, 0.93]
0.89
[0.88, 0.91]
0.88
[0.87, 0.90]
0.87
[0.85, 0.88]
TextbookQA
0.89
[0.84, 0.93]
0.75
[0.71, 0.78]
0.76
[0.73, 0.79]
0.78
[0.75, 0.81]
0.75
[0.72, 0.78]
0.66
[0.63, 0.69]
0.74
[0.71, 0.76]
0.62
[0.59, 0.65]
Table S10: Precision on the six datasets not used in training. Brackets are 95% bootstrap intervals. Every model is read at the 0.5 threshold. The self-score is scored against its own generation pass and therefore its own labels.
As large language models (LLMs) are increasingly deployed in critical decision-making systems, the lack of reliable methods to measure their uncertainty presents a fundamental trustworthiness risk. We introduce a normalized confidence score based on output anchor token probabilities: classification labels for structured tasks and self-evaluation responses (Yes/No) for open-ended generation. This enables direct detection of errors and hallucinations with minimal overhead and without external validation. We make three key contributions. First, we propose a normalized confidence score and self-evaluation framework that exposes reliable confidence estimates for error detection across seven diverse benchmark tasks and five LLMs of varying architectures and sizes. Second, our theoretical analysis reveals that supervised fine-tuning (SFT) yields well-calibrated confidence through maximum-likelihood estimation, whereas reinforcement learning methods (PPO, GRPO) and DPO induce overconfidence via reward exploitation. Third, we propose post-RL SFT with self-distillation to restore confidence reliability in RL-trained models. Empirical results demonstrated that SFT improved average confidence-correctness AUROC from 0.806 to 0.879 and reduced calibration error from 0.163 to 0.034 on Qwen3-4B, while GRPO and DPO degraded confidence reliability. We demonstrated practical value through adaptive retrieval-augmented generation (RAG) that selectively retrieves context when the model lacks confidence, using only 58% of retrieval operations to recover 95% of the maximum achievable accuracy gain on TriviaQA
Large Language Models (LLMs) show promise for automated grading, but their outputs can be unreliable. Rather than improving grading accuracy directly, we address a complementary problem: predicting when an LLM grader is likely to be correct. This enables selective automation where high-confidence predictions are processed automatically while uncertain cases are flagged for human review. We compare three confidence estimation methods (self-reported confidence, self-consistency voting, and token probability) across seven LLMs of varying scale (4B to 120B parameters) on three educational datasets: RiceChem (long-answer chemistry), SciEntsBank, and Beetle (short-answer science). Our experiments reveal that self-reported confidence consistently achieves the best calibration across all conditions (avg ECE 0.166 vs 0.229 for self-consistency). Surprisingly, self-consistency remains 38% worse despite requiring 5× the inference cost. Larger models exhibit substantially better calibration though gains vary by dataset and method (e.g., a 28% ECE reduction for self-reported), with GPT-OSS-120B achieving the best calibration (avg ECE 0.100) and strong discrimination (avg AUC 0.668). We also observe that confidence is strongly top-skewed across methods, creating a ``confidence floor'' that practitioners must account for when setting thresholds. These findings suggest that simply asking LLMs to report their confidence provides a practical approach for identifying reliable grading predictions. Code is available here.
Uncertainty quantification (UQ) is essential for the safe deployment of large language models (LLMs). Existing methods, from verbalized confidence to ones requiring multiple generations, are often zero-shot and produce scores quantifying uncertainty without the need for labelled data. Nonetheless, in practice one must always evaluate their performance on a dataset of interest before deployment. In this work we show that, by leveraging this dataset, we consistently outperform these existing scores. Specifically, we build simple classifiers that predict LLM response correctness by using these scores and the correctness of similar queries as features. Our method produces minimal computational overhead, making it a cheap and straightforward enhancement for UQ in LLMs for real-world applications.
Sokhna Diarra Mbacke, Mouloud Belbahri, Gabriel Loaiza-Ganem