Can an Agent Learn to Predict Its Own Failure? Outcome-Grounded Confidence Calibration in LLM Agents
Organizations: SAP
Abstract
Controlling an acting LLM agent means deciding, at each step of a long-horizon task, whether to trust its next action, abstain, or hand off to a human. That decision needs a per-step confidence signal predicting whether the current rollout will eventually succeed. The agent's own self-reported verbalized confidence is the natural candidate, but existing reinforcement learning methods calibrate it against the correctness of a decision at the current step. We propose a method to calibrate it against the eventual outcome of a multi-step episode: under GRPO, the group of rollouts for a task supplies success labels, and a proper scoring rule scores each step's confidence against the realized outcome. In offline RL on recorded trajectories of a Qwen2.5-7B agent in ALFWorld, TextWorld, and WebShop environments, the AUROC of step confidence against episode outcome rises from near chance to 0.68-0.85, and the top-10% of steps the agent is most confident about succeed ~4.3x more often than average. In online RL on the live ALFWorld agent, four calibration rewards improve early-step AUROC, expected calibration error goes from 0.42 to below 0.12, and selective execution improves over both the untrained agent and a format-only RL control, without degrading task success. We also introduce an evaluation protocol that separates episode depth, task difficulty, and attempt-level foresight, which shows where the gain lies: the trained agent recognizes from its first step which tasks it will fail, while telling a succeeding attempt from a failing one at the same task is harder, with some early-window signal emerging on TextWorld.
Figures & tables
| Pooled AUROC | Tail success lift | |||
|---|---|---|---|---|
| Environment | Untrained | Trained | Untrained | Trained |
| ALFWorld | 0.517 | 0.681 | 1.55 | 4.33 |
| TextWorld | 0.578 | 0.722 | 1.57 | 4.35 |
| WebShop | 0.462 | 0.850 | 1.11 | 4.35 |
| Reward | Type | AUROC [95% CI] | Format |
|---|---|---|---|
| Spherical | proper | 0.882 [.837,.921] | 1.00 |
| Brier | proper | 0.864 [.822,.903] | 1.00 |
| Ranking | order | 0.845 [.791,.894] | 1.00 |
| L1 | improper | 0.839 [.788,.887] | 1.00 |
| Logarithmic | proper | 0.828 [.770,.880] | 1.00 |
| Decision | – | 0.820 [.773,.863] | 1.00 |
| Estimator | Seed 0 | Seed 1 |
|---|---|---|
| GRPO | 0.613 [.529,.696] | 0.676 [.598,.749] |
| RLOO | 0.801 [.739,.856] | 0.876 [.825,.922] |
| PPO, value critic | 0.500 | 0.500 |
| Episode | Pooled AUROC, | ECE | Brier | Top-10% success, | |||
|---|---|---|---|---|---|---|---|
| Arm | success | value | (all steps) | (all steps) | value | ||
| Untrained | 0.201 | 0.689 [.640,.733] | – | 0.419 [.398,.438] | 0.250 [.237,.264] | 0.493 [.323,.675] | – |
| Format-only | 0.188 | 0.708 [.660,.749] | [-.010,.051] | 0.429 [.408,.447] | 0.253 [.239,.267] | 0.465 [.296,.626] | [-.094,.037] |
| Brier+ | 0.194 | 0.761 [.716,.798] | [.026,.112] | 0.115 [.105,.124] | 0.052 [.045,.061] | 0.561 [.391,.748] | [-.000,.185] |
| Balanced Brier | 0.197 | 0.765 [.721,.805] | [.038,.111] | 0.114 [.102,.125] | 0.054 [.046,.064] | 0.609 [.413,.765] | [.035,.193] |
| Brier+dispersion | 0.189 | 0.790 [.742,.828] | [.069,.134] | 0.054 [.050,.059] | 0.044 [.034,.054] | 0.635 [.426,.804] | [.054,.224] |
| Pooled | Between-task | Within-task | ||||
|---|---|---|---|---|---|---|
| Arm | , | ( mixed) | , ( paired) | , all steps | depth-matched, all | |
| Untrained | 0.562 [.530,.600] | – | 0.606 (20) [.515,.696] | – | – | – |
| Format-only | 0.568 [.534,.602] | [-.004,.082] | 0.571 (15) [.484,.657] | (8) [-.118,.018] | [-.114,-.045] | [-.080,.133] |
| Brier+ | 0.642 [.584,.691] | [-.017,.085] | 0.585 (20) [.483,.680] | (12) [-.184,.059] | [-.056,.029] | [-.059,.124] |
| Balanced Brier | 0.697 [.637,.744] | [-.019,.077] | 0.657 (19) [.582,.733] | (11) [-.128,.055] | [-.082,.005] | [-.034,.143] |
| Brier+dispersion | 0.700 [.634,.763] | [.029,.115] | 0.661 (15) [.568,.757] | (7) [-.262,.062] | [-.102,.004] | [-.060,.140] |
Appendix figures & tables11 assets
Supplementary material from the paper’s appendix.
Appendix
| Estimand | 7B (128 tasks) | 14B (128 tasks) |
|---|---|---|
| Pooled, all steps | 0.740 [.704,.776] | 0.698 [.650,.746] |
| Depth-only baseline, all steps | 0.817 [.777,.857] | 0.755 [.722,.792] |
| Pooled, | 0.689 [.640,.733] | 0.722 [.667,.774] |
| Depth-only baseline, | 0.499 | 0.500 |
| Pooled, step 0 | 0.562 [.530,.600] | 0.599 [.532,.677] |
| Between-task, | 0.825 [.758,.881] | 0.830 [.748,.896] |
| Arm | Succ. | Pooled all | Pooled | Pooled | Between | Within all ( ) | Within ( ) | Within | Depth-matched |
|---|---|---|---|---|---|---|---|---|---|
| Untrained | 0.201 | 0.740 | 0.689 | 0.562 | 0.825 | 0.651 (20) | 0.606 (20) | 0.529 | 0.633 |
| [.704,.776] | [.640,.733] | [.530,.600] | [.758,.881] | [.598,.704] | [.515,.696] | [.432,.620] | [.565,.715] | ||
| Format-only | 0.188 | 0.754 | 0.708 | 0.568 | 0.858 | 0.665 (15) | 0.571 (15) | 0.507 | 0.646 |
| [.712,.792] | [.660,.749] | [.534,.602] | [.792,.911] | [.601,.727] | [.484,.657] | [.393,.610] | [.575,.739] | ||
| Brier+ | 0.194 | 0.799 | 0.761 | 0.642 | 0.862 | 0.673 (20) | 0.585 (20) | 0.500 | 0.659 |
| [.753,.838] | [.716,.798] | [.584,.691] | [.798,.911] | [.615,.733] | [.483,.680] | [.378,.626] | [.607,.719] |
| Arm | Pooled all | Pooled | Between | Within all ( ) | Within ( ) | Depth-matched |
|---|---|---|---|---|---|---|
| Format-only | (8) | (8) | ||||
| [-.019,.054] | [-.010,.051] | [-.004,.082] | [-.114,-.045] | [-.118,.018] | [-.080,.133] | |
| Brier+ | (12) | (12) | ||||
| [.014,.103] | [.026,.112] | [-.017,.085] | [-.056,.029] | [-.184,.059] | [-.059,.124] | |
| Balanced Brier | (11) | (11) | ||||
| [-.008,.084] | [.038,.111] | [-.019,.077] | [-.082,.005] | [-.128,.055] | [-.034,.143] |
| Win | Emit | Within-task AUROC | ||
|---|---|---|---|---|
| Arm | rate | rate | all steps | |
| Untrained | 0.146 | 0.971 | 0.476 [.433,.526] | 0.697 [.668,.727] |
| Brier+ | 0.262 | 0.979 | 0.506 [.464,.548] | 0.668 [.633,.703] |
| Format-only | 0.172 | 0.744 | 0.517 [.488,.545] | 0.684 [.647,.720] |
| Arm | Mean conf | ECE all | ECE | Brier all | Brier | Top-10% | Top-25% | Top-10% all | Top-5% all |
|---|---|---|---|---|---|---|---|---|---|
| all / | |||||||||
| Untrained | 0.475 / 0.477 | 0.419 | 0.277 | 0.250 | 0.229 | 0.493 | 0.363 | 0.241 | 0.241 |
| [.398,.438] | [.217,.330] | [.237,.264] | [.212,.248] | [.323,.675] | [.241,.475] | [.151,.327] | [.151,.333] | ||
| Format-only | 0.474 / 0.476 | 0.429 | 0.290 | 0.253 | 0.229 | 0.465 | 0.363 | 0.193 | 0.182 |
| [.408,.447] | [.236,.347] | [.239,.267] | [.212,.248] | [.296,.626] | [.220,.464] | [.117,.272] | [.114,.275] | ||
| Brier+ | 0.161 / 0.189 | 0.115 | 0.051 | 0.052 | 0.137 | 0.561 | 0.444 | 0.303 | 0.491 |
| Arm | ECE all | ECE | Brier all | Brier | Top-10% | Top-25% | Top-10% all | Triage top-50% | Task AUROC |
|---|---|---|---|---|---|---|---|---|---|
| Format-only | |||||||||
| [-.001,.021] | [-.005,.030] | [-.005,.010] | [-.008,.006] | [-.094,.037] | [-.050,.036] | [-.084,-.012] | [-.034,.018] | [-.013,.176] | |
| Brier+ | |||||||||
| [-.318,-.286] | [-.271,-.147] | [-.213,-.180] | [-.126,-.057] | [-.000,.185] | [.038,.160] | [.018,.128] | [-.026,.008] | [-.127,.111] | |
| Balanced Brier | |||||||||
| [-.319,-.288] | [-.273,-.126] | [-.213,-.180] | [-.125,-.054] | [.035,.193] | [.042,.155] | [.007,.111] | [-.034,.010] | [-.092,.124] |
| Qwen2.5-7B-Instruct | Qwen2.5-14B-Instruct | |
|---|---|---|
| Mean conf, all / | 0.475 / 0.477 | 0.534 / 0.646 |
| Step success, all / | 0.057 / 0.201 | 0.112 / 0.289 |
| ECE, all | 0.419 [.398,.438] | 0.425 [.388,.458] |
| ECE, | 0.277 [.217,.330] | 0.357 [.296,.417] |
| Brier, all | 0.250 [.237,.264] | 0.303 [.281,.328] |
| Brier, | 0.229 [.212,.248] | 0.310 [.283,.336] |
| AUROC, sampled | Mass in | Mass | AUROC, greedy | |
|---|---|---|---|---|
| (per seed) | (2 seeds) | |||
| 0.00 | 0.746 (0.717, 0.775) | 0.64 | 0.34 | 0.720 / 0.762 |
| 0.05 | 0.678 (0.679, 0.676) | 0.76 | 0.23 | 0.690 / 0.698 |
| 0.10 | 0.675 (0.675) | 0.74 | 0.25 | 0.663 / 0.676 |
| 0.15 | 0.584 (0.594, 0.574) | 0.88 | 0.12 | 0.593 / 0.597 |
| 0.30 | 0.556 (0.587, 0.525) | 0.93 | 0.08 | 0.568 / 0.520 |
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 249 papers