JUCAL: Jointly Calibrating Aleatoric and Epistemic Uncertainty in Classification Tasks
Organizations: UC Berkeley · ETH Zurich · UBS Zurich · Kaiju Worldwide
Abstract
We study post-calibration uncertainty for trained ensembles of classifiers. Specifically, we consider both aleatoric (label noise) and epistemic (model) uncertainty. Among the most popular and widely used calibration methods in classification are temperature scaling (i.e., pool-then-calibrate) and conformal methods. However, the main shortcoming of these calibration methods is that they do not balance the proportion of aleatoric and epistemic uncertainty. Not balancing these uncertainties can severely misrepresent predictive uncertainty, leading to overconfident predictions in some input regions while being underconfident in others. To address this shortcoming, we present a simple but powerful calibration algorithm Joint Uncertainty Calibration (JUCAL) that jointly calibrates aleatoric and epistemic uncertainty. JUCAL jointly calibrates two constants to weight and scale epistemic and aleatoric uncertainties by optimizing the negative log-likelihood (NLL) on the validation/calibration dataset. JUCAL can be applied to any trained ensemble of classifiers (e.g., transformers, CNNs, or tree-based methods), with minimal computational overhead, without requiring access to the models' internal parameters. We experimentally evaluate JUCAL on various text classification tasks, for ensembles of varying sizes and with different ensembling strategies. Our experiments show that JUCAL significantly outperforms SOTA calibration methods across all considered classification tasks, reducing NLL and predictive set size by up to 15% and 20%, respectively. Interestingly, even applying JUCAL to an ensemble of size 5 can outperform temperature-scaled ensembles of size up to 50 in terms of NLL and predictive set size, resulting in up to 10 times smaller inference costs. Thus, we propose JUCAL as a new go-to method for calibrating ensembles in classification.
Figures & tables
Appendix figures & tables29 assets
Supplementary material from the paper’s appendix.
Appendix
| More observations | Better prior | More covariates | Smaller noise | |
|---|---|---|---|---|
| Epistemic | Decreases | Decreases | Increases (typically) / / | Decreases |
| Aleatoric | No effect | No effect | Decreases / | Decreases |
| Ensemble Type | DBpedia | News | SST-2 | SetFit | Tweet | IMDB |
|---|---|---|---|---|---|---|
| G5 | 0.0376 ± 0.0005 | 0.1682 ± 0.0048 | 0.1359 ± 0.0051 | 0.5465 ± 0.0033 | 0.5095 ± 0.0089 | 0.1171 ± 0.0028 |
| G5 p.t.c. | 0.0348 ± 0.0007 | 0.1618 ± 0.0052 | 0.1208 ± 0.0040 | 0.5431 ± 0.0019 | 0.5012 ± 0.0052 | 0.1018 ± 0.0022 |
| G5 JUCAL | 0.0290 ± 0.0004 | 0.1479 ± 0.0023 | 0.1143 ± 0.0032 | 0.4965 ± 0.0013 | 0.4772 ± 0.0028 | 0.1005 ± 0.0018 |
| G50 | 0.0349 ± 0.0005 | 0.1541 ± 0.0043 | 0.1137 ± 0.0039 | 0.531 ± 0.0016 | 0.4763 ± 0.0052 | 0.1050 ± 0.0026 |
| G50 p.t.c. | 0.0331 ± 0.0003 | 0.1510 ± 0.0037 | 0.1130 ± 0.0035 | 0.5309 ± 0.0016 | 0.4758 ± 0.0049 | 0.1042 ± 0.0019 |
| G50 JUCAL | 0.0288 ± 0.0004 | 0.1423 ± 0.0024 | 0.1090 ± 0.0032 | 0.4972 ± 0.0018 | 0.4680 ± 0.0045 | 0.0983 ± 0.0017 |
| Ensemble Type | DBpedia | News | SST-2 | SetFit | Tweet | IMDB |
|---|---|---|---|---|---|---|
| G5 | 0.9895 ± 0.0 | 0.981 ± 0.0011 | 0.984 ± 0.0005 | 0.8915 ± 0.0008 | 0.9103 ± 0.0028 | 0.9859 ± 0.0002 |
| G5 p.t.c. | 0.9895 ± 0.0 | 0.981 ± 0.0011 | 0.984 ± 0.0005 | 0.8915 ± 0.0008 | 0.9103 ± 0.0027 | 0.9859 ± 0.0002 |
| G5 JUCAL | 0.9897 ± 0.0 | 0.9829 ± 0.0005 | 0.9842 ± 0.0005 | 0.924 ± 0.0006 | 0.9211 ± 0.0006 | 0.9858 ± 0.0002 |
| G50 | 0.9895 ± 0.0 | 0.981 ± 0.0008 | 0.9833 ± 0.0005 | 0.9023 ± 0.0006 | 0.9157 ± 0.0021 | 0.9838 ± 0.0003 |
| G50 p.t.c. | 0.9895 ± 0.0 | 0.981 ± 0.0008 | 0.9833 ± 0.0005 | 0.9023 ± 0.0006 | 0.9158 ± 0.0021 | 0.9838 ± 0.0003 |
| G50 JUCAL | 0.9897 ± 0.0 | 0.9835 ± 0.0005 | 0.9849 ± 0.0005 | 0.9237 ± 0.0007 | 0.9236 ± 0.0014 | 0.9855 ± 0.0002 |
| Ensemble Type | DBpedia | News | SST-2 | SetFit | Tweet | IMDB |
|---|---|---|---|---|---|---|
| G5 | 0.9998312 ± 0.0 | 0.9929 ± 0.0007 | 0.9907 ± 0.0007 | 0.9144 ± 0.0008 | 0.9316 ± 0.0019 | 0.9934 ± 0.0003 |
| G5 p.t.c. | 0.9998311 ± 0.0 | 0.9929 ± 0.0007 | 0.9907 ± 0.0007 | 0.9144 ± 0.0008 | 0.9316 ± 0.0018 | 0.9934 ± 0.0003 |
| G5 JUCAL | 0.9998758 ± 0.0 | 0.9943 ± 0.0003 | 0.9912 ± 0.0006 | 0.9377 ± 0.0004 | 0.9383 ± 0.0010 | 0.9934 ± 0.0002 |
| G50 | 0.9998198 ± 0.0 | 0.9931 ± 0.0005 | 0.9898 ± 0.0007 | 0.9229 ± 0.0005 | 0.9369 ± 0.0014 | 0.9911 ± 0.0003 |
| G50 p.t.c. | 0.9998199 ± 0.0 | 0.9931 ± 0.0005 | 0.9898 ± 0.0007 | 0.9229 ± 0.0005 | 0.9369 ± 0.0014 | 0.9911 ± 0.0003 |
| G50 JUCAL | 0.9998785 ± 0.0 | 0.9948 ± 0.0004 | 0.9917 ± 0.0007 | 0.9371 ± 0.0006 | 0.9405 ± 0.0014 | 0.9930 ± 0.0004 |
| Ensemble Type | DBpedia | News | SST-2 | SetFit | Tweet | IMDB |
|---|---|---|---|---|---|---|
| G5 | 1.2941 ± 0.0395 | 1.3517 ± 0.0385 | 1.1544 ± 0.0097 | 2.6642 ± 0.0228 | 2.3281 ± 0.0963 | 1.0996 ± 0.0065 |
| G5 p.t.c. | 1.3008 ± 0.0484 | 1.3591 ± 0.0424 | 1.1550 ± 0.0107 | 2.6567 ± 0.0209 | 2.3313 ± 0.0993 | 1.1003 ± 0.0062 |
| G5 JUCAL | 1.2270 ± 0.0438 | 1.2490 ± 0.0161 | 1.1459 ± 0.0116 | 2.2368 ± 0.0231 | 2.1286 ± 0.0722 | 1.1004 ± 0.0039 |
| G50 | 1.3516 ± 0.0428 | 1.3436 ± 0.0313 | 1.1617 ± 0.0148 | 2.6519 ± 0.0237 | 2.2280 ± 0.0507 | 1.1135 ± 0.0070 |
| G50 p.t.c. | 1.3534 ± 0.0398 | 1.3517 ± 0.0226 | 1.1621 ± 0.0175 | 2.6514 ± 0.0490 | 2.2261 ± 0.0476 | 1.1140 ± 0.0092 |
| G50 JUCAL | 1.2072 ± 0.0358 | 1.2228 ± 0.0244 | 1.1385 ± 0.0094 | 2.2334 ± 0.0199 | 2.0633 ± 0.0291 | 1.1005 ± 0.0051 |
| Ensemble Type | DBpedia | News | SST-2 | SetFit | Tweet | IMDB |
|---|---|---|---|---|---|---|
| G5 | 0.0432 ± 0.0012 | 0.2321 ± 0.0031 | 0.1534 ± 0.0044 | 0.4067 ± 0.002 | 0.5311 ± 0.0065 | 0.1334 ± 0.0064 |
| G5 p.t.c. | 0.0341 ± 0.0008 | 0.2050 ± 0.0026 | 0.1472 ± 0.0020 | 0.4051 ± 0.0018 | 0.5294 ± 0.0062 | 0.1314 ± 0.0043 |
| G5 JUCAL | 0.0326 ± 0.0008 | 0.1966 ± 0.0026 | 0.1396 ± 0.002 | 0.3684 ± 0.0018 | 0.5205 ± 0.0059 | 0.1303 ± 0.0034 |
| G50 | 0.0352 ± 0.0009 | 0.1967 ± 0.0032 | 0.1320 ± 0.0035 | 0.3594 ± 0.0014 | 0.4980 ± 0.0063 | 0.1258 ± 0.0020 |
| G50 p.t.c. | 0.0346 ± 0.0004 | 0.1964 ± 0.0031 | 0.1320 ± 0.0034 | 0.3594 ± 0.0014 | 0.4979 ± 0.0061 | 0.1255 ± 0.0014 |
| G50 JUCAL | 0.0305 ± 0.0008 | 0.1899 ± 0.0028 | 0.1309 ± 0.0034 | 0.3480 ± 0.0013 | 0.4979 ± 0.0059 | 0.1257 ± 0.0018 |
| Ensemble Type | DBpedia | News | SST-2 | SetFit | Tweet | IMDB |
|---|---|---|---|---|---|---|
| G5 | 0.9895 ± 0.0001 | 0.9769 ± 0.0002 | 0.979 ± 0.0008 | 0.9406 ± 0.0005 | 0.8982 ± 0.0026 | 0.9809 ± 0.0006 |
| G5 p.t.c. | 0.9895 ± 0.0001 | 0.9769 ± 0.0003 | 0.979 ± 0.0008 | 0.9407 ± 0.0005 | 0.8981 ± 0.0026 | 0.9809 ± 0.0006 |
| G5 JUCAL | 0.9895 ± 0.0001 | 0.9779 ± 0.0003 | 0.9817 ± 0.0004 | 0.95 ± 0.0005 | 0.9025 ± 0.0018 | 0.9819 ± 0.0005 |
| G50 | 0.9893 ± 0.0001 | 0.9748 ± 0.0005 | 0.9822 ± 0.0005 | 0.9503 ± 0.0003 | 0.9091 ± 0.0018 | 0.9821 ± 0.0004 |
| G50 p.t.c. | 0.9893 ± 0.0001 | 0.9748 ± 0.0005 | 0.9822 ± 0.0005 | 0.9503 ± 0.0003 | 0.9091 ± 0.0018 | 0.9821 ± 0.0004 |
| G50 JUCAL | 0.9896 ± 0.0 | 0.978 ± 0.0005 | 0.9828 ± 0.0005 | 0.9554 ± 0.0002 | 0.9099 ± 0.0017 | 0.9822 ± 0.0005 |
| Ensemble Type | DBpedia | News | SST-2 | SetFit | Tweet | IMDB |
|---|---|---|---|---|---|---|
| G5 | 0.9998 ± 0.0 | 0.9899 ± 0.0002 | 0.9853 ± 0.0007 | 0.9539 ± 0.0004 | 0.9226 ± 0.0015 | 0.9872 ± 0.0007 |
| G5 p.t.c. | 0.9998 ± 0.0 | 0.9899 ± 0.0001 | 0.9853 ± 0.0007 | 0.9539 ± 0.0004 | 0.9225 ± 0.0015 | 0.9872 ± 0.0007 |
| G5 JUCAL | 0.9998 ± 0.0 | 0.9905 ± 0.0002 | 0.9874 ± 0.0005 | 0.9620 ± 0.0004 | 0.9253 ± 0.0019 | 0.9883 ± 0.0006 |
| G50 | 0.9997 ± 0.0 | 0.9889 ± 0.0005 | 0.9878 ± 0.0008 | 0.9632 ± 0.0002 | 0.9302 ± 0.0013 | 0.9886 ± 0.0001 |
| G50 p.t.c. | 0.9997 ± 0.0 | 0.9889 ± 0.0005 | 0.9878 ± 0.0008 | 0.9632 ± 0.0002 | 0.9302 ± 0.0013 | 0.9886 ± 0.0001 |
| G50 JUCAL | 0.9998 ± 0.0 | 0.9907 ± 0.0003 | 0.9885 ± 0.0008 | 0.9667 ± 0.0001 | 0.9306 ± 0.0012 | 0.9886 ± 0.0002 |
| Ensemble Type | DBpedia | News | SST-2 | SetFit | Tweet | IMDB |
|---|---|---|---|---|---|---|
| G5 | 1.3673 ± 0.0702 | 1.4414 ± 0.0167 | 1.2467 ± 0.0135 | 2.2989 ± 0.0027 | 2.2997 ± 0.0356 | 1.2392 ± 0.0099 |
| G5 p.t.c. | 1.4313 ± 0.0695 | 1.4475 ± 0.0184 | 1.2504 ± 0.0149 | 2.3124 ± 0.0136 | 2.3028 ± 0.0366 | 1.2347 ± 0.0158 |
| G5 JUCAL | 1.4522 ± 0.0567 | 1.4131 ± 0.0276 | 1.2091 ± 0.0115 | 1.9976 ± 0.0254 | 2.2110 ± 0.0277 | 1.2148 ± 0.0115 |
| G50 | 1.6459 ± 0.0546 | 1.7193 ± 0.0952 | 1.1918 ± 0.0132 | 2.1899 ± 0.0061 | 2.1735 ± 0.0475 | 1.1821 ± 0.0043 |
| G50 p.t.c. | 1.6453 ± 0.0563 | 1.7274 ± 0.0792 | 1.1933 ± 0.0119 | 2.2008 ± 0.0059 | 2.1684 ± 0.0414 | 1.1831 ± 0.0092 |
| G50 JUCAL | 1.3105 ± 0.0232 | 1.4389 ± 0.0334 | 1.1862 ± 0.0120 | 1.8980 ± 0.0086 | 2.1470 ± 0.0444 | 1.1819 ± 0.0126 |
| Dataset | Classes | Members | Train Size | Valid Size | Test Size |
|---|---|---|---|---|---|
| DBpedia Full | 14 | 25 | 448,000 | 112,000 | 70,000 |
| DBpedia Mini | 14 | 65 | 44,800 | 112,000 | 70,000 |
| News Full | 4 | 99 | 96,000 | 24,000 | 7,600 |
| News Mini | 4 | 120 | 9,600 | 24,000 | 7,600 |
| SST-2 Full | 2 | 125 | 43,103 | 13,470 | 10,776 |
| SST-2 Mini | 2 | 125 | 4,310 | 13,470 | 10,776 |
| Dataset | Ensemble Method | Ensemble Selection Time (s) | Calibration Time (s) |
|---|---|---|---|
| DBpedia Full | JUCAL Greedy-50 | 17.6798 0.5566 | 680.2392 9.9481 |
| DBpedia Full | JUCAL Greedy-5 | 0.6779 0.5347 | 92.5821 7.4349 |
| DBpedia Mini | JUCAL Greedy-50 | 51.0481 5.3242 | 764.0273 26.3293 |
| DBpedia Mini | JUCAL Greedy-5 | 0.8412 0.0215 | 99.8790 12.2445 |
| News Full | JUCAL Greedy-50 | 8.8411 0.2699 | 78.3229 0.8914 |
| News Full | JUCAL Greedy-5 | 0.6653 0.5407 | 11.2228 0.3444 |
Uncertainty Calibration
Uncertainty calibration aligns model confidence and predictive intervals with observed correctness and outcome frequencies.
See all 264 papers