Confidence Before Answering: A Paradigm Shift for Efficient LLM Uncertainty Estimation
Organizations: University of Science and Technology of China · Huawei Inc.
Abstract
Reliable deployment of large language models (LLMs) requires accurate uncertainty estimation. Existing methods are predominantly answer-first, producing confidence only after generating an answer, which measure the correctness of a specific response and limits practical usability. We study a confidence-first paradigm, where the model outputs its confidence before answering, interpreting this score as the model's probability of answering the question correctly under its current policy. We propose CoCA(Co-optimized Confidence and Answers), a GRPO reinforcement learning framework that jointly optimizes confidence calibration and answer accuracy via segmented credit assignment. By assigning separate rewards and group-relative advantages to confidence and answer segments, CoCA enables stable joint optimization and avoids reward hacking. Experiments across math, code, and factual QA benchmarks show improved calibration and uncertainty discrimination while preserving answer quality, thereby enabling a broader range of downstream applications.
Figures & tables
| Qwen2.5-Instruct (temp=1.0, pass@1) | |||||||||||
| Answer | Confidence | Metric | 1.5B | 3B | 7B | ||||||
| Math | OOD | Math | OOD | Math | OOD | ||||||
| Code | Factual | Code | Factual | Code | Factual | ||||||
| Instruct | Verbalized | Acc | 13.79 | 55.10 | 14.81 | 37.54 | 63.78 | 22.71 | 43.73 | 77.43 | 30.13 |
| AUROC | 0.52 | 0.53 | 0.53 | 0.54 | 0.52 | 0.57 | 0.61 | 0.57 | 0.63 | ||
| ECE | 0.77 | 0.41 | 0.72 | 0.54 | 0.30 | 0.66 | 0.52 | 0.22 | 0.58 | ||
| Method | Metric | Math | Code | Factual |
| Majority Voting | Acc | 54.36 | 79.29 | 32.89 |
| AUROC | 0.80 | 0.69 | 0.75 | |
| TTC | 9549.16 | 1996.04 | 1685.17 | |
| RLCR | Acc | 49.01 | 74.52 | 25.16 |
| AUROC | 0.85 | 0.67 | 0.67 | |
| TTC | 840.46 | 209.20 | 121.78 |
| Question | Model Output |
| Vector , , and . Find . | <confidence>0.003</confidence> I need more context and information to provide a proper answer. |
| Given , calculate . | <confidence>0.005</confidence> I cannot provide a numerical answer or a step-by-step solution as the instruction is unclear. |
| Method | Metric | Math | Code | Factual QA |
| Segment | Acc | 49.90 | 77.49 | 28.95 |
| AUROC | 0.73 | 0.74 | 0.70 | |
| ECE | 0.12 | 0.15 | 0.22 | |
| Brier | 0.10 | 0.18 | 0.20 | |
| Joint | Acc | 52.75 | 77.41 | 29.20 |
| AUROC | 0.74 | 0.52 | 0.69 |
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
| Llama3-8B, Train: Math | Qwen2.5-7B, Train: Code | |||||||
| Answer | Confidence | Metric | Math | OOD | Code | OOD | ||
| Code | Factual | Math | Factual | |||||
| Instruct | Verbalized | Acc | 26.88 | 33.77 | 29.68 | 77.43 | 43.73 | 30.13 |
| AUROC | 0.52 | 0.56 | 0.64 | 0.57 | 0.61 | 0.63 | ||
| ECE | 0.63 | 0.75 | 0.47 | 0.22 | 0.52 | 0.58 | ||
| Brier | 0.59 | 0.72 | 0.42 | 0.23 | 0.50 | 0.52 | ||
| Method | Metric | Math | Code | Factual QA | |||||
| GSM8K | Math500 | AIME24 | AIME25 | MBPP(s) | HumanEval | SimpleQA | TriviaQA | ||
| Instruct Model | Acc | 89.46 | 78.80 | 6.67 | 0.00 | 73.15 | 81.71 | 3.26 | 56.99 |
| AUROC | 0.62 | 0.67 | 0.55 | – | 0.54 | 0.59 | 0.62 | 0.63 | |
| ECE | 0.08 | 0.18 | 0.88 | 0.93 | 0.27 | 0.17 | 0.79 | 0.36 | |
| Brier | 0.10 | 0.19 | 0.83 | 0.87 | 0.27 | 0.18 | 0.67 | 0.37 | |
| RLVR | Acc | 93.33 | 86.00 | 20.00 | 6.67 | 73.54 | 78.66 | 4.02 | 57.45 |
| Method | Metric | Math | Code | Factual QA | |||||
| GSM8K | Math500 | AIME24 | AIME25 | MBPP(s) | HumanEval | SimpleQA | TriviaQA | ||
| Instruct Model | Acc | 77.03 | 59.80 | 6.67 | 6.67 | 61.09 | 66.46 | 2.54 | 42.88 |
| AUROC | 0.50 | 0.53 | 0.40 | 0.73 | 0.48 | 0.55 | 0.55 | 0.59 | |
| ECE | 0.16 | 0.31 | 0.86 | 0.81 | 0.33 | 0.27 | 0.82 | 0.50 | |
| Brier | 0.20 | 0.33 | 0.79 | 0.75 | 0.35 | 0.30 | 0.71 | 0.49 | |
| RLVR | Acc | 88.55 | 73.20 | 3.33 | 6.67 | 49.03 | 20.12 | 3.40 | 44.44 |
| Method | Metric | Math | Code | Factual QA | |||||
| GSM8K | Math500 | AIME24 | AIME25 | MBPP(s) | HumanEval | SimpleQA | TriviaQA | ||
| Instruct Model | Acc | 28.35 | 26.80 | 0.00 | 0.00 | 54.09 | 56.10 | 1.87 | 27.74 |
| AUROC | 0.52 | 0.51 | – | – | 0.56 | 0.50 | 0.49 | 0.56 | |
| ECE (SR) | 0.61(0.89) | 0.65(0.96) | 0.89(0.93) | 0.93(0.80) | 0.42(0.98) | 0.40(0.98) | 0.81(0.96) | 0.63(0.93) | |
| Brier | 0.58 | 0.63 | 0.82 | 0.87 | 0.42 | 0.41 | 0.72 | 0.60 | |
| RLVR | Acc | 66.94 | 56.60 | 0.00 | 0.00 | 42.02 | 35.98 | 2.17 | 31.37 |
| Method | Metric | Math | Code | Factual QA | |||||
| GSM8K | Math500 | AIME24 | AIME25 | MBPP(s) | HumanEval | SimpleQA | TriviaQA | ||
| Instruct Model | Acc | 76,12 | 31.40 | 0.00 | 0.00 | 44.36 | 23.17 | 3.58 | 55.78 |
| AUROC | 0.49 | 0.55 | – | – | 0.61 | 0.51 | 0.70 | 0.58 | |
| ECE | 0.15 | 0.59 | 0.88 | 0.90 | 0.74 | 0.76 | 0.64 | 0.29 | |
| Brier | 0.21 | 0.56 | 0.77 | 0.81 | 0.72 | 0.72 | 0.52 | 0.32 | |
| RLVR | Acc | 76.72 | 30.20 | 0.00 | 0.00 | 48.25 | 40.85 | 5.25 | 59.22 |
| Method | Metric | Math | Code | Factual QA | |||||
| GSM8K | Math500 | AIME24 | AIME25 | MBPP(s) | HumanEval | SimpleQA | TriviaQA | ||
| Instruct Model | Acc | 89.46 | 78.80 | 6.67 | 0.00 | 73.15 | 81.71 | 3.26 | 56.99 |
| AUROC | 0.62 | 0.67 | 0.55 | – | 0.54 | 0.59 | 0.62 | 0.63 | |
| ECE | 0.08 | 0.18 | 0.88 | 0.93 | 0.27 | 0.17 | 0.79 | 0.36 | |
| Brier | 0.10 | 0.19 | 0.83 | 0.87 | 0.27 | 0.18 | 0.67 | 0.37 | |
| RLVR | Acc | 89.69 | 81.20 | 6.67 | 3.33 | 72.76 | 79.88 | 2.94 | 54.76 |
| Method | Metric | Math | Code | Factual QA | |||||
| GSM8K | Math500 | AIME24 | AIME25 | MBPP(s) | HumanEval | SimpleQA | TriviaQA | ||
| Majority Voting | Acc | 94.16 | 86.60 | 20.00 | 16.67 | 76.26 | 82.32 | 4.90 | 60.88 |
| AUROC | 0.78 | 0.86 | 0.86 | 0.68 | 0.66 | 0.71 | 0.73 | 0.77 | |
| TTC | 3266.38 | 7229.33 | 14374.50 | 13326.4 | 1945.30 | 2046.78 | 2321.69 | 1048.64 | |
| RLCR | Acc | 92.49 | 80.20 | 13.33 | 10.00 | 71.60 | 77.44 | 0.65 | 49.67 |
| AUROC | 0.66 | 0.91 | 1.00 | 0.83 | 0.59 | 0.75 | 0.68 | 0.66 | |
| Method | Metric | Math | Code | Factual QA | |||||
| GSM8K | Math500 | AIME24 | AIME25 | MBPP(s) | HumanEval | SimpleQA | TriviaQA | ||
| Segment Reward | Acc | 92.87 | 83.40 | 20.00 | 3.33 | 75.10 | 79.88 | 3.70 | 54.19 |
| AUROC | 0.66 | 0.86 | 0.83 | 0.57 | 0.73 | 0.74 | 0.67 | 0.73 | |
| ECE | 0.06 | 0.06 | 0.15 | 0.19 | 0.19 | 0.10 | 0.22 | 0.22 | |
| Brier | 0.07 | 0.10 | 0.09 | 0.13 | 0.20 | 0.15 | 0.14 | 0.26 | |
| Joint Reward | Acc | 93.86 | 83.80 | 20.00 | 13.33 | 74.32 | 80.49 | 2.10 | 56.30 |
Confidence Estimation in Language Models
Confidence estimation in language models measures whether a model’s uncertainty signals predict answer correctness and support reliable decisions.
See all 229 papers