Skip to main content
QUICK REVIEW

[Paper Review] Generating with Confidence: Uncertainty Quantification for Black-box Large Language Models

Zhen Lin, Shubhendu Trivedi|arXiv (Cornell University)|May 30, 2023
Topic ModelingComputer Science35 citations
TL;DR

The paper develops and compares uncertainty and confidence measures for uncertainty quantification in natural language generation from black-box LLMs, using multiple sample generations and similarity-based scoring to enable selective generation.

ABSTRACT

Large language models (LLMs) specializing in natural language generation (NLG) have recently started exhibiting promising capabilities across a variety of domains. However, gauging the trustworthiness of responses generated by LLMs remains an open challenge, with limited research on uncertainty quantification (UQ) for NLG. Furthermore, existing literature typically assumes white-box access to language models, which is becoming unrealistic either due to the closed-source nature of the latest LLMs or computational constraints. In this work, we investigate UQ in NLG for *black-box* LLMs. We first differentiate *uncertainty* vs *confidence*: the former refers to the ``dispersion'' of the potential predictions for a fixed input, and the latter refers to the confidence on a particular prediction/generation. We then propose and compare several confidence/uncertainty measures, applying them to *selective NLG* where unreliable results could either be ignored or yielded for further assessment. Experiments were carried out with several popular LLMs on question-answering datasets (for evaluation purposes). Results reveal that a simple measure for the semantic dispersion can be a reliable predictor of the quality of LLM responses, providing valuable insights for practitioners on uncertainty management when adopting LLMs. The code to replicate our experiments is available at https://github.com/zlin7/UQ-NLG.

Motivation & Objective

  • Motivate the need for uncertainty quantification (UQ) in NLG and selectivity when using black-box LLMs.
  • Propose simple, practical uncertainty and confidence measures based on multiple generations and cross-sample similarity.
  • Differentiate between predictive uncertainty and prediction confidence in the context of NLG.
  • Demonstrate the effectiveness of proposed measures on QA tasks across multiple LLMs and datasets.
  • Provide replication code to enable adoption and benchmarking in practice.

Proposed method

  • Generate m samples for a given input x using the black-box LLM.
  • Compute pairwise similarity scores a(s_j1, s_j2) between generated responses (e.g., Jaccard, NLI-based entailment/contradiction).
  • Construct uncertainty or confidence measures from similarities (e.g., U(x), C(x, s_j)) using methods such as semantic set counting, graph Laplacian eigenvalues, degree-based metrics, and embedding-based eccentricity.
  • Use these measures to perform selective generation (reject or accept) and to predict per-response quality.
  • Evaluate measures by predicting whether generations are correct and by reporting AUROC and Accuracy-Rejection Curve (ARC).
  • Compare against baselines including NumSet, LexiSim, and white-box semantic entropy (SE) and P(true) where applicable.

Experimental results

Research questions

  • RQ1How can uncertainty quantification be performed for black-box LLMs in NLG without access to token-level logits?
  • RQ2Which simple, scalable similarity-based measures best predict the quality of LLM-generated responses?
  • RQ3Can uncertainty/confidence estimates enable effective selective generation in QA settings across diverse LLMs and datasets?

Key findings

  • A simple semantic dispersion measure based on cross-sample similarities can reliably predict the quality of LLM responses.
  • Confidence-based measures Deg and Ecc generally outperform uncertainty-only measures in per-response quality prediction, especially under C+IA (confidence plus individual accuracy) settings.
  • Two white-box baselines (Semantic Entropy SE and P(true)) are outperformed by several black-box measures in many configurations, highlighting practical utility.
  • Varying the number of samples m shows that even small m (e.g., m=3) yields meaningful gains in selective generation performance.
  • Across QA datasets (CoQA, TriviaQA, Natural Questions) and models (OPT, LLaMA, LLaMA2, GPT-3.5-turbo), the proposed measures improve AUARC relative to baselines, with notable gains in selective accuracy.

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.