Know When You're Wrong: Aligning Confidence with Correctness for LLM Error Detection
Organizations: Alexa AI, Amazon, Seattle, WA, USA
Abstract
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
Figures & tables
| Model | Metric | BoolQ | CQA | AG News | HellaSwag | GSM8K | TriviaQA | TriviaQA-RC | Average |
|---|---|---|---|---|---|---|---|---|---|
| Qwen3 4B | Acc. % | 84.40 | 78.21 | 85.63 | 79.64 | 92.49 | 54.21 | 72.71 | 78.18 |
| AUROC | 0.817 | 0.803 | 0.750 | 0.809 | 0.773 | 0.829 | 0.863 | 0.806 | |
| ECE | 0.149 | 0.196 | 0.132 | 0.182 | 0.069 | 0.255 | 0.158 | 0.163 | |
| Qwen3 30B | Acc. % | 89.11 | 85.09 | 83.54 | 87.36 | 96.36 | 72.99 | 83.08 | 85.36 |
| AUROC | 0.778 | 0.847 | 0.710 | 0.857 | 0.787 | 0.859 | 0.835 | 0.810 | |
| ECE | 0.100 | 0.124 | 0.155 | 0.102 | 0.026 | 0.181 | 0.124 | 0.116 |
| Method | Metric | BoolQ | CQA | AG News | HellaSwag | GSM8K | TriviaQA | TriviaQA-RC | Average |
|---|---|---|---|---|---|---|---|---|---|
| SFT | Acc. % | 89.33 | 83.54 | 90.42 | 91.34 | 94.62 | 52.52 | 72.25 | 82.00 |
| AUROC | 0.839 | 0.847 | 0.842 | 0.898 | 0.897 | 0.908 | 0.924 | 0.879 | |
| ECE | 0.013 | 0.014 | 0.022 | 0.040 | 0.030 | 0.050 | 0.066 | 0.034 | |
| RL (GRPO) | Acc. % | 87.74 | 80.18 | 88.80 | 85.42 | 94.16 | 54.43 | 73.36 | 80.58 |
| AUROC | 0.819 | 0.786 | 0.700 | 0.807 | 0.799 | 0.869 | 0.886 | 0.809 | |
| ECE | 0.120 | 0.189 | 0.108 | 0.137 | 0.052 | 0.191 | 0.150 | 0.135 |
| Model | Ret.% | Gain | Gain/Ret | |
|---|---|---|---|---|
| Qwen3 Instruct 4B | 0.01 | 21.5% | +7.86% | 0.37 |
| 0.10 | 25.0% | +9.09% | 0.36 | |
| 0.70 | 29.0% | +10.24% | 0.35 | |
| 0.90 | 30.6% | +10.62% | 0.35 | |
| Always | 100% | +17.77% | 0.18 | |
| +SFT | 0.10 | 1.6% | +0.76% | 0.48 |
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| Gemma-3-4B | Gemma-3-12B | GLM-4-9B | Qwen3-4B | Qwen3-30B | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Task | Raw | Norm | Raw | Norm | Raw | Norm | Raw | Norm | Raw | Norm | |||||
| BoolQ | .457 | .788 | 331 | .461 | .747 | 286 | .833 | .826 | -7 | .736 | .817 | 81 | .796 | .778 | -18 |
| CQA | .610 | .756 | 146 | .552 | .820 | 268 | .832 | .833 | 1 | .761 | .803 | 42 | .797 | .847 | 50 |
| AG News | .427 | .718 | 291 | .589 | .683 | 94 | .799 | .809 | 10 | .684 | .750 | 66 | .687 | .710 | 23 |
| HellaSwag | .546 | .698 | 152 | .545 | .804 | 259 | .823 | .827 | 4 | .784 | .809 | 25 | .849 | .857 | 8 |
| GSM8K | .687 | .686 | -1 | .800 | .801 | 1 | .733 | .734 | 1 | .657 | .773 | 116 | .783 | .787 | 4 |
| Conf. bin | BoolQ | CQA | AG News | HellaSwag | GSM8K | TriviaQA | TriviaQA-RC | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Avg. | Acc. | Conf. | Acc. | Conf. | Acc. | Conf. | Acc. | Conf. | Acc. | Conf. | Acc. | Conf. | Acc. | Conf. |
| Qwen3-4B-Instruct Baseline | ||||||||||||||
| 1 | 55.05 | 0.939 | 40.98 | 0.792 | 52.76 | 0.884 | 44.72 | 0.793 | 75.57 | 0.934 | 16.50 | 0.000 | 21.57 | 0.000 |
| 2 | 64.53 | 1.000 | 51.64 | 0.994 | 71.97 | 1.000 | 54.08 | 0.989 | 83.97 | 1.000 | 20.90 | 0.001 | 31.88 | 0.215 |
| 3 | 72.78 | 1.000 | 71.31 | 1.000 | 81.32 | 1.000 | 65.44 | 1.000 | 90.08 | 1.000 | 23.86 | 0.234 | 50.72 | 0.995 |
| 4 | 79.51 | 1.000 | 66.39 | 1.000 | 90.92 | 1.000 | 75.90 | 1.000 | 92.37 | 1.000 | 34.34 | 0.977 | 68.62 | 1.000 |
Language Model Error Detection
Language model error detection identifies unreliable answers, reasoning steps, and actions so systems can flag, verify, or repair them.
See all 82 papers