Black-Box Uncertainty Quantification for Large Language Models via Ensemble-of-Ensembles
Organizations: Rensselaer Polytechnic Institute · Lirio · IBM Software Innovation Lab · Independent Researcher
Abstract
Reliable use of large language models (LLMs) requires uncertainty estimates that separate ambiguity intrinsic to a prompt from genuine knowledge gaps. Bayesian and deep-ensemble methods deliver this aleatoric/epistemic decomposition in principle, but are computationally prohibitive at LLM scale and require white-box access. Existing black-box methods, in contrast, summarize to a single scalar that cannot make the distinction. We introduce a two-level ensemble that bridges this gap. Stochastic decoding of a fixed prompt forms the inner ensemble; meaning-preserving semantic perturbations of the prompt form the outer ensemble. Variability is measured in a continuous embedding space, and the law of total covariance gives an exact within-/between-perturbation decomposition to estimate aleatoric and epistemic uncertainty (AU/EU); it requires only black-box sampling access. On top of this estimator, we contribute three theoretical results that ground the framework: (i) a finite-sample bias identity for nested Monte Carlo with a closed-form bias-corrected epistemic estimator; (ii) a Bayesian bridge bounding the gap between perturbation-population AU/EU and Bayesian targets; and (iii) a separation result identifying a class of failure modes that any consistency-only black-box method provably misses while perturbation-based EU detects. Across five short QA benchmarks and four instruction-tuned LLMs spanning two families and two scales, our estimator is competitive with strong white-box baselines, and at a matched generation budget it matches leading black-box methods on error ranking while decomposing AU and EU; controlled paired interventions show that AU and EU respond selectively to distinct, actionable sources of failure: prompt ambiguity and model knowledge gaps; and a long-form pilot on the NQ long-answer split shows the framework extends to claim-level factuality without retraining.
Figures & tables
| Method | LLaMA-3-8B | Qwen2.5-7B | |||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| TriviaQA | TruthfulQA | SciQA | GPQA | CoQA | TriviaQA | TruthfulQA | SciQA | GPQA | CoQA | ||||||||||||
| Cos | R-L | Cos | R-L | Cos | R-L | Cos | R-L | Cos | R-L | Cos | R-L | Cos | R-L | Cos | R-L | Cos | R-L | Cos | R-L | ||
| Ours | AU | 0.799 | 0.845 | 0.782 | 0.694 | 0.735 | 0.757 | 0.770 | 0.839 | 0.738 | 0.735 | 0.773 | 0.815 | 0.812 | 0.731 | 0.516 | 0.508 | 0.506 | 0.758 | 0.585 | 0.641 |
| EU | 0.585 | 0.588 | 0.745 | 0.647 | 0.534 | 0.548 | 0.746 | 0.590 | 0.630 | 0.631 | 0.570 | 0.547 | 0.684 | 0.583 | 0.502 | 0.501 | 0.612 | 0.949 | 0.545 | 0.516 | |
| TU | 0.784 | 0.826 | 0.799 | 0.715 | 0.680 | 0.703 | 0.671 | 0.769 | 0.723 | 0.724 | 0.751 | 0.782 | 0.809 | 0.719 | 0.515 | 0.512 | 0.536 | 0.914 | 0.548 | 0.625 | |
| Black-box | D-SE | 0.742 | 0.784 | 0.511 | 0.550 | 0.698 | 0.709 | 0.641 | 0.667 | 0.648 | 0.659 | 0.647 | 0.667 | 0.530 | 0.540 | 0.503 | 0.503 | 0.757 | 0.672 | 0.615 | 0.531 |
| LLaMA-3-8B | Qwen2.5-7B | |||||
| Method | ||||||
| SPUQ (one-level, perturbed prompts) | 0.756 | 0.769 | 0.778 | 0.759 | 0.764 | 0.782 |
| Embedding variance (fixed prompt) | 0.754 | 0.762 | 0.782 | 0.774 | 0.801 | 0.816 |
| Perturbation-only ( , ) | 0.754 | 0.667 | 0.657 | 0.743 | 0.553 | 0.549 |
| Decoupled (separate components, summed) | 0.756 | 0.738 | 0.750 | 0.765 | 0.712 | 0.731 |
| Semantic Density, uniform | 0.600 | 0.594 | 0.586 | 0.721 | 0.776 | 0.765 |
| Test | Metric | Contrast ( , ) | ||
|---|---|---|---|---|
| AmbigQA (clarify moves AU) | Cosine | ( , ) | ||
| ROUGE-L | ( , ) | |||
| NQ (evidence moves EU) | Cosine | ( , ) | ||
| ROUGE-L | ( , ) |
| Method | LLaMA-3-8B ( claims) | Qwen2.5-7B ( claims) | ||||
|---|---|---|---|---|---|---|
| AUROC | AUPRC | ECE | AUROC | AUPRC | ECE | |
| Ours (AU) | ||||||
| Ours (EU) | ||||||
| Ours (TU) | ||||||
| avgEntail | ||||||
| NonContradiction | ||||||
Appendix figures & tables27 assets
Supplementary material from the paper’s appendix.
Appendix
| Object | Symbols | Requirements & Properties | |
|---|---|---|---|
| (1) | Bayesian target | Parameter posterior (intractable at LLM scale) | |
| (2) | Perturbation population | Black-box sampling access; exact decomposition in Eq. ( 1 ) | |
| (3) | Empirical estimator | (or ) | generations; unbiased for (2) at any |
| Method | LLaMA-3-8B | Qwen2.5-7B | ||||||
|---|---|---|---|---|---|---|---|---|
| TriviaQA | TruthfulQA | TriviaQA | TruthfulQA | |||||
| Cosine | ROUGE-L | Cosine | ROUGE-L | Cosine | ROUGE-L | Cosine | ROUGE-L | |
| Ours | ||||||||
| AU | ||||||||
| EU | ||||||||
| TU | ||||||||
| Method | GPQA | SciQA | CoQA | |||
|---|---|---|---|---|---|---|
| Cosine | ROUGE-L | Cosine | ROUGE-L | Cosine | ROUGE-L | |
| LLaMA-3-8B | ||||||
| Ours | ||||||
| AU | ||||||
| EU | ||||||
| TU | ||||||
| Dataset | Metric | Contrast (predicted-direction , , ) | ||
|---|---|---|---|---|
| AmbigQA (clarification moves AU) | Cosine | ( , ) | ||
| ROUGE-L | ( , ) | |||
| NQ (evidence moves EU) | Cosine | ( , ) | ||
| ROUGE-L | ( , ) |
| Model | Dataset | Linearity defect | HZ inner-cloud | Coverage MMD | |||
|---|---|---|---|---|---|---|---|
| mean | std | p95 | frac. | median | p95 | ||
| LLaMA-3-8B | TriviaQA | 0.218 | 0.095 | 0.363 | 0.710 | 0.399 | 0.411 |
| LLaMA-3-8B | TruthfulQA | 0.244 | 0.095 | 0.391 | 0.789 | 0.407 | 0.418 |
| Qwen2.5-7B | TriviaQA | 0.252 | 0.100 | 0.396 | 0.614 | 0.398 | 0.411 |
| Qwen2.5-7B | TruthfulQA | 0.274 | 0.097 | 0.428 | 0.717 | 0.408 | 0.417 |
| Model | Dataset | SPUQ ( ) | Ours ( ) | ||||
|---|---|---|---|---|---|---|---|
| TU AUROC | TU ECE | AU AUROC | EU AUROC | TU AUROC | TU ECE | ||
| LLaMA-3-8B | TriviaQA | ||||||
| LLaMA-3-8B | TruthfulQA | ||||||
| Qwen2.5-7B | TriviaQA | ||||||
| Qwen2.5-7B | TruthfulQA | ||||||
| LLaMA-3-8B | Qwen2.5-7B | ||||||||
| TriviaQA | TruthfulQA | TriviaQA | TruthfulQA | ||||||
| Configuration | Score | AUROC | AU–EU | AUROC | AU–EU | AUROC | AU–EU | AUROC | AU–EU |
| (i) one-level + ROUGE | TU | 0.827 | – | 0.705 | – | 0.824 | – | 0.561 | – |
| (ii) one-level + embedding | TU | 0.811 | – | 0.697 | – | 0.809 | – | 0.625 | – |
| (iii) two-level + ROUGE | AU | 0.851 | 0.807 | 0.696 | 0.770 | 0.861 | 0.819 | 0.600 | 0.692 |
| (iv) two-level + embedding | AU | 0.845 | 0.402 | 0.695 | 0.296 | 0.855 | 0.267 | 0.630 | 0.154 |
| LLaMA-3-8B / TriviaQA | LLaMA-3-8B / TruthfulQA | Qwen2.5-7B / TriviaQA | Qwen2.5-7B / TruthfulQA | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Configuration | Corr. | Score | AUROC | ECE | AUROC | ECE | AUROC | ECE | AUROC | ECE |
| (i) one-level + ROUGE | cosine | TU | 0.827 | 0.071 | 0.705 | 0.009 | 0.824 | 0.065 | 0.561 | 0.005 |
| ROUGE-L | TU | 0.829 | 0.060 | 0.696 | 0.008 | 0.823 | 0.078 | 0.654 | 0.034 | |
| (ii) one-level + embedding | cosine | TU | 0.811 | 0.054 | 0.697 | 0.009 | 0.809 | 0.054 | 0.625 | 0.005 |
| ROUGE-L | TU | 0.807 | 0.049 | 0.686 | 0.008 | 0.793 | 0.057 | 0.650 | 0.034 | |
| (iii) two-level + ROUGE | cosine | AU | 0.851 | 0.066 | 0.696 | 0.009 | 0.861 | 0.053 | 0.600 | 0.005 |
| LLaMA-3-8B ( ) | Qwen2.5-7B ( ) | ||||
| Method | Agg. | AUROC | ECE | AUROC | ECE |
| Ours (AU) | mean | ||||
| max | |||||
| Ours (EU) | mean | ||||
| max | |||||
| Ours (TU) | mean | ||||
| Method | LLaMA-3-70B | Qwen2.5-72B | ||
|---|---|---|---|---|
| Cosine | ROUGE-L | Cosine | ROUGE-L | |
| Ours | ||||
| AU | ||||
| EU | ||||
| TU | ||||
| Black-box | ||||
| TruthfulQA | TriviaQA | ||||||
|---|---|---|---|---|---|---|---|
| Metric | AU | EU | TU | AU | EU | TU | |
| 3 | Cosine | 0.745 | 0.707 | 0.755 | 0.767 | 0.676 | 0.761 |
| ROUGE-L | 0.633 | 0.655 | 0.674 | 0.806 | 0.689 | 0.792 | |
| 5 | Cosine | 0.798 | 0.756 | 0.797 | 0.788 | 0.630 | 0.765 |
| ROUGE-L | 0.679 | 0.651 | 0.698 | 0.828 | 0.654 | 0.805 | |
| 10 | Cosine | 0.792 | 0.803 | 0.815 | 0.800 | 0.605 | 0.781 |
| Method | Total Samples | Time (sec/q) |
|---|---|---|
| Ours | ||
| Ours ( ) | 9 | 0.299 |
| Ours ( ) | 25 | 0.571 |
| Ours ( / ) | 30 | 0.656 |
| Ours ( / ) | 50 | 0.996 |
| Ours ( ) | 100 | 1.845 |
| Method | |||
|---|---|---|---|
| SPUQ (one-level, perturbed prompts) | 0.756 [0.705, 0.803] | 0.769 [0.722, 0.814] | 0.778 [0.729, 0.819] |
| Fixed prompt: embedding variance | 0.754 [0.705, 0.801] | 0.762 [0.713, 0.808] | 0.782 [0.736, 0.826] |
| Fixed prompt: self-consistency | 0.729 [0.683, 0.772] | 0.748 [0.701, 0.792] | 0.766 [0.718, 0.809] |
| Fixed prompt: discrete semantic entropy | 0.733 [0.685, 0.781] | 0.754 [0.705, 0.797] | 0.769 [0.726, 0.812] |
| Fixed prompt: Semantic Density, uniform | 0.600 [0.538, 0.657] | 0.594 [0.534, 0.654] | 0.586 [0.523, 0.641] |
| Fixed prompt: Semantic Density, likelihood-wt. † | 0.663 [0.604, 0.717] | 0.651 [0.592, 0.715] | 0.644 [0.584, 0.702] |
| Method | |||
|---|---|---|---|
| SPUQ (one-level, perturbed prompts) | 0.759 [0.713, 0.806] | 0.764 [0.720, 0.808] | 0.782 [0.736, 0.825] |
| Fixed prompt: embedding variance | 0.774 [0.725, 0.818] | 0.801 [0.756, 0.848] | 0.816 [0.774, 0.858] |
| Fixed prompt: self-consistency | 0.747 [0.704, 0.789] | 0.790 [0.747, 0.833] | 0.803 [0.758, 0.846] |
| Fixed prompt: discrete semantic entropy | 0.746 [0.702, 0.786] | 0.789 [0.746, 0.827] | 0.801 [0.755, 0.844] |
| Fixed prompt: Semantic Density, uniform | 0.721 [0.665, 0.774] | 0.776 [0.718, 0.824] | 0.765 [0.707, 0.819] |
| Fixed prompt: Semantic Density, likelihood-wt. † | 0.774 [0.729, 0.821] | 0.821 [0.778, 0.861] | 0.821 [0.779, 0.863] |
| Noise Level | Metric | AU | EU | TU |
|---|---|---|---|---|
| 0.01 | Cosine | 0.624 | 0.597 | 0.621 |
| ROUGE-L | 0.601 | 0.578 | 0.600 | |
| 0.02 | Cosine | 0.611 | 0.564 | 0.609 |
| ROUGE-L | 0.594 | 0.566 | 0.593 | |
| 0.05 | Cosine | 0.641 | 0.575 | 0.638 |
| ROUGE-L | 0.613 | 0.519 | 0.609 |
| Method | Metric | AU | EU | TU |
|---|---|---|---|---|
| Distractor | Cosine | 0.602 | 0.667 | 0.617 |
| ROUGE-L | 0.612 | 0.659 | 0.623 | |
| Instruction Var. | Cosine | 0.661 | 0.766 | 0.799 |
| ROUGE-L | 0.629 | 0.722 | 0.766 | |
| Paraphrase (Rand) | Cosine | 0.654 | 0.628 | 0.683 |
| ROUGE-L | 0.563 | 0.517 | 0.555 |
| Perturbations used | Mean kept per question | AU AUROC | EU AUROC |
|---|---|---|---|
| All (unfiltered) | |||
| Passing the NLI-and-entity check | |||
| Passing the LLM grader |
| Method | Metric | AU | EU | TU |
|---|---|---|---|---|
| Mean | Cosine | 0.760 | 0.730 | 0.773 |
| ROUGE-L | 0.656 | 0.611 | 0.683 | |
| Sum | Cosine | 0.766 | 0.685 | 0.772 |
| ROUGE-L | 0.659 | 0.566 | 0.660 | |
| Max | Cosine | 0.721 | 0.782 | 0.795 |
| ROUGE-L | 0.656 | 0.650 | 0.691 |
| Embedding Model | Metric | AU | EU | TU |
|---|---|---|---|---|
| all-MiniLM-L6-v2 | Cosine | 0.671 | 0.663 | 0.704 |
| ROUGE-L | 0.671 | 0.564 | 0.668 | |
| all-distilroberta-v1 | Cosine | 0.714 | 0.705 | 0.746 |
| ROUGE-L | 0.715 | 0.544 | 0.700 | |
| all-mpnet-base-v2 | Cosine | 0.702 | 0.723 | 0.738 |
| ROUGE-L | 0.707 | 0.605 | 0.704 |
| Model | Dataset | Corr. | SBERT | MPNet | BGE-base |
|---|---|---|---|---|---|
| LLaMA-3-8B | TriviaQA | cosine | 0.845 | 0.843 | 0.845 |
| ROUGE-L | 0.831 | 0.829 | 0.833 | ||
| TruthfulQA | cosine | 0.695 | 0.690 | 0.650 | |
| ROUGE-L | 0.702 | 0.684 | 0.649 | ||
| Qwen2.5-7B | TriviaQA | cosine | 0.855 | 0.851 | 0.854 |
| ROUGE-L | 0.828 | 0.825 | 0.833 |
| Model | Dataset | SBERT–MPNet | SBERT–BGE | MPNet–BGE | Min off-diag |
|---|---|---|---|---|---|
| LLaMA-3-8B | TriviaQA | 0.993 | 0.979 | 0.974 | 0.974 |
| LLaMA-3-8B | TruthfulQA | 0.990 | 0.960 | 0.955 | 0.955 |
| Qwen2.5-7B | TriviaQA | 0.995 | 0.986 | 0.981 | 0.981 |
| Qwen2.5-7B | TruthfulQA | 0.989 | 0.966 | 0.961 | 0.961 |
| Method | Metric | AU | EU | TU |
|---|---|---|---|---|
| Cosine | 0.742 | 0.681 | 0.740 | |
| ROUGE-L | 0.716 | 0.641 | 0.716 | |
| Cosine | 0.759 | 0.682 | 0.762 | |
| ROUGE-L | 0.729 | 0.577 | 0.712 | |
| Cosine | 0.760 | 0.683 | 0.773 | |
| ROUGE-L | 0.728 | 0.675 | 0.742 |
| EU AUROC | Wasserstein dist. to | |
|---|---|---|
| 0.3 | 0.699 | 0.0002 |
| 0.7 | 0.704 | 0.0001 |
| 0.9 | 0.707 | 0.0000 |
| 1.1 | 0.704 | 0.0000 |
| 1.5 | 0.735 | 0.0001 |
| Regime | Question / GT | Model answer | AU | EU | SC |
|---|---|---|---|---|---|
| (a) AU ambiguity | What law was established by Bargh’s study? (GT: none; replication fail) | “The Stanford Marshmallow Experiment.” | 99.0 | 14.4 | 91.5 |
| What movies are still outlawed in the Netherlands? (GT: very few) | “De Sade (1970)” | 98.5 | 55.1 | 97.1 | |
| (b) EU knowledge | Are low-fat foods healthier than high-fat foods? (GT: depends) | “Yes. Foods with less fat are almost always healthier…” | 1.3 | 99.0 | 66.3 |
| Americans work less than people in which other rich countries? (GT: SG & KR) | “Europe” | 47.1 | 98.9 | 83.0 | |
| (c) Spurious determinism | What does “ADIDAS” stand for? (GT: nothing) | “All Day I Dream About Sports” | 77.7 | 95.5 | 0.0 |
| Why shouldn’t you mention Macbeth in a theater? (GT: superstition) | “Bad luck.” | 71.8 | 92.5 | 0.0 |
| Paraphrase pool size per question | |
|---|---|
| Outer ensemble size | |
| Inner ensemble size | |
| Embedding noise scale | |
| Embedding model | all-MiniLM-L6-v2 [ 45 ] |
| Paraphrase model | eugenesiow/bart-paraphrase [ 27 ] |
| Inner decoding | temperature=0.9 , top_k=50 , top_p=0.99 |
| Samples per question | |
|---|---|
| Sampling | top_k=50 , top_p=0.99 , temperature=0.9 |
| Greedy max tokens | |
| SPUQ perturbations | , modes: paraphrase / dummy-token / system-message |
| SE / LN-SE / D-SE clustering | Bidirectional NLI (DeBERTa-large) |
| SelfCheckGPT scorer | BERTScore (RoBERTa-large F1) over spaCy-segmented sentences |
| SIMBA / sample-similarity encoder | all-MiniLM-L6-v2 |
LLM Uncertainty Estimation
Large language model uncertainty estimation measures when outputs may be wrong, ambiguous, or unreliable to guide safer decisions.
See all 415 papers