Skip to main content
QUICK REVIEW

[论文解读] Generating with Confidence: Uncertainty Quantification for Black-box Large Language Models

Zhen Lin, Shubhendu Trivedi|arXiv (Cornell University)|May 30, 2023
Topic ModelingComputer Science被引用 35
一句话总结

本文在黑盒 LLMs 的自然语言生成中开发并比较不确定性与置信度度量,用于不确定性量化,使用多次样本生成和基于相似性的评分来实现有选择的生成。

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.

研究动机与目标

  • 在 NLG 中激发对不确定性量化(UQ)以及使用黑盒 LLM 时的选择性的需求。
  • 提出基于多次生成和跨样本相似性的简单、实用的不确定性与置信度度量。
  • 在 NLG 的背景下区分预测不确定性和预测置信度。
  • 在跨多个 LLM 和数据集的问答任务中展示所提度量的有效性。
  • 提供复现代码,以便在实践中推广和基准测试。

提出的方法

  • 使用黑盒 LLM 为给定输入 x 生成 m 个样本。
  • 计算生成回应之间的成对相似度分数 a(s_j1, s_j2)(例如 Jaccard、基于 NLI 的蕴涵/矛盾)。
  • 利用相似性构建不确定性或置信度度量(如 U(x),C(x, s_j)),方法包括语义集合计数、图拉普拉斯特征值、基于度量的度量以及基于嵌入的离心性。
  • 使用这些度量进行有选择的生成(拒绝或接受)并预测每个回应的质量。
  • 通过预测生成结果是否正确并报告 AUROC 和 Accuracy-Rejection Curve (ARC) 来评估度量。
  • 与基线比较,包括 NumSet、LexiSim,以及在适用情况下的白盒语义熵 (SE) 和 P(true)。

实验结果

研究问题

  • RQ1在不可访问逐令牌对数概率的情况下,如何对黑盒 LLM 的 NLG 进行不确定性量化?
  • RQ2哪些简单且可扩展的基于相似性的度量最能预测 LLM 生成回应的质量?
  • RQ3不确定性/置信度评估是否能够在跨多种 LLM 和数据集的问答场景中实现有效的有选择生成?

主要发现

  • 基于跨样本相似性的简单语义离散度度量可以可靠地预测 LLM 回应的质量。
  • 基于置信度的度量 Deg 和 Ecc 在逐个回应质量预测中通常优于仅不确定性度量,特别是在 C+IA(置信度加上个体准确率)设置下。
  • 在许多配置中,两个白盒基线(语义熵 SE 和 P(true))被若干黑盒度量超越,凸显其实用性。
  • 改变样本数 m 表明即使较小的 m(例如 m=3)也能在有选择的生成性能上带来有意义的提升。
  • 在问答数据集(CoQA、TriviaQA、Natural Questions)和模型(OPT、LLaMA、LLaMA2、GPT-3.5-turbo)中,相对于基线,所提出的度量提高了 AUARC,在有选择的准确性方面有显著提升。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。