Skip to main content
QUICK REVIEW

[Paper Review] Quantifying Uncertainty in Answers from any Language Model and Enhancing their Trustworthiness

Jiuhai Chen, Jonas Mueller|arXiv (Cornell University)|Aug 30, 2023
Topic ModelingComputer Science7 citations
TL;DR

This paper introduces BSDetector, a method to quantify uncertainty in outputs from any black-box large language model (LLM) by sampling multiple responses and computing a confidence score based on semantic similarity and temperature variation. It enables users to identify unreliable or hallucinated answers and improve accuracy by selecting the highest-confidence response without retraining, significantly enhancing trustworthiness in both human-in-the-loop and fully automated LLM evaluation settings.

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).

Motivation & Objective

  • To address the unreliability of LLMs in high-stakes applications due to hallucinated or overconfident responses.
  • To develop a method for uncertainty quantification that works with any LLM accessible only via a black-box API, without access to training data.
  • To enhance the trustworthiness of LLM outputs by providing a numeric confidence score that flags low-quality responses.
  • To improve answer accuracy by selecting the highest-confidence response from multiple LLM generations, without additional training.
  • To enable more reliable automated and human-in-the-loop evaluation of LLM outputs using confidence-based filtering.

Proposed method

  • BSDetector samples multiple responses from the same LLM using varying temperature settings and prompt variations.
  • It computes a confidence score by measuring semantic similarity between the generated responses using a sentence embedding model.
  • The confidence score is derived from the consistency of responses across multiple samplings, with lower scores indicating higher uncertainty or potential hallucination.
  • The method leverages intrinsic (response consistency) and extrinsic (semantic similarity) evaluation to estimate reliability.
  • It enables selection of the highest-confidence response from multiple generations to improve accuracy without model fine-tuning.
  • It supports both human-in-the-loop and fully automated evaluation by filtering low-confidence responses before aggregation.
(a) Pipeline of BSDetector , which can be applied to any LLM API. ( $T=1.0$ means temperature sampling with parameter 1.0, Sim ( $\cdot$ , $\cdot$ ) means the semantic similarities between two sentences.)
(a) Pipeline of BSDetector , which can be applied to any LLM API. ( $T=1.0$ means temperature sampling with parameter 1.0, Sim ( $\cdot$ , $\cdot$ ) means the semantic similarities between two sentences.)

Experimental results

Research questions

  • RQ1Can a black-box LLM’s uncertainty be reliably quantified without access to its training data or architecture?
  • RQ2Does selecting the highest-confidence response from multiple LLM generations improve answer accuracy without retraining?
  • RQ3Can confidence scores from BSDetector improve the reliability of automated LLM-based evaluation in both human-in-the-loop and fully automated settings?
  • RQ4How does confidence-based filtering compare to random filtering in reducing variance and improving accuracy of LLM evaluation scores?
  • RQ5To what extent does BSDetector reduce error rates in question-answering benchmarks compared to baseline uncertainty estimation methods?

Key findings

  • BSDetector outperforms alternative uncertainty estimation methods in identifying incorrect LLM responses on both closed- and open-domain QA benchmarks, including GPT-3 and ChatGPT.
  • Selecting the highest-confidence response from multiple LLM generations improves answer accuracy without any additional training or model fine-tuning.
  • In human-in-the-loop evaluation, confidence-based selection of human-evaluated answers reduced error rates compared to random selection, improving reliability across both TriviaQA and Summarize-from-feedback datasets.
  • In fully automated evaluation, discarding the 20% of responses with the lowest confidence scores led to a more accurate average GPT-4 evaluation score, achieving an MSE improvement and reaching an accuracy of 1.0 on TriviaQA.
  • Randomly discarding 20% of responses increased variance without improving accuracy, confirming that confidence-based filtering provides a meaningful performance gain.
  • The method is effective across different LLMs (GPT-3.5 and GPT-4) and application types, including factual QA and summarization, demonstrating broad applicability.
(b) Two prompts from a Trivia Q&A dataset (Joshi et al., 2017 ) and the responses from ChatGPT, along with the associated confidence scores from BSDetector .
(b) Two prompts from a Trivia Q&A dataset (Joshi et al., 2017 ) and the responses from ChatGPT, along with the associated confidence scores from BSDetector .

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.