In this paper, we study the problem of uncertainty estimation and calibration for LLMs. We first formulate the uncertainty estimation problem for LLMs and then propose a supervised approach that takes advantage of the labeled datasets and estimates the uncertainty of the LLMs' responses. Based on the formulation, we illustrate the difference between the uncertainty estimation for LLMs and that for standard ML models and explain why the hidden neurons of the LLMs may contain uncertainty information. Our designed approach demonstrates the benefits of utilizing hidden activations to enhance uncertainty estimation across various tasks and shows robust transferability in out-of-distribution settings. We distinguish the uncertainty estimation task from the uncertainty calibration task and show that a better uncertainty estimation mode leads to a better calibration performance. Furthermore, our method is easy to implement and adaptable to different levels of model accessibility including black box, grey box, and white box.
翻译:本文研究大型语言模型(LLM)的不确定性估计与校准问题。我们首先系统阐述了LLM不确定性估计的问题设定,进而提出一种充分利用标注数据集的监督方法,用于估计LLM响应的不确定性。基于该问题设定,我们揭示了LLM不确定性估计与标准机器学习模型之间的本质差异,并阐释了LLM隐藏神经元蕴含不确定性信息的原理。所提出的方法展示了利用隐藏激活增强各类任务不确定性估计的优势,并在分布外场景中展现出稳健的可迁移性。我们严格区分了不确定性估计任务与不确定性校准任务,证明更优的不确定性估计模式能带来更好的校准性能。此外,该方法易于实现,可灵活适配不同级别的模型访问权限,包括黑盒、灰盒和白盒场景。