Quantifying Uncertainty in Answers from any Language Model and Enhancing their Trustworthiness

Jiuhai Chen, Jonas Mueller
8/30/2023
cs.CLcs.AI

No official code found. Best implementation: anudeep22003/self-reflect (0 stars, last commit 2025-08-15).

Abstract

We introduce BSDetector, a method for detecting bad and speculative answers from a pretrained Large Language Model by estimating a numeric confidence score for any output it generated. Our uncertainty quantification technique works for any LLM accessible only via a black-box API, whose training data remains unknown. By expending a bit of extra computation, users of any LLM API can now get the same response as they would ordinarily, as well as a confidence estimate that cautions when not to trust this response. Experiments on both closed and open-form Question-Answer benchmarks reveal that BSDetector more accurately identifies incorrect LLM responses than alternative uncertainty estimation procedures (for both GPT-3 and ChatGPT). By sampling multiple responses from the LLM and considering the one with the highest confidence score, we can additionally obtain more accurate responses from the same LLM, without any extra training steps. In applications involving automated evaluation with LLMs, accounting for our confidence scores leads to more reliable evaluation in both human-in-the-loop and fully-automated settings (across both GPT 3.5 and 4).

View on arXivView PDF

Code Implementations(1)

Implementing algorithm for detecting bad outputs from LLMs described in Quantifying Uncertainty in Answers from any Language Model and Enhancing their Trustworthiness (Chen & Mueller, ACL’24).

00Shell, PythonAug 15, 20251 years ago

Similar Papers

Cite this paper

@article{chen2023quantifying,
  title  = {Quantifying Uncertainty in Answers from any Language Model and Enhancing their Trustworthiness},
  author = {Jiuhai Chen and Jonas Mueller},
  year   = {2023},
  eprint = {2308.16175},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2308.16175v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2308.16175.svg)](https://codeofpaper.com/paper/2308.16175)

Discussion